We help IT Professionals succeed at work.

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

freezegravity
on
6,856 Views
Last Modified: 2013-11-07
Hello:

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?
Comment
Watch Question

Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

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.

THANKS!

Author

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!

THANKS!

Commented:
Hi!
I have the same problem! I  also added the reference to the reference list, but still...Did you find the solution?
reference-problem.bmp
reference-problem2.bmp
Download the SharePoint extensions for Visual Studio 2008 (or 2005 - whatever) from downloads.microsoft.com then you can add the appropriate reference(s).
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.