Error when trying to deploy webpart

sharepointsharepoint-2010web-parts

I've been searching on Google for a resolution to this problem, but cannot find one that matches yet.

I'm trying to deploy a simple "Hello World" web part to SharePoint using Visual Studios 2010.

I'm getting an error when I hit F5: "Error occurred in deployment step 'Retract Solution': Cannot connect to the SharePoint site: http://example.com/. Make sure that this is a valid URL and the SharePoint site is running on the local computer. If you moved this project to a new computer or if the URL of the SharePoint site has changed since you created the project, update the Site URL property of the project."

Ok, I have done a lot of searching and I'll tell you what I've tried so far. I have full admin rights on the farm, full rights to both databases. I made sure the webpart URL property matches the site property listed in Central Admin as well.

If anyone has any advice or insight it would be greatly appreciated. Thank you in advance.

P.S. (Edit) Also, the farm I'm deploying to and visual studio are on the same machine? would that cause it?

Best Answer

Check the properties of your project in Visual Studio. Click on project node in solution explorer and press F4, then check there 'Site URL' property. It should contains one of the following

  1. http://[your machine name][:port]/[site collection or web relative URL]
  2. http://localhost[:port]/[site collection or web relative URL]
  3. http://[your machine IP address][:port]/[site collection or web relative URL]

Note that Visual Studio must be installed on that machine which is your Web Front End or Application server.

If you got some errors with solution retracting try first deactivate and delete it via Central Admin. Then try to make some deploy-retract checking cycle in Visual Studio. If you still would get errors please post here the log from Visual Studio Output window (Ctrl+W, O).

Related Topic