aherrick
aherrick

Reputation: 20179

Visual Studio 2010 1 Class Library Project Compile 2 DLLs (.NET 3.5 and .NET 4.0)

I have a Visual Studio 2010 Solution with a class library project. What I want to do is compile 2 DLLs on build. I want to compile against .NET 3.5 and .NET 4.0 respectively. Something like below.

myproject\bin\debug\3.5\assembly.dll

myproject\bin\debug\4.0\assembly.dll

Is this possible?

Upvotes: 1

Views: 247

Answers (2)

Jeffrey Zhao
Jeffrey Zhao

Reputation: 5023

Maybe you'can write a simple problem to execute on each build, it simply does:

  1. make a copy of your working project file (*.csproj, *.vbproj, etc.)
  2. edit the target info from 4.0 to 3.5 (or from 3.5 to 4.0) and update other related properties, it should be simple enough.
  3. call msbuild.

I've used this approach before for different purpose.

Upvotes: 1

vc 74
vc 74

Reputation: 38179

The target framework is part of the application project settings that cannot depend on the configuration (unlike build settings).

I'm afraid you will have to create a separate project for each framework version.

Upvotes: 0

Related Questions