Social Icons

twitter google plus linkedin rss feed

Pages

18.8.11

Creating a Windows Forms application for SharePoint 2010

In my usual style, I think I have stumbled upon each and every possible problem before I could execute my application.

What with MOSS2007 it was bliss and cheerful laughter has become in SharePoint 2010 a task that took me at least an hour… And I was lucky because in my usual style again I am really late to 2010 and most of the problems have been solved and talked about in forums…

Well, I’ll write here my experience, so I wont forget the necessary steps next time hopefully.


I added the Microsoft.SharePoint.dll as usual to the references and started coding. I wrote my 3 lines application (I just wanted a tool to help me code) and hit F5.

“The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)”

Well, I was not missing anything, the problem was that you have to target the solution to the .Net Framework 3.5…

image

That was easy. There are a couple of places where you can find that. OK, F5 again.

“The Web application at http://localhost could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application”


- Oh come on! It’s there! Why can’t you find it? + Because you haven’t targeted me to 64 bits and I am not running natively. - Oops, sorry for that. + It’s OK, you just have to read my error codes, they really point you in the right direction.

image

This one was a bit trickier. But after changing that I happily clicked F5 again and… Surprise!

“The Web application at http://localhost could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application”


Yep, same error again… And I couldn’t find more info on the internet… What if it’s a permission problem?
image

Finally I started the Visual Studio as an administrator and it worked. Finally!

No comments:

Post a Comment