Installing slngen for projects targeting .NET 6 results in slngen crash.
See original GitHub issueSlngen crashes with a stack trace when using it to generate a solution for .NET 6 projects:
Command:
dotnet slngen
Stack Trace:
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.VisualStudio.SlnGen.Program.<>c.<Main>b__17_0(Object sender, ResolveEventArgs eventArgs) at System.Runtime.Loader.AssemblyLoadContext.InvokeResolveEvent(ResolveEventHandler eventHandler, RuntimeAssembly assembly, String name) at System.Runtime.Loader.AssemblyLoadContext.OnAssemblyResolve(RuntimeAssembly assembly, String assemblyFullName) at Microsoft.Build.Evaluation.ToolsetReader.ReadAllToolsets(Dictionary`2 toolsets, ToolsetConfigurationReader configurationReader, PropertyDictionary`1 environmentProperties, PropertyDictionary`1 globalProperties, ToolsetDefinitionLocations locations) at Microsoft.Build.Evaluation.ProjectCollection.InitializeToolsetCollection(ToolsetConfigurationReader configReader) at Microsoft.Build.Evaluation.ProjectCollection…ctor(IDictionary`2 globalProperties, IEnumerable`1 loggers, IEnumerable`1 remoteLoggers, ToolsetDefinitionLocations toolsetDefinitionLocations, Int32 maxNodeCount, Boolean onlyLogCriticalEvents, Boolean loadProjectsReadOnly, Boolean useAsynchronousLogging) at Microsoft.VisualStudio.SlnGen.Program.Execute(ProgramArguments arguments, IConsole console) at Microsoft.VisualStudio.SlnGen.ProgramArguments.OnExecute(IConsole console) — End of stack trace from previous location — at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.Invoke(MethodInfo method, Object instance, Object[] arguments) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.OnExecute(ConventionContext context, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.Conventions.ExecuteMethodConvention.<>c__DisplayClass0_0.<<Apply>b__0>d.MoveNext() — End of stack trace from previous location — at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync[TApp](CommandLineContext context, CancellationToken cancellationToken) at Microsoft.VisualStudio.SlnGen.Program.Execute(String[] args, IConsole console)
Version Used: 8.5.0
Issue Analytics
- State:
- Created a year ago
- Comments:10 (1 by maintainers)
Top GitHub Comments
The updated 8.5.17 package fixes the issue for me.
@AraHaan thanks for reporting the issue, I finally figured out what’s going on. I will send a PR shortly