Reputation: 24679
I just reinstalled IIS7.5 after a lot of ugly messing around. I admittedly had no idea what I was doing.
I finally was able to renamed my windows\system32\inetsrv folder so that when I reinstalled IIS, I would get the default settings.
I took a wild guess at running this and it got my site running: aspnet_regiis.exe -i
Now I just can't Publish from Visual studio to any site under wwwroot.
for example, I get the error: Unable to create the Web site location 'c:\inetpub\wwwroot\WebApplication5'. Access is denied.
My work around is to Publish elsewhere and then copy the code there--and that works.
Goodness knows what else I broke in the process, but my web site appears to work except that I can't use the Publish functionality in VS2010 because of the Access Denied error.
Do I have to grant some ASPNET built in user rights to this folder?
Here's a snapshot of the rights on my wwwroot folder:
Upvotes: 18
Views: 21188
Reputation: 2901
I'm having a similar problem
Access to the path 'C:\Sources\x\bin\Debug\netcoreapp2.1\publish' is denied. Unable to create the Web site location Access is denied.
Access is denied because a subfolder is open in file explorer and locked by file explorer.
Upvotes: 0
Reputation: 2424
Web Deploy is likely to execute under the user name Local Service. Check the permissions for this user.
Upvotes: 0
Reputation: 4307
Another solution is to create a share to your local c:\inetpub\wwwroot
dir (give yourself read/write permissions) and publish to the share like so: \\mypc\wwwroot\mywebsite
. It helped me get around the annoying UAC security without disabling it.
Upvotes: 1
Reputation: 24899
Late to this thread but I fixed this issue by going to:
c:\inetpub\wwwroot\myApplication > right click > properties > security > select Users(myMachine\Users) change access to full
Upvotes: 8
Reputation: 31
Hopefully this thread is still alive. I had this problem and here is how I resolved it:
Try opening a file on the remote site from Visual Studio by File>Open File...
If you don't have access you will be challenged with Windows Sign in. Here you can enter your credentials for accessing the REMOTE site. Once you enter the credentials and the file is successfully opened you will be able to publish. Occassionally (I don't know why) the credentials will become invalid at which time all you have to do is open a file and reenter them.
Upvotes: 3
Reputation: 3069
If you are able to run your application after copying from a different location, the problem is not with IIS or the worker process; it would most likely be a permissions problem with your windows user and process (in this case, visual studio).
Try running visual studio as an administrator (if you are not a local administrator of the machine). If that works, you can give full access to your inetpub folder for your user.
Upvotes: 30