donderdag 10 maart 2011

Can't reference Microsoft.SharePoint.dll in Windows Console Application

Some time ago I wanted to create a console application that communicates with SharePoint 2010 and will also run directly on the server. So no reason to use the SharePoint Client Object Model. Therefore, I wanted to make a reference to the Microsoft.SharePoint.dll but was unable to find it in the list. I tried to browse and this way I could add the reference but the Microsoft.SharePoint namespace was not recognized.

After some minutes I realized that the problem was the Target framework setting in the project's properties. Apparently, by default this is set to '.NET Framework 4 Client Profile'. Changing it to '.NET Framework 4' will allow you to add the reference and continue your work.

3 opmerkingen: