And*_*rew 5 c# visual-studio visual-studio-2019
我需要在 Visual Studio 2019 中升级 xproj 类型的项目。当我尝试打开解决方案时,它说它需要升级,但随后我收到以下消息:
不再支持 Xproj 项目文件。有关迁移到 csproj 的详细信息,请参阅https://docs.microsoft.com/en-us/dotnet/core/migration/。
链接的文档提到在 Visual Studio 中执行此操作(不起作用)或使用 dotnet migrate。当我尝试这样做时,我得到以下信息:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET Core program, but dotnet-migrate does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
Run Code Online (Sandbox Code Playgroud)
进一步看,dotnet migrate 似乎在 dotnetcore 3.0 中已被弃用
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-migrate
此命令已弃用。从 .NET Core 3.0 SDK 开始,dotnet migrate 命令不再可用。它只能将 Preview 2 .NET Core 项目迁移到不受支持的 1.x .NET Core 项目。
我已经在 Visual Studio 2017 和 2015 命令行上尝试过,并得到完全相同的错误。安装 dotnetcore3 似乎消除了执行此操作的能力。
有没有办法在不访问推荐的 Microsoft 工具的情况下迁移项目?
bat*_*i06 12
您可以通过以下命令列出已安装的 dotnet core sdk 版本:
dotnet --list-sdks
Run Code Online (Sandbox Code Playgroud)
然后您可以2.0.2通过以下命令切换回旧版本的 dotnet core sdk(例如):
dotnet new globaljson --sdk-version 2.0.2
Run Code Online (Sandbox Code Playgroud)
这应该在您的 xproj 所在的文件夹中执行。
最后,您可以通过以下方式迁移您的项目:
dotnet migrate
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3451 次 |
| 最近记录: |