2

I'm new to coding in C#, and I'm using Microsoft Visual Studio 2012. My problem is that when I'm adding a reference from a dll file, it's highlighting in red the import "using alglibnet2;" I am trying to add a reference to my code from Alglib to calculate the covariance matrix covm(). I did put the dll file in a lib folder with my code too. Any help would be appreciated. thanks!

Mike
  • 49
  • 2
  • 5
  • Also make sure that the alglibnet2 dll is of a compatible version. That is, is it a full .NET DLL and you're compiling for Silverlight (or vice versa)? – Chris Sinclair Jun 15 '12 at 00:58

1 Answers1

9

You need to right click on the project and choose Add Reference, then navigate to the location of the assembly.

Gabe
  • 49,577
  • 28
  • 142
  • 181
  • 1
    @MichaelLoftus Also, after you've added the reference as Gabe described right click on it, choose properties, confirm the path is correct, copy local is set to true. – evanmcdonnal Jun 15 '12 at 00:38
  • I actually did add the reference by right-clicking on the project, and it did not work still. Maybe my dll file is not compatible? – Mike Jun 15 '12 at 14:46
  • Do you see the reference in the list of references after doing so? – Gabe Jun 15 '12 at 14:56
  • I fixed it, I had to type alglib.covm(matrix1.ToArray(), out covarianceMatrix); instead of doing "using alglib." – Mike Jun 18 '12 at 20:14