dotnet / try-convert

Helping .NET developers port their projects to .NET Core!
MIT License
1.14k stars 154 forks source link

Crash with System.Runtime not found #463

Open johnnyontheweb opened 1 year ago

johnnyontheweb commented 1 year ago

Similarly to previous issues, I have this:

try-convert -w MySolution.sln -m "C:\Program Files\dotnet\sdk\6.0.402"

crashes with:

System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Impossibile trovare il file specificato.
File name: 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at MSBuild.Abstractions.MSBuildConversionWorkspaceLoader.LoadWorkspace(String path, Boolean noBackup, String tfm, Boolean keepCurrentTFMs, Boolean forceWeb)
   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 133
az-zyr commented 1 year ago

Did you find solution, please share it if you do... Ty in advance...

JerryJoyce commented 1 year ago

I am encountering this exact issue as well.

brinkdinges commented 1 year ago

Same here. The first issue I had was that the tool says there are multiple SDK versions installed, but it shows zero to choose from. That's apparently caused by me only having the .NET 7.0 SDK installed while try-convert is targeting .NET 6.0 and it cannot use future versions. So, I installed the .NET 6.0 SDK.

When I specifiy the SDK version like the topic started did, I see the same FileNotFoundException. When I specify the full path to MsBuild.exe ("C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe") I get an error saying it can't find a subfolder.