I'm building a new code library and would like to use .Net 4 as my target framework as all my new apps will use .net 4. My legacy web apps use .Net 3.5. I want to use this code library for all of my apps.
At this point, I see only 2 options
Is there any way around this so my code library is a single compile? Didn't know if there was something built into 4 to allow something like this.
Why not just build your libraries against .NET 3.5?
There are some caveats around interop and mixed-mode assemblies, but for pure-C# assemblies it shouldn't be a problem.
It's possible to have different build configurations targeting different versions of the framework, but a bit of a pain - you'll need to mess with the project files manually. See the project files for MiscUtil as an example.
I don't see why you were happy with the .NET 2 / .NET 3.5 situation before - it's not very significantly different to that.
Of course, updating your webapps to run on .NET 4 would probably be the best solution, going forward.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.