Search code examples
.netvb.netcompilationdatasetstrongly-typed-dataset

How can I create strongly typed dataset in visual studio 2010 for .NET 2.0


I created a DataSet in VS2010 and try to build a ASP.NET website that references this DataSet.

When I try to compile this website however, I get a lof of errors.

I've seen that in the declaration of the Dataset, everywhere the TypedDataSetGenerator in Version 4.0.0.0 is referenced.

<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")>  _

So now I expect that is the problem, as I have some .NET 4.5 DLLs registered in the GAC.

How would I make this work to use .NET Framework 2.0 for compiling the DataSet?

Thanks for your time

//edit: I uninstalled those .NET 4.5 DLLs from the GAC, but I still get the same errors, when trying to build.


Solution

  • I was close to the solution already.

    After uninstalling those .NET 4.5 DLLs of course I also had to restart Visual Studio in order for the changes to take effect.

    Now I can compile without errors.

    (But it would still be good if I could build without using the .NET 4.0 compiler when targeting the .NET 2.0 Framework, but I guess that's an illusion.)