Bug Reports
Westwind.AspNetCore.Markdown.MarkdownMiddlewareExtensions fails as it links a missing Nuget Markdig, Version=0.24.0.0
Gravatar is a globally recognized avatar based on your email address. Westwind.AspNetCore.Markdown.MarkdownMiddlewareExtensions fails as it links a missing Nuget Markdig, Version=0.24.0.0
  Walter Verhoeven
  All
  Apr 16, 2021 @ 12:57am

I get the following error when publishing the Net 5.0 project

System.IO.FileNotFoundException: Could not load file or assembly 'Markdig, Version=0.24.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
File name: 'Markdig, Version=0.24.0.0, Culture=neutral, PublicKeyToken=null'
   at ASP_WAF.Startup.<>c.<ConfigureServices>b__5_8(MarkdownConfiguration config)
   at Westwind.AspNetCore.Markdown.MarkdownMiddlewareExtensions.AddMarkdown(IServiceCollection services, Action`1 configAction)
   at ASP_WAF.Startup.ConfigureServices(IServiceCollection services) in P:\Source\Website\www.ASP-WAF\Startup.cs:line 218
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
   at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services, Object instance)

When I manually download the Markdig nuget package and past the .net standard 2.1 version in the folder the issue seems to get solved Why di I get this error?

Gravatar is a globally recognized avatar based on your email address. re: Westwind.AspNetCore.Markdown.MarkdownMiddlewareExtensions fails as it links a missing Nuget Markdig, Version=0.24.0.0
  Rick Strahl
  Walter Verhoeven
  Apr 16, 2021 @ 04:43pm

I'm not sure. It's referenced in the Nuget Package dependency list so it should get pulled and added to your project. Check your project NuGet dependencies. If it's not there it would seem it got manually removed or the library got downgraded by some other dependency (shouldn't downgrade - should upgrade).

FWIW, there's no NETSTANDARD implementation. This package only works against specific frameworks:

<TargetFrameworks>net5.0;netcoreapp3.1;</TargetFrameworks>

as these depend and ASP.NET Core components which aren't part of NETSTANDARD.

+++ Rick ---

© 1996-2024