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


Here's something I am finding particularly annoying. An web site (application) in 2.0 seems to be work just fine one minute, but won't even compile the next minute. I don't even have to change the code for the page that is throwing the compilation error in the title, but, it is worse if I add something perfectly valid to a page (drag a text box or SqlDataSource to the page).

Any idea why that might be ... the line of code is:

using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;

What do you think I am doing wrong?
Who is Participating?
Have you added a Reference in the project?

Open the Solution Explorer Right Click and Select Add Reference, then find the Microsoft.SharePoint namespace/dll
freezegravityAuthor Commented:
I am not seeing the "Microsoft.SharePoint" namespace after I right click and select "Add Reference" (at least not in the .NET tab. There are several look alikes though. For instance, "Microsoft Office SharePoint Server component"

Now I suppose the question is how do I find/add that reference and how did I manage to delete it in the first place.

freezegravityAuthor Commented:
actually, I just added all references that remotely resembled SharePoint. And it seems to work now. I'll let you know when the erratic thing changes

For now, enjoy the points!

I have the same problem! I  also added the reference to the reference list, but still...Did you find the solution?
Download the SharePoint extensions for Visual Studio 2008 (or 2005 - whatever) from then you can add the appropriate reference(s).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.