多实例问题 - .NET 框架 4.8 WPF 应用程序到 .NET5 [英] Multiple instance issue - .NET framework 4.8 WPF application to .NET5
问题描述
当我尝试将我的 WPF 应用程序转换为 .NET 5 时.我得到以下信息.
When I am trying to convert my WPF application to .NET 5. I am getting the following below.
有人可以指导我吗?
C:WINDOWSsystem32>try-convert -p "D:ClientNewRoutinesRoutines.csproj"
Multiple installs of MSBuild detected please select one:
Instance 1
Name: .NET Core SDK
Version: 5.0.302
MSBuild Path: C:Program Filesdotnetsdk5.0.302
Instance 2
Name: .NET Core SDK
Version: 2.1.524
MSBuild Path: C:Program Filesdotnetsdk2.1.524
Instance 3
Name: .NET Core SDK
Version: 2.1.202
MSBuild Path: C:Program Filesdotnetsdk2.1.202
我也跟着多次安装MSBuild 但帮助不大.
I also followed Multiple installs of MSBuild but not much of help.
> C:WINDOWSsystem32>try-convert -w Routines.csproj --target-framework
> net5.0 -m "C:Program Filesdotnetsdk5.0.302"
> System.AggregateException: A directory or directories in
> "msbuildSearchPaths" do not exist (Directory "C:Program
> Filesdotnetsdk5.0.302"" does not exist (Parameter
> 'msbuildSearchPaths')) ---> System.ArgumentException: Directory
> "C:Program Filesdotnetsdk5.0.302"" does not exist (Parameter
> 'msbuildSearchPaths') --- End of inner exception stack trace ---
> at Microsoft.Build.Locator.MSBuildLocator.RegisterMSBuildPath(String[]
> msbuildSearchPaths) at
> Microsoft.Build.Locator.MSBuildLocator.RegisterMSBuildPath(String
> msbuildPath) at
> MSBuild.Abstractions.MSBuildHelpers.HookAssemblyResolveForMSBuild(String
> msbuildPath) in /_/src/MSBuild.Abstractions/MSBuildHelpers.cs:line 405
> at MSBuild.Conversion.Program.Run(String project, String workspace,
> String msbuildPath, String tfm, Boolean forceWebConversion, Boolean
> preview, Boolean diffOnly, Boolean noBackup, Boolean keepCurrentTfms,
> Boolean update, Boolean mauiConversion) in
> /_/src/try-convert/Program.cs:line 93
我还安装了 upgrade-assistant
并且现在尝试使用这个命令.我收到 Required command is not provided
错误:
I also installed upgrade-assistant
and now trying to use this command. I am getting Required command was not provided
error:
C:Users
yaTest>upgrade-assistant C:Users
yaTestClientScreen.sln
Required command was not provided.
Unrecognized command or argument 'C:Users
yaTestClientScreen.sln'
推荐答案
这似乎是因为转换工具想知道要使用哪个版本的 MSBuild.
It appears as though this is because the conversion tool is wanting to know which version of MSBuild to use.
这个问题:Dotnet项目转换试试-convert 当多次安装 MSBuild" 有一些关于如何指示工具应该使用哪个版本的信息时会失败,尽管它目前还没有被接受的答案.
This question: Dotnet project conversion try-convert fails when "Multiple installs of MSBuild" has some information on it about how to indicate which version the tool should use, although it doesn't have an accepted answer as yet.
这篇关于多实例问题 - .NET 框架 4.8 WPF 应用程序到 .NET5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!