System.Numerics.Vectors 4.1.3 required ? #577

Closed
opened 2026-01-29 14:40:08 +00:00 by claunia · 6 comments
Owner

Originally created by @leedavi on GitHub (Nov 26, 2022).

I've ran Markdig under .Net Core without any issue.

However, if I try to run it on a DNN installation (.Net Framework) I get an error. The error is:

Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

And indeed, this assembly does not exist. The only version I can find is 4.6

One VERY strange happening is that on the first load and first run, it works? On the second run it fails? I've tried to bind the assembly verison and I've tried other method. All have the same result.

I think it might be MSBUILD. But before I give up on running Markdig in DNN, does anyone have any idea what the problem could be?

Thank you.

Originally created by @leedavi on GitHub (Nov 26, 2022). I've ran Markdig under .Net Core without any issue. However, if I try to run it on a DNN installation (.Net Framework) I get an error. The error is: _Could not load file or assembly 'System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified._ And indeed, this assembly does not exist. The only version I can find is 4.6 One VERY strange happening is that on the first load and first run, it works? On the second run it fails? I've tried to bind the assembly verison and I've tried other method. All have the same result. I think it might be MSBUILD. But before I give up on running Markdig in DNN, does anyone have any idea what the problem could be? Thank you.
claunia added the question label 2026-01-29 14:40:08 +00:00
Author
Owner

@xoofx commented on GitHub (Nov 26, 2022):

How do you reference Markdig in your .NET Framework project? If you are using new SDK style project, the NuGet reference should just work fine, otherwise I suspect that you copied an assembly from Markdig with a wrong .NET profile. See the dependencies for both .NETFramework 4.5.2 and .NETStandard 2.0, they only have dependencies to System.Memory but it doesn't have any dependencies to System.Numerics.Vectors.

@xoofx commented on GitHub (Nov 26, 2022): How do you reference Markdig in your .NET Framework project? If you are using new SDK style project, the NuGet reference should just work fine, otherwise I suspect that you copied an assembly from Markdig with a wrong .NET profile. See the [dependencies](https://www.nuget.org/packages/Markdig#dependencies-body-tab) for both `.NETFramework 4.5.2` and `.NETStandard 2.0`, they only have dependencies to `System.Memory` but it doesn't have any dependencies to System.Numerics.Vectors.
Author
Owner

@leedavi commented on GitHub (Nov 27, 2022):

OK, thx for the reply.

Yes, I thought that. But the version error is defiantly there. DNN now compiles against .Net Framework 4.7.2. Could this be the issue?

Often on the move to the .Net Framework 4.7.2 version we had very odd errors when versions were incorrect. Which makes me think that could be the answer.

Is there a version of Markdig compiled for .Net Framework 4.7.2 ?

@leedavi commented on GitHub (Nov 27, 2022): OK, thx for the reply. Yes, I thought that. But the version error is defiantly there. DNN now compiles against .Net Framework 4.7.2. Could this be the issue? Often on the move to the .Net Framework 4.7.2 version we had very odd errors when versions were incorrect. Which makes me think that could be the answer. Is there a version of Markdig compiled for .Net Framework 4.7.2 ?
Author
Owner

@xoofx commented on GitHub (Nov 27, 2022):

Is there a version of Markdig compiled for .Net Framework 4.7.2 ?

Both the 4.5.2 version and netstandard2.0 version should be compatible with it.

If you have a simple repro, please create a GitHub repo and give a link to it, otherwise, I can only suspect an invalid usage somewhere from your side. 🙂

@xoofx commented on GitHub (Nov 27, 2022): > Is there a version of Markdig compiled for .Net Framework 4.7.2 ? Both the 4.5.2 version and netstandard2.0 version should be compatible with it. If you have a simple repro, please create a GitHub repo and give a link to it, otherwise, I can only suspect an invalid usage somewhere from your side. 🙂
Author
Owner

@leedavi commented on GitHub (Nov 27, 2022):

OK, I know MarkDig works, I have it working as a .NetCore solution. This is some kind of version issue between what I'm doing in DNN and what MarkDig expects or wants.

I will not waste your time. I thought you might know off the top of your head. I have a workaround. I'll have a jump into it again if I can find time. I'll put a question if anyone got it working on the DNN MVP forum.

Thank you for your help. I'll let you know if I find a solution.

@leedavi commented on GitHub (Nov 27, 2022): OK, I know MarkDig works, I have it working as a .NetCore solution. This is some kind of version issue between what I'm doing in DNN and what MarkDig expects or wants. I will not waste your time. I thought you might know off the top of your head. I have a workaround. I'll have a jump into it again if I can find time. I'll put a question if anyone got it working on the DNN MVP forum. Thank you for your help. I'll let you know if I find a solution.
Author
Owner

@glopesdev commented on GitHub (Dec 4, 2022):

@leedavi I also ran into the same issue, updating Markdig from an older version in a .NET 4.7.2 project and I traced the problem down to a dependency from the System.Memory nuget package.

Although Markdig itself does not reference System.Numerics.Vectors, the System.Memory package declares a dependency on it for .NET 4.6.1 profile or higher (strangely not for .NET 4.5).

It's a bit sad that the dependency on System.Memory brings so much baggage to it on legacy .NET projects, as I much prefer having a lean dependency tree. Markdig 18.0 and lower had no dependencies for .NET framework projects. Unfortunately, System.Memory is a kind of hidden iceberg that brings all kinds of other stuff with it. Would be great to have a build with no dependencies again but at this point it might be easier to just embed Markdig in the project itself.

@glopesdev commented on GitHub (Dec 4, 2022): @leedavi I also ran into the same issue, updating Markdig from an older version in a .NET 4.7.2 project and I traced the problem down to a dependency from the [`System.Memory`](https://www.nuget.org/packages/System.Memory/) nuget package. Although Markdig itself does not reference `System.Numerics.Vectors`, the `System.Memory` package declares a dependency on it for .NET 4.6.1 profile or higher (strangely not for .NET 4.5). It's a bit sad that the dependency on `System.Memory` brings so much baggage to it on legacy .NET projects, as I much prefer having a lean dependency tree. Markdig 18.0 and lower had no dependencies for .NET framework projects. Unfortunately, `System.Memory` is a kind of hidden iceberg that brings all kinds of other stuff with it. Would be great to have a build with no dependencies again but at this point it might be easier to just embed Markdig in the project itself.
Author
Owner

@leedavi commented on GitHub (Dec 5, 2022):

@glopesdev Thank you for letting me know I'm not crazy. :-)

Your confirmation saves me time chasing this. Thank you again. I will look at creating a service to build the html in an external way, Using the code I already have working,

P.S. I agree with you view on dependencies.

@leedavi commented on GitHub (Dec 5, 2022): @glopesdev Thank you for letting me know I'm not crazy. :-) Your confirmation saves me time chasing this. Thank you again. I will look at creating a service to build the html in an external way, Using the code I already have working, P.S. I agree with you view on dependencies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#577