[英]How to migrate all projects from a solution easily
I am working with a solution with 44 projects targeting the Dotnet core 2.1 framework. 我正在与一个针对Dotnet核心2.1框架的44个项目的解决方案一起工作。 I want to target 2.2 framework, Is there an easy way to do that without editing each csproj file?
我想以2.2框架为目标,是否有一种简单的方法无需编辑每个csproj文件呢?
I searched on the internet and I just found how to retarget one project. 我在互联网上进行搜索,然后发现了如何重新定位一个项目。
Thanks in advance. 提前致谢。
I don't know of such a tool. 我不知道这样的工具。
I personally would fire up Notepad++ >> Find in files >> Open solution folder >> filter by .csproj
>> find a search pattern that matches the target version >> replace all 我个人将启动记事本++ >>在文件中查找>>打开解决方案文件夹>>通过
.csproj
过滤>>查找与目标版本匹配的搜索模式>>替换所有
Alternatively ... just do it. 或者...就做吧。 Assuming 5 seconds per project that's under 4 minutes for the whole solution.
假设每个项目需要5秒,而整个解决方案不到4分钟。 If you are lazy let's say 15 seconds per project and that is still 11 minutes.
如果您很懒,可以说每个项目15秒,但仍然是11分钟。
If you however do this a lot, write a quick script to do this. 但是,如果您经常这样做,请编写一个快速脚本来执行此操作。
1) Open Visual Studio Code, navigate to Search 1)打开Visual Studio代码,导航到“搜索”
2) Find <TargetFramework>netcoreapp2.1</TargetFramework>
and Replace with <TargetFramework>netcoreapp2.2</TargetFramework>
2)找到
<TargetFramework>netcoreapp2.1</TargetFramework>
并替换为<TargetFramework>netcoreapp2.2</TargetFramework>
dotnet restore
in sln folder then build solution dotnet restore
,然后构建解决方案 OR 要么
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.