Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

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

Open
ejohn54 opened this issue Aug 26, 2022 · 2 comments

Comments

@ejohn54
Copy link
Contributor

ejohn54 commented Aug 26, 2022

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.<>c__DisplayClass15_0.g__TryLoadAssembly|3(AssemblyName assemblyName)
at Microsoft.Build.Locator.MSBuildLocator.<>c__DisplayClass15_0.b__2(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
Copy link
Contributor Author

ejohn54 commented Aug 26, 2022

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
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants