try-convert icon indicating copy to clipboard operation
try-convert copied to clipboard

try-convert crashes with "Could not load file or assembly 'System.Runtime"

Open MattBussing opened this issue 2 years ago • 8 comments

When running try-convert I get these weird issues.

try-convert.exe --no-backup -m /c/Program\ Files/dotnet/sdk/6.0.300/ --keep-current-tfms -p normalProject.csproj
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
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
 try-convert.exe --no-backup -m /c/Program\ Files/dotnet/sdk/6.0.101/ --keep-current-tfms -p normalProject.csproj
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
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
dotnet tool update -g try-convert
Tool 'try-convert' was reinstalled with the latest stable version (version '0.9.232202')

MattBussing avatar May 11 '22 15:05 MattBussing

It works if I build the latest of try-convert. Please update the NuGet package.

MattBussing avatar May 11 '22 15:05 MattBussing

Me too, it doesn't seem to have a stable version.

DingpingZhang avatar Jul 26 '22 14:07 DingpingZhang

Me too

luizfernandonb avatar Jul 31 '22 20:07 luizfernandonb

Me too

ShoshanaTzi avatar Sep 11 '22 11:09 ShoshanaTzi

I caught the same error too.

behroozbc avatar Jan 18 '23 09:01 behroozbc

I am seeing the same issue

try-convert -m "C:\Program Files\dotnet\sdk\7.0.101"
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=7.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

tomShoutTheSecond avatar Jan 26 '23 23:01 tomShoutTheSecond

and, me too (with multiple SDK 6 versions installed)

Looks like this utility is essentially abandoned. Would be nice if this page https://learn.microsoft.com/en-us/dotnet/core/porting/ stopped pointing people at it?

Same error reported many more times at issues below (duplicates of this ticket). https://github.com/dotnet/try-convert/issues/463 https://github.com/dotnet/try-convert/issues/445

Perhaps this is the replacement? https://learn.microsoft.com/en-us/dotnet/core/porting/upgrade-assistant-overview

markbearden avatar Feb 23 '23 22:02 markbearden

Any update with the new tool AKA the replacement?

SOULHUZAIFA avatar Mar 15 '23 15:03 SOULHUZAIFA