0

I have no experience over C# and i do not know how to use those binaries i downloaded there : http://mathnetnumerics.codeplex.com/releases/view/101319

How do i include and build those in my project so i can make a standalone when the project is done?

Thanks!

Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34
Fawar
  • 735
  • 2
  • 11
  • 32

6 Answers6

4

Install the required libraries and packages via the Nuget Package Console in Visual Studio.

Click File -> Library Package Manager -> Package Manager Console. Then type the following command.

PM> Install-Package MathNet.Numerics

This will install the package and provide you with your dlls.

David L
  • 32,885
  • 8
  • 62
  • 93
  • Where is that Nuget package seems powerful but i never heard of it :( – Fawar Apr 08 '13 at 19:26
  • @user2258989 I have updated my answer with instructions on how to reach the Package Manager Console. Hopefully it helps. The Package Manager Console ensures you don't miss any dependencies or dlls since you are using the package provided by the author. It is now the most "correct" to add packages according to Microsoft. – David L Apr 08 '13 at 19:32
  • Thanks you ! By installing the package, it does mean it would be in my project and when i will be building it will be in my "released or debug" version, not need to copy the dll all over agin? Please guide me – Fawar Apr 08 '13 at 19:37
  • Correct, unless you have some sort of funky rule. Since it is a dependency for your project, MS Build is intelligent enough to also copy that dll. You should be fine. – David L Apr 08 '13 at 19:43
  • @Jirka-x1 Good eye. That was simply a hasty copy/paste error on my part from the documentation. I've removed it from my answer. – David L May 20 '13 at 17:26
  • In my Visual Studio 2015 the Nuget Package Console is under Click Tools -> Library Package Manager -> Package Manager Console – SpeedCoder5 Sep 12 '17 at 16:03
1

Add a reference to the binaries and include the namespace of whatever part of that binary you're using in your file.

tnw
  • 13,521
  • 15
  • 70
  • 111
1

if you are using Visual Studio then you can add these libraries from Add Reference option in your project. enter image description here

Sachin
  • 40,216
  • 7
  • 90
  • 102
  • Even easier than the 2 previous options! – Fawar Apr 08 '13 at 19:26
  • As this is your first question on Stackoverflow so I would like to know you that if particular question helps you or you got the solution from here then you can accept that as answer :) – Sachin Apr 08 '13 at 19:37
  • I will, since there is multiple pretty good anwser now i will accept the best one :) – Fawar Apr 08 '13 at 19:42
  • I accepted @david L 's answer because it the recommended wway by microsoft, but yours is simpler and more beginner freindly ! – Fawar Apr 08 '13 at 19:51
0

To use an external binary, you will need to make a reference to it. This might guide you

http://msdn.microsoft.com/en-us/library/7314433t%28v=vs.80%29.aspx

Haedrian
  • 4,240
  • 2
  • 32
  • 53
  • Thank you! From that way of doing it. If i were to move the .dll, would the project not be able to compile or does it import a copy? Will is be automaticly build in the final application (released or do i need to specify it somewhere?) – Fawar Apr 08 '13 at 19:27
0

In my opinion, the easiest way is to drop all the files in the "bin" folder. Then, right click on the "references" folder in your project, click Add --> Add Reference. Next, click the "Browse" tab, navigate to your "bin" folder, and select the files. Now the libraries are available to access through your source code.

You can access the methods and such by inserting "using" statements at the top of your classes, like "using MathNet.Numerics"

kmdsax
  • 1,361
  • 9
  • 12
0

In Visual Studio 2019 it's much easier to install the MathNet.Numerics package:

  1. Go to the Project tab
  2. Find and click NuGet Package Management
  3. Go to Search and enter the name of the package you want to install
  4. Select the package and install it
Mila Khan
  • 21
  • 4