I need to compile a project for both .Net 3.5 and .Net 4.0. What is the most low-friction way of doing this? If I reference this project from another assembly, how do I determine which runtime is being targeted? Or should I just reference binaries directly?
I do this simply by having two csproj files. Then I can set the version, references, build-symbols, etc easily. To avoid having to maintain the file list in both, I use a blanket include - i.e.
I have (in the secondary .csproj):
<Compile Include="..\TheMainProject\**\*.cs" />
This says "compile all .cs files in and under ..\TheMainProject".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With