Search code examples
c#visual-studio-2012dllbuild.net-framework-version

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.


Solution

  • 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.