Question

I am creating an exe from my C# application and adding some dlls like

SFXmaker.cp = new System.CodeDom.Compiler.CompilerParameters();
cp.ReferencedAssemblies.Add("System.Drawing.dll");
cp.ReferencedAssemblies.Add("System.Windows.Forms.dll");

The problem is that I'm using .NET Framework 4.0 and when I run the extractor on .NET 2.0 it crashes. Can anybody tell me how to make the exe run on .NET 2.0 created from .NET 4 application?

Example I am referencing

Was it helpful?

Solution

You need to compile the project with .net 2.0 when you build it.

If you are using a IDE like Visual studio, just right click on the project and select "properties" there you will see the target framework.

OTHER TIPS

A .NET assembly compiled for .NET 4.0 will never run in the .NET 2.0 CLR. You must recompile it for .NET 2.0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top