In my visual studio asp.net mvc applications I have 4 build configurations; one is to use IIS as the web server, which requires "run as administrator" when running visual studio.
So I ran as admin and created some new files. I have a multi-project template that I use for all my web applications. So I copied the new files from the project I was using back to my template project because they would be useful for all my projects, but didn't think about the "run as administrator" thing.
So now when I create a new project from my template and try to run the asp.net development web server nothing happens, but when a run as administrator the web server loads everything with no problems.
So my question is how can I remove the "run as administrator" requirements from all the files and folders, and I really don't know which files were added, there were many? I have to remove the administrator requirement because many people maintain the code besides me after its in production. Do I need to just recreate the entire project template?
I am using VS 2008 sp1, Windows 7 RC
The Run As Administrator requirement for VS is based on it requiring access to IIS, if I remember correctly, not the files themselves.
People on other machines that don't have this level of UAC protection, say Windows XP, should not have this problem.
The problem is very likely that some of the files are owned by an administrative user and cannot be overwritten by non-administrative users. The ACLs on the files likely need to be updated. One way to do this is to right-click Properties on every file, go to the security tab, and add the appropriate users/groups with the appropriate permissions to each file (probably try to match the files that already exist and have correct permissions).
There is a command line tool called CACLS (more info here and here) that can do this much more quickly, but it's non-trivial and you don't want to screw it up. You would run CACLS as the owner of the directory or the administrator to grant permissions to non-administrators.
Here's an example that gives user "Michael" full control to the SQL Server data directory and all subdirectories and files:
CACLS C:\SQLData\MSSQL$INSTANCE1 /T /E /G Michael:F
Please note that I have no experience with Windows 7. ACLs have been around since the first version of Windows NT and I'm assuming nothing changed radically in Windows 7.
Related
I was trying to uninstall TFS 217 update 3.1 going through the control panel ->uninstall a program . When I click on TFS 2017 update 3.1 I am getting only change option not getting uninstall option. How to uninstall ?
We do not uninstall TFS server from control panel--Programs and Features. Use the unconfigure instead, it's similar to the way we usually uninstall other software.
To "Unconfigure TFS", please go to the Team Foundation Administration Console on the Application Tier machine. Click on the server name and click on "Remove Feature"
By Removing the feature, we will be removing
The Application Tier configuration from the server (but we don't
remove the binaries)
Connection with Data tier (but the databases won’t be deleted)
TFS Website.
TFS Application Pools
TFS Services (The Visual Studio Team Foundation Server Job Agent)
You can do the same from command prompt, execute TfsConfig setup /uninstall:ApplicationTier command to unconfigure TFS Application Tier. (You can also use various switches to remove other features SharePointExtensions, TeamBuild and VersionControlP
roxy) from server machine.
Usually we'd like to refresh the TFS Application Tier setup to defaults in case there's an unintended change in services/IIS settings and we want to set it back to defaults. We give an option to Remove Application Tier/Features without having to uninstall the complete application.
Another usage is when you are using pre-upgrade for test, you could quickly remove Application Tier. Since everything have been migrated, if you don't need the TFS server any more, just simply uninstall the complete application and database.You could back up your database, once you want to use again. Just install a new application and restore your database.
Hope this helps.
I have created a brand new ASP.NET MVC 5 project in VS2015 Enterprise (update 3). It runs as expected on that machine. However, when I copy/paste the whole project to a different machine running VS2015 community edition (update 3), the site fails to load and I get the error message:
The program '[1648] iisexpress.exe has exited with code 0 (0x0).
Here's the kicker - Creating a new ASP.NET MVC 5 project in VS community edition and copy/pasting and running it in VS2015 enterprise in the same way, however, works normally without any configuration changes. I have recreated the files in the users\documents\IISExpress folder as pointed out by other SO questions, tried changing ports, but to no avail.
EDIT: IIS immediately fails on launching, by the way. It sounds like a config issue, but I'm not sure what to check in this case.
I got the same issue, what i did is just close all the visual studio instances and in your project folder clear the .vs file(mostly it's Hidden). after that open your project.
We have a .net MVC application where it involves deployments every week. We need to package the application and give it to the clients every week for them to install as an .exe or .msi
The package will involve DB changes also and site in IIS is already set.
The exe/msi just has to replace the old files(bin and views) and do the DB changes(run scripts). I don't want client to see either our code or DB script while installing.
So how can I achieve this as a single package?
Now that MVC 3 Tools Update has been released, that's all I see on the Web Platform Installer -- I no longer see MVC 3? Is this because the Tools Update is essentially MVC 3 PLUS enhancements to the development environment? Presumably, none of these additions are needed on a server so I thought that MVC 3 would still be offered for server installs.
So can/should I install the MVC 3 "Tools Update" from the Web Platform installer on a server?
I know this doesn't help you Decker, but it may help others:
The easiest way to get MVC on the server is by using the "Add Deployable Dependancies..." menu:
Also useful for deploying SQL CE.
You can use the installer from WebPI on the server just fine. It will detect if you don't have Visual Studio installed and will only install the runtime.
You could also try unzipping the installer file and only copying the runtime MSIs but I think that's overkill.
You could also use Web Platform Installer from the command line:
webpicmd /install /Products:MVC3Runtime /log:webpi.log /accepteula /SuppressReboot
If your servers don't have internet access, you can use the offline flag from a machine which does have access to download a copy of the required install files.
So your flow would be as follows:
Prepare Cached Version of Installers
webpicmd /Offline /Products:MVC3Runtime /log:webpi.log /Path:"%~dp0wbpiCache"
Install from cache (copy folder structure to target machine)
webpicmd /install /Products:MVC3Runtime /log:webpi.log /accepteula /SuppressReboot /XML:"%~dp0wbpiCache"
You don't need to install MVC3 on a server.
Just copy the MVC DLLs along with your projects.
I'm using WiX to write a MSI installer to start a service that depends on DLLs installed by the MSI. On Vista, the DLLs become added to the global assembly cache in the MSI's InstallFinalize phase, so I can't use the built-in service starting command in WiX. That one tries to start the service before the DLLs are in the GAC, and fails. The solution seems to be to use a custom action instead [1], and run that after InstallFinalize.
The custom action I used was starting the service with sc. Everything works fine when running the installer as an administrator, but running as a regular user doesn't work. The installer will elevate privileges for the actual install phase, but will drop them after finalizing the installation, and starting the service with sc as a non-privileged user will fail. Setting the custom action to be deferred and no-impersonate to get admin privileges won't work either after InstallFinalize [2].
As a final kludge, I tried to add <Condition>Privileged</Condition> to the WiX file to tell the user that the installer needs to be run as Administrator, but I couldn't get that to work either. The Privileged value gets set to 1 during the installation, maybe when the main install sequence is given higher privileges.
So has anyone else ran into the combination of Vista, non-Administrator user, installer needs to start a service and service needs stuff that goes into GAC during installation to run? Is there any kind of working general approach to this?
[1] http://www.mail-archive.com/wix-users#lists.sourceforge.net/msg09162.html
[2] http://www.mail-archive.com/wix-users#lists.sourceforge.net/msg15381.html
This is one of those times when the easiest solution is just to schedule a reboot.
Here are a few possibilities :
If possible, do not install prerequisite assemblies in the GAC. This will allow your service to be started normally (ie between InstallInitialize and InstallFinalize).
Create a bootstrapper (a small app that launches prerequisite MSIs in a certain order). Place the prerequisite assemblies (those that go in the GAC) into their own MSI, and get the bootstrapper to install them before it installs your service.
Create a launcher (an even smaller app that just launches your MSI). Give it a manifest that will make it run elevated. That way, the entire MSI is elevated, not just the part that's between InstallInitialize and InstallFinalize. You should be able to invoke sc succesfully.
I agree with #sascha. Rebooting is not just the easiest but cleanest in this case. All of the other proposed solutions are going to set you up for a much higher failure rate in the future. IMHO, the Windows Installer design w.r.t. the GAC is busted. The reboot is recognition of that.