简体   繁体   中英

VS2012 project building in both framework 3.5 and 4.0

I have a custom dll that I created for an internal application that we use here at work using .Net framework 4.0. There is a need to use the same dll within our website, however, our website is set to .Net Framework 3.5 and at this time cannot be upgraded to 4.0 as there are multiple other dlls that the website uses that would not be compatible with 4.0. Is there a way to build a dll for multiple .Net Frameworks and if so how? I cannot seem to find a way to do this.

You can build you custom dll to target .Net 3.5. Your web site will then be able to use it. Your newer projects (that target a higher version of the .Net framework) can still use your custom dll.

You can set the target in the Project's Properties page.

Based on the csproj file for .NET 4 to create a copy that targets .NET 3.5. Then .NET 4 projects add the original one as reference, while .NET 3.5 projects use the new one.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM