While trying to use LINQ in a .NET 2.0 Windows Forms project I got:
Namespace or type specified in the Imports ‘System.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
In both the lines that reference the following namespaces:
System.Linq;
System.Xml.Linq;
How could I get these namespaces to work on .NET 2.0 without referencing an external DLL or anything?
You can’t. They were introduced in .NET 3.5.
I don’t know of any implementations of LINQ to XML for .NET 2.0 (unless you use a Mono assembly – I assume Mono supports it). There’s LINQBridge if you want LINQ to Objects in .NET 2.0, although of course that goes against your “no external libraries” requirement.