Dakait
Dakait

Reputation: 2620

Make the exe run on lower version of framework

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

Upvotes: 0

Views: 1054

Answers (2)

Ed Chapel
Ed Chapel

Reputation: 6932

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.

Upvotes: 1

Roise
Roise

Reputation: 364

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.

Upvotes: 4

Related Questions