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

前端 未结 10 946
佛祖请我去吃肉
佛祖请我去吃肉 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:12

    I think by far the easiest way to do this is using a search and replace tool. It is an advantage if it supports regex.

    There must be quite a few out there - the first one I tested worked for me, though: http://www.ecobyte.com/replacetext/

    There is a note saying it has some issues on Win7, but I didn't experience that.

    Step by step instructions in that tool:

    1. Replace | Add Group | Name it (e.g. "MyGroup")
    2. Right-Click MyGroup | Add File(s)...
    3. Choose your source (e.g. Use Folder, browse to root folder of the projects you want to change)
    4. Set the Include File Filter if necessary (e.g. *.csproj)
    5. Right-Click the row below Original Text | Advanced Edit...
    6. Enter your regular expression in Search Text Box (e.g. .*)
    7. Select "Regular Expression Search" in the combobox below the Search Text
    8. Enter Replacement Text (e.g. 4.0)
    9. Choose Destination and Backup settings (will create a backup by default)
    10. Start Replacing (Ctrl+R)

    Now If for some reason you need to do this in code, I would probably be able to do that as well (it's how I found this question). In that case, please request it in a comment.


    enter image description here

提交回复
热议问题