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

Posted on 2007-10-10
Last Modified: 2013-11-07

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?
Question by:freezegravity
    LVL 16

    Accepted Solution

    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

    Author Comment

    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.


    Author Comment

    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!

    LVL 1

    Expert Comment

    I have the same problem! I  also added the reference to the reference list, but still...Did you find the solution?

    Expert Comment

    Download the SharePoint extensions for Visual Studio 2008 (or 2005 - whatever) from then you can add the appropriate reference(s).

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now