Jason Evans
Jason Evans

Reputation: 29186

Unable to publish website from Visual studio 2010

We have a an ASP NET MVC website solution which only one out of three devs on the team is able to publish to the live server. When I, and another colleague, attempt to publish the site from VS 2010, the output window will display an error:

Unable to create the Web site '\blah'. The path '\blah' does not exist or you do not have access. The specified path is invalid.

This points to a logon issue which my account, but the developer who can publish the site is a member of all the same user groups as me. As a long-shot, we gave Everyone full access to the folder, but this did not resolve the problem.

Can anyone suggest a more detailed way to try and figure out why we cannot publish the site? There must be a permission set somewhere that is allowing my colleague to publish the site from Visual Studio.

Upvotes: 29

Views: 31538

Answers (7)

greg
greg

Reputation: 1873

I have also found that mapping a drive to the UNC location can be a work around.

@soupy1976's solution has also worked for me. I can not explain why one day it will work and one day it won't

Frustrating....

Upvotes: 0

soupy1976
soupy1976

Reputation: 2845

I had this issue - certain members of our team were able to publish directly from VS2010, whereas for some reason I was always getting permission denied errors, even though we were all able to connect to the server we were trying to deploy to. I fixed it in the following way:

Go to "Server Explorer".

Right click "Servers" and go to "Add server..."

Type in the name of the server you are trying to connect to, and then click on "Connect using a different user name..." - put the credentials for logging into the server in here.

Click OK and wait for it to add the server.

Now try and publish to that server and it should be ok...

Not sure why I needed to do this and others were able to deploy without adding the server in this way... remains unexplained.

According to the comments below:

  • You may need to restart Visual Studio in order for this to take effect.
  • This should also work for newer versions of Visual Studio

Upvotes: 24

peroija
peroija

Reputation: 1982

Faced the same problem today. In my situation I had to close VS2010 and open it NOT as an admin and it worked without any problems.

Upvotes: 13

Alet
Alet

Reputation: 671

I had this problem and racked my brain trying to resolve it so I wouldn't have to copy the publish files to a remote server manually. I spent a great deal of time actively trying to get this to work.

Here's how I solved the problem: I went to File>Open in Visual Studio 2010 Express and navigated to the remote server (\\255.255.255.255\folder1\folder2\folder3 and so on). Right away I was challenged for a User Name an Password. I entered the credentials for the REMOTE server, checked the box to 'Remember my credentials'. I immediately tried to publish and voilá - it worked like a charm.

I hope this saves a lot of people a lot of time.

Upvotes: 67

iwalkbarefoot
iwalkbarefoot

Reputation: 955

In IIS can you check to see that all users/groups are listed under Management Service Delegation in IIS Manager? It is listed under the Server node in IIS. Alternatively you can give all administrators access by clicking on Edit Features from the side-menu and checking Allow Administrators to bypass rules.

You could also check under IIS Manager Permissions for the individual site to see if the person that can publish is listed under there and you are not.

I just recently setup MSDeploy access on my server and found the following two tutorials helpful:

http://william.jerla.me/post/2010/03/20/Configuring-MSDeploy-in-IIS-7.aspx

http://code-inside.de/blog-in/2011/04/03/howto-setup-of-webdeploy-msdeploy/

Upvotes: 0

Gary B
Gary B

Reputation: 21

This got me for a long time...Go to Project - Properties and select the Package/Publish Web tab. Under the header "Web Deployment Package Settings", there's a ellipsis button that you can use to map to the location you want to publish. You will be asked for your credentials during that process.

Upvotes: 2

JK.
JK.

Reputation: 21810

Are you using web deploy (right click and choose Publish)?

Have you tried copying the ProjectName.Publish.xml file from the one machine where you can publish to the other two machines? The login credentials for publishing are saved in this file.

Upvotes: 1

Related Questions