views:

30

answers:

3

I have a .NET 2.0 targeted C# windows forms application that is running fine on XP when .NET 3.5 is installed. However, when .NET 2.0 only is installed I get the error:

"WindowsFormsApplication1.exe - .NET Framework Initialization Error" - "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll could not be loaded"

I have tried this with a basic default windows forms application and encounter this error on XP SP1, SP2 and SP3 with .NET 2.0 installed.

Could there be some other step that I am missing?

A: 

Yeah, you possibly use .NET 3.5 features. Ergo the 2.0 requirement is "fake" as in you ned 3.5 installed.

TomTom
Though I had hoped that Visual Studio would have told me about any .NET 3.5 features that I was using given that I am targetting 2.0.
Alan Spark
A: 

When you publish your application, verify if Framework 2.0 is checked in the "required components", and 3.5 unchecked.

Getz
I am not publishing the application, just compiling it and then trying to run it on a machine with .NET 2.0 installed. I did verify that 3.5 is unchecked and 2.0 is checked though.
Alan Spark
+1  A: 

I solved this by using .NET 2.0 SP1 rather than .NET 2.0.

Alan Spark