Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
Medium Priority
Last Modified: 2013-11-07

Here's something I am finding particularly annoying. An web site (application) in Asp.net 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

McExp earned 2000 total points
ID: 20051959
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

ID: 20052028
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

ID: 20052095
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!


Expert Comment

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

Expert Comment

ID: 23469794
Download the SharePoint extensions for Visual Studio 2008 (or 2005 - whatever) from downloads.microsoft.com then you can add the appropriate reference(s).

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

580 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