We help IT Professionals succeed at work.

'System.Xml.Linq' doesn't contain any public member

rrhandle8
rrhandle8 asked
on
All my page directives show this error.  How do I get rid of it?

Namespace or type specified in the project-level Imports 'System.Xml.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
Comment
Watch Question

Go to Solution Explorer -> My Project -> References and remove the reference to 'System.Data.DataSetExtensions' (part of .NET v3.5 LINQ).
You will see a version number next to the files that are referenced, make sure only files under v3.5 are there.

Author

Commented:
I am using Visual Web Developer 2008.  There is no "My project" under "Solution Explorer.
have you checked the .net version used for the project

Author

Commented:
I do I determine that?  I thought I was using 3.5 for all my project, but I cannot say for sure.  I have a lot of references in the web.config file that say Version=3.5.0.0

Author

Commented:
Does anyone have any more suggestions?
Most Valuable Expert 2012
Top Expert 2008
Commented:
That error means that you don't have the correct reference added to the project, and it appears that there were attempts to correct the reference. If you don't have a reference to System.Xml.Linq, you will need to add that reference (as shown in the attached image).
Screenshot.png

Author

Commented:
Bingo!
That was it.
Thank you.