views:

341

answers:

2

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

Thanks Dean

A: 

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, shouldn't have this problem.

Dan Atkinson
A: 

The problem is very likely that some of the files are owned by an administrative user and can't 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.

Michael Maddox