Inspector_dllI have installed the latest version of MathNet on Visual Studio using the NuGet Package Manager. I've also, copied the MathNet.Numerics.dll to an Plugins folder in the Unity editor. Yet it still gives a compiler error: error CS0234: The type or namespace name 'Distributions' does not exist in the namespace 'MathNet.Numerics' (are you missing an assembly reference?)

Does anyone know how to solve this or knows a similar package that works with Unity?

  • \$\begingroup\$ How have you configured the dll import settings in the inspector inside Unity? \$\endgroup\$ – DMGregory May 21 '20 at 15:35
  • \$\begingroup\$ Haven't touched it, kind of a newbie here. Updated question with image. \$\endgroup\$ – ManoTech May 21 '20 at 15:51
  • \$\begingroup\$ Have you had any luck with this? Specifically curious if this library works in Unity Games deployed to Android or iOS. \$\endgroup\$ – Ari Goldschmidt Jan 20 at 19:52
  • \$\begingroup\$ Honestly I don't remember but I don't think I got it working. I think I just used another package, from unity asset store. \$\endgroup\$ – ManoTech Jan 21 at 17:59
  • \$\begingroup\$ Try put it in Assets/Plugins and then maybe you need to add a reference to it in your asmdef file. I did something like that before. \$\endgroup\$ – Emil Feb 3 at 16:42

I've been able to install NuGet packages (and in particular MathNet.Numerics) for Unity using this Plugin: https://github.com/GlitchEnzo/NuGetForUnity

The instructions are in the repo's README, but the following steps should work:

  1. add the NugetForUnity.unitypackage to your Unity Project.
  2. Open the NuGet > Manage NuGet Packages Window
  3. Search the MathNet.Numerics and install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.