1

I am working on creating the event receiver in SharePoint 2010. When I create a new--> project--> event receiver, I choose the sandbox solution and hit ok.

I am getting the following error

"Cannot connect to the SharePoint site: http://servername/. 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."

I get this error all the time when I create any SharePoint solution and deploy it. So usually I will just go inside the proj folder and change this 'projname.csproj.user' file's tag <SharePointSiteUrl>http://servername/</SharePointSiteUrl> to <SharePointSiteUrl>http://sitename/</SharePointSiteUrl> and from then on it works fine.

But this time for event receiver, I'm getting that error and when I look into the project folder its empty. I'm not sure how to work around this scenario.

2 Answers 2

3

make sure that when your go new -> project -> event receiver , then paste in your url for debugging http://site.com/sitetest/Home.aspx delete the "Home.aspx" or what ever it may be named, so it ends up as "http://site.com/sitetest/"... also, I'm sure that you have SharePoint installed on the machine, but make sure your permissions are correct.

2
  • I'm also getting this error message. What do "correct permissions" entail? And why does the error message say that sharepoint should be running on the local machine if I'm trying to add an event receiver on a different server?
    – recursive
    Commented Jan 16, 2012 at 17:03
  • 1
    When developing in visual studio you must have sharepoint installed on that machine. So, for example we have a dev environment, and a production environment. Both environments are on two different computers. I remote into the dev environment and do all my visual studio work there. Then we deploy that into the production environment. For permissions you will need admin rights to the SharePoint server, dev computer, and site. Hope this helps.
    – ironman
    Commented Jan 17, 2012 at 16:40
5

Click on your project name in Solution Explorer window.

enter image description here

Then, select View -> Properties Window from the main menu.

enter image description here

Finally, change Site URL property:

enter image description here

1
  • and, of course, make sure that the site under http://servername exists Commented Jan 13, 2012 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.