Search code examples
sharepointsharepoint-2010web-parts

Error when trying to deploy webpart


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?


Solution

  • Follow below mentioned steps to debug this issue :
    1) Browse the URL in IE on your server where you have hosted the http://mysite.com site.
    2) If you are able to browse then try deploying this web part on another site by giving new site URL in project properties in Visual studio.
    3) To deploy a solution onto a site you must have visual studio on the same computer where you hosting the site.
    4) Try deploying WSP through stsadm, Click here to see the details. To create WSP in Visual studio right click on project -> click on 'Package' -> once its complete right click on project -> click on 'Open in windows explorer' -> open 'bin' directory -> open 'Debug' directory -> you shall see a file named as your project name & extension would be .wsp
    5) If anything above doesn't help put down your deploying steps.