I am trying to do a really simple test of the Markdig library for .NET 6 (). I have added the package to my project and it shows up as expected in .csproj.

<PackageReference Include="Markdig" Version="0.28.0" /> 

I made a very simple Index page. The code is below.

using Markdig; public class IndexModel : PageModel { public IndexModel() { } public string Test { get; set; } public void OnGet() { var Test = Markdown.ToHtml("This is a text with some *emphasis*"); } } 

However, I get the following error.

The type 'Markdown' exists in both 'Markdig.Signed, Version=0.22.0.0, Culture=neutral, PublicKeyToken=870da25a133885f8' and 'Markdig, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

I must be doing something wrong because I cannot find anyone else having this issue. Thanks for the help.

UPDATE: I tested a completely new razor pages project and I can get it working fine, but still having issues in adding it to my already existing project. I did some more digging and somehow Markdig.Signed.dll appears when I build the project. To get rid of it I tried

  • Adding and removing package Markdig.Signed.
  • Deleting bin and obj folders and doing dotnet build
  • doing dotnet clean and then dotnet build

But each time the Markdig.Signed.dll comes back.

FINAL UPDATE: I ended up just using Markdig.Signed instead of Markdig. This isn't really a solution, but will work just fine. I tried many different things to remove Markdig.Signed.dll from my computer, but it always came back when I built the project. I suspect it has do with the package/library being signed.

Related questions 2 Markdown for ASP.NET MVC 0 Custom Razor HTML Markup 25 ASP.Net MVC3 - Pass razor markup as a parameter Related questions 2 Markdown for ASP.NET MVC 0 Custom Razor HTML Markup 25 ASP.Net MVC3 - Pass razor markup as a parameter 0 to razor markdowndeep">asp.net mvc translate <asp> to razor markdowndeep 0 Alternative for razor syntax in .aspx pages in ASP.NET 2 ASP.NET Razor tag helper inside text string 0 Generating HTML DOM Element and inserting it into a Razor Page 0 IList binding Razor Pages 1 how to display markdown on a webpage 3 How can I add Razor Markup from a C# Method? Load 7 more related questions Show fewer related questions

Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.