How do I change the .Net Framework from version 3.5 to version 4.0

后端 未结 5 1228
清歌不尽
清歌不尽 2020-12-03 21:10

I have created a class library in .NET Framework 3.5. Now I want to change the .NET Framework Version to 4.0.

How can I do this?

相关标签:
5条回答
  • 2020-12-03 21:40

    In Visual Studio 2010:

    1. Right-click on your Project
    2. Select Properties
    3. Select the Compile tab
    4. At the bottom, select Advanced Compile Options
    5. Change the Target Framework to the desired framework
    0 讨论(0)
  • 2020-12-03 21:42

    Unfortunately this cannot be done once dll has been created. For this you need to have source of your class library.

    • Select Properties from Right clicking on the project in the solution explorer.

    • In Application Tab change Target Framework to Desired one.

    0 讨论(0)
  • 2020-12-03 21:43

    In Visual Studio:

    1. Right-click on your project
    2. Select Properties
    3. Select the Application tab
    4. Change the Target Framework to the desired framework

    If you are not seeing .NET Framework 4 as an option there, ensure you have it installed.

    EDIT

    I don't think this is what you're asking, but for completeness, one can also point an existing DLL to a later version of the .NET Framework without recompiling using Binding Redirects.

    0 讨论(0)
  • 2020-12-03 21:44
    1. Right click on the project in the solution explorer and select Properties.

    2. Make sure that the Application tab is selected.

    3. In the Target framework dropdown select the desired framework, e.g. .NET Framework 4.

    0 讨论(0)
  • 2020-12-03 21:54

    FYI - there's a "Target Framework Migrator" extension tool for Visual Studio (2013, 2015) that will do all projects in your solution in one go.

    I'm working on a solution at the moment with a 100+ projects in it and it's not practicable to do each project one at a time IMO.

    0 讨论(0)
提交回复
热议问题