Multi-targeting build with Visual Studio and .NET Framework

578 Views Asked by At

I've seen a few frameworks that provide different builds; for example they might provide 32bit and 64bit builds, or they might provide a build which targets .NET 2.0, 3.5 and 4.0

I have a library which works on .NET 3.5 upwards, but I'm not sure what is the best release strategy for this.

I'd like to know what benefit there is to creating multiple framework targets and also what benefit there is for targeting 32bit ans 64bit CPUs specifically.

If I were to go down the road of multi-targeting, Are there any good tutorials for how to achieve this?

1

There are 1 best solutions below

1
On BEST ANSWER

Not sure why you need a bounty,a google search should be enough.

I have a library which works on .NET 3.5 upwards, but I'm not sure what is the best release strategy for this.

If you want to target an older version (in your case .NET 2.0) move all v2.0 compatible code to a project that targets .NET 2.0.
Then you can reference this project from your ".NET 3.5" project
If you don't want 100% of your features on .NET 2.0 you don't have to do anything else.
If you do need all the functionality you'll have to re-implement it using .NET 2.0 compatible code

I'd like to know what benefit there is to creating multiple framework targets

A lot of people are working on projects that target an older version of .NET (2.0 ,3.5 ,...)
and they can't update for various reasons(for example .NET 4.5 is not supported on Windows XP)
So,if you want them to use your Library we have to provide assemblies that target a specific .NET version.

also what benefit there is for targeting 32bit ans 64bit CPUs specifically.

Differences between 32 and 64-bit .NET (4) applications

Back to Basics: 32-bit and 64-bit confusion around x86 and x64 and the .NET Framework and CLR

32-bit and 64-bit explained

Why Are Most Programs Still 32-bit on a 64-bit Version of Windows?