【发布时间】:2020-01-23 09:45:36
【问题描述】:
我需要在 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.
进一步看,dotnet migrate 似乎在 dotnetcore 3.0 中已被弃用
https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-migrate
此命令已弃用。 dotnet migrate 命令不再是 从 .NET Core 3.0 SDK 开始可用。它只能迁移一个 将 2 .NET Core 项目预览到 1.x .NET Core 项目,该项目已发布 支持。
我已经在 Visual Studio 2017 和 2015 命令行上尝试过,得到了完全相同的错误。似乎安装了 dotnetcore3 就无法执行此操作了。
如果不使用推荐的 Microsoft 工具,是否可以迁移项目?
【问题讨论】:
-
我也有同样的问题。我的解决方案中有多个带有 global.json 文件的项目。我花了半天的时间仍然没有找到单一的解决方案。如何将 .net core 1 预览版升级到最新的 .net core。有人知道如何解决吗?
标签: c# visual-studio visual-studio-2019