简体   繁体   English

为什么我不能访问通过NuGet添加的名称空间?

[英]Why can't I access a namespace added through NuGet?

Because I want to use matrices in my program, I added the Math.NET library through NuGet in Visual Studio 2015. However, although I can see the library files in the Project References folder, VS doesn't seem to recognize any of the references to it. 因为我想在程序中使用矩阵,所以我通过Visual Studio 2015中的NuGet添加了Math.NET库。但是,尽管我可以在Project References文件夹中看到库文件,但是VS似乎无法识别任何引用对此。 Autocomplete won't suggest MathNet when writing the using-command, and it won't recognize any of the classes from that namespace either, of course. 编写using-命令时,自动完成功能不会建议MathNet,当然,它也不会识别该名称空间中的任何类。 Are there any more steps I'm missing? 我还有其他步骤吗?

尽管我仍然不能说为什么自动完成功能不建议使用命名空间(即使尝试构建后仍会在建议中显示),但我可以确认问题的根源在于矩阵和向量使用MathNet.Numerics.LinearAlgebra而不是MathNet.Numerics导入。

Why can't I access a namespace added through NuGet? 为什么我不能访问通过NuGet添加的名称空间?

Whether there is a error when you add the using command: using MathNet.Numerics; 添加using命令时是否存在错误: using MathNet.Numerics; ?

Not sure why autocomplete won't suggest MathNet when you write the using-command, it works fine on my machine, I will write detail steps here so that you can check the difference, then find some help. 不知道为什么在编写using命令时自动完成功能不建议MathNet,它在我的机器上运行正常,我将在此处编写详细步骤,以便您检查差异,然后寻求帮助。

Detail Steps: 详细步骤:

  1. Create a new blank c# class library project. 创建一个新的空白c#类库项目。
  2. Add the package MathNet.Numerics to the project by NuGet. 通过NuGet将软件包MathNet.Numerics添加到项目中。
  3. Open a .cs file, add using MathNet.Numerics and instantiate a class " Permutation " (Most classes are static class). 打开一个.cs文件, using MathNet.Numerics添加并实例化一个类“ Permutation ”(大多数类都是静态类)。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM