dotnet / try-convert

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

try-convert crashes with 'Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0 #449

Open ejohn54 opened 2 years ago

ejohn54 commented 2 years ago

Tried running try-convert and it crashed with the following error:

System.IO.FileLoadException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Could not find or load a specific file. (0x80131621) File name: 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.IO.FileLoadException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly) at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) at System.Reflection.Assembly.LoadFrom(String assemblyFile) at Microsoft.Build.Locator.MSBuildLocator.<>cDisplayClass15_0.gTryLoadAssembly|3(AssemblyName assemblyName) at Microsoft.Build.Locator.MSBuildLocator.<>cDisplayClass15_0.b2(AssemblyLoadContext _, AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.GetFirstResolvedAssemblyFromResolvingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingEvent(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary2 toolsets, ToolsetConfigurationReader configurationReader, PropertyDictionary1 environmentProperties, PropertyDictionary1 globalProperties, ToolsetDefinitionLocations locations) at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetConfigurationReader configReader) at Microsoft.Build.Evaluation.ProjectCollection..ctor(IDictionary2 globalProperties, IEnumerable1 loggers, IEnumerable1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly, Boolean useAsynchronousLogging) at Microsoft.Build.Evaluation.ProjectCollection..ctor() at MSBuild.Abstractions.MSBuildConversionWorkspace..ctor(ImmutableArray`1 paths, Boolean noBackup, String tfm, Boolean keepCurrentTFMs, Boolean forceWeb) in C:_github\try-convert\src\MSBuild.Abstractions\MSBuildConversionWorkspace.cs:line 24

ejohn54 commented 2 years ago

It works fine if I use try-convert -m "C:\Program Files\dotnet\sdk\6.0.200"

But if I use try-convert -m "C:\Program Files\dotnet\sdk\6.0.400" it crashes.

I have Visual Studio 2022 version 17.3.2 installed.

try-convert --show-sdks

Instance 1 Name: .NET Core SDK Version: 6.0.400 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.400\ Instance 2 Name: .NET Core SDK Version: 6.0.303 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.303\ Instance 3 Name: .NET Core SDK Version: 6.0.302 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.302\ Instance 4 Name: .NET Core SDK Version: 6.0.301 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.301\ Instance 5 Name: .NET Core SDK Version: 6.0.300 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.300\ Instance 6 Name: .NET Core SDK Version: 6.0.203 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.203\ Instance 7 Name: .NET Core SDK Version: 6.0.202 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.202\ Instance 8 Name: .NET Core SDK Version: 6.0.201 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.201\ Instance 9 Name: .NET Core SDK Version: 6.0.200 Type: DotNetSdk MSBuild Path: C:\Program Files\dotnet\sdk\6.0.200\

pacificoutdoorliving commented 1 year ago

Thank you, I found one article migration work till .net core 5. It's not supporting to NET6 and upper.