Change the Target Framework for all my projects in a Visual Studio Solution

前端 未结 10 941
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-02 13:08

I need to change the target framework for all projects. I have many solutions with hundreds of projects.

Anything new here or do I have to change every single proje

10条回答
  •  悲哀的现实
    2020-12-02 13:21

    An alternative with no external tools (and the ability to change other settings, e.g. ToolsVersion):

    1. Using Visual Studio, create a new c# console project 'ManageCSProjFiles' (or whatever name you like) in a temporary directory. Be sure to check 'Place solution and project in same directory'
    2. Remove Program.cs and Properties/AssemblyInfo.cs from the project. There is no need to ever compile the project.
    3. Save the project and close Visual Studio.
    4. Using a text editor open ManageCSProjFiles.csproj. Add the following lines at the bottom, before the last line:
      
        
      
    
    1. Copy ManageCSProjFiles.sln and ManageCSProjFiles.csproj to the topmost directory of your solution tree.
    2. If you load the ManageCSProjFiles solution in Visual Studio, it will now show all your .csproj files and you can change them with the search/replace tools in Visual Studio.

    This can easily be extended for other project types.

提交回复
热议问题