SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 3 down vote accepted

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

share|improve this answer
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 Jan 16 '12 at 17:03
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 Jan 17 '12 at 16:40

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

share|improve this answer
and, of course, make sure that the site under http://servername exists – Kai Jan 13 '12 at 20:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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