question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing slngen for projects targeting .NET 6 results in slngen crash.

See original GitHub issue

Slngen 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:closed
  • Created a year ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
craigktreasurecommented, Aug 10, 2022

The updated 8.5.17 package fixes the issue for me.

1reaction
jeffklcommented, Aug 9, 2022

@AraHaan thanks for reporting the issue, I finally figured out what’s going on. I will send a PR shortly

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview | slngen - Microsoft Open Source
Overview. SlnGen is a Visual Studio solution file generator. Visual Studio solutions generally do not scale well for large project trees. They are...
Read more >
microsoft/slngen: Visual Studio solution generator
Getting Started - MSBuild Target ... The MSBuild target must be installed as a NuGet package and restored. This can slow down the...
Read more >
Targeting .NET 6.0 or higher in Visual Studio 2019 is not ...
NETSDK1182 indicates that you're trying to open a .NET 6+ project in Visual Studio 2019. Or you might be trying to build from...
Read more >
Untitled
Tool 3.0.50 Installing slngen for projects targeting .NET 6 results in ... - Github Joffrey Kern - My world about C#, development, agile...
Read more >
ASP.NET 5 Keeps crashing VS on project initialization
I have a solution with several MVC6 (asp.net 5) projects. Each project uses bower and npm for packages. Bower has normalize-css and jquery ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found