I'm trying to make a console application that updates a Sharepoint list as a scheduled task. For some reason when I try to build the console app, I get the following error message.

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

However, I have added Micorosft.Sharepoint.dll, and I can see it in my references folder. I have also copied and pasted the dll to a different directory and referenced that one incase there was an access issue.

I've written webparts using WSPBuilder before without a problem. Any idea what could be causing this?

sharepoint 2007, visual studio 2010

  • Are you running this console application on the server itself?
    – James Love
    Oct 27 '10 at 19:04
  • Yes, I'm on the server
    – pinniger
    Oct 27 '10 at 19:08

Some ideas:

1) Try Clean Solution from the solution context menu.

2) Make sure that your projects are targeting .NET 3.5 (not 4.0 client profile)

3) Make sure your build is configured to target "Any CPU"

  • Perfect, I forgot to change the target to .net 3.5. Thanks.
    – pinniger
    Oct 27 '10 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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