XmlDocMarkdown
XmlDocMarkdown copied to clipboard
dotnet tool fails to run with a missing Microsoft.Extensions.Hosting.Abstractions 6.0.0.0 error
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
Could not load file or assembly 'Microsoft.Extensions.Hosting.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at XmlDocMarkdown.Core.MarkdownGenerator.DoGenerateOutput(Assembly assembly, XmlDocAssembly xmlDocAssembly)+MoveNext() in /_/src/XmlDocMarkdown.Core/MarkdownGenerator.cs:line 53
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at XmlDocMarkdown.Core.XmlDocMarkdownGenerator.Generate(XmlDocInput input, String outputPath, XmlDocMarkdownSettings settings) in /_/src/XmlDocMarkdown.Core/XmlDocMarkdownGenerator.cs:line 88
at XmlDocMarkdown.Core.XmlDocMarkdownApp.Run(IReadOnlyList`1 args) in /_/src/XmlDocMarkdown.Core/XmlDocMarkdownApp.cs:line 70
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Extensions.Hosting.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.
File name: 'Microsoft.Extensions.Hosting.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'
Sorry about that. Unfortunately that's proved a difficult problem to solve for the standalone tool. I highly recommend the strategy mentioned in the docs, i.e. creating a documentation-generating tool specifically for your project that references it directly, which is fairly straightforward and solves the problem.