Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 down vote accepted

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.

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
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. –  ironman99 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

 
discard

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.