简体   繁体   English

添加引用 Visual Studio 2010 (NuGet)

[英]Add references Visual Studio 2010 (NuGet)

I am trying to use some references in Visual Studio, I have installed NuGet to use some libraries.我正在尝试在 Visual Studio 中使用一些引用,我已经安装了NuGet来使用一些库。

Is there a way to use only part of the package installed with NuGet?有没有办法只使用与 NuGet 一起安装的包的一部分? For example, if I am using TeklaOpenApi and the following .dll files are installed with this package:例如,如果我使用 TeklaOpenApi 并且以下 .dll 文件与此软件包一起安装:

  • TeklaModel泰克拉模型
  • TeklaDialog TeklaDialog
  • TeklaDrawing Tekla绘图

Use for example just TeklaModel, could I do this using NuGet?例如,仅使用 TeklaModel,我可以使用 NuGet 执行此操作吗?

Is there a way to use only part of the package installed with NuGet?有没有办法只使用与 NuGet 一起安装的包的一部分?

I am afraid that you cannot get what you want.你得不到你想要的。 It is designed by nuget package.它是由 nuget 包设计的。 Usually, when the nuget package contains other dlls which means they are probably depended on a master DLL, or used at runtime.通常,当 nuget 包包含其他 dll 时,这意味着它们可能依赖于主 DLL,或在运行时使用。

All of them play an important role in this nuget, so we cannot easily remove them.所有这些都在这个 nuget 中发挥着重要作用,因此我们无法轻易删除它们。

Although we can use Assembly Reference format(Right-click on References --> Add Reference --> choose one Dll) to reference the specific dll, but there is a risk that if the DLL depends on other corresponding DLL, an error will be reported.虽然我们可以使用Assembly Reference格式(右键References --> Add Reference -->选择一个Dll)来引用特定的dll,但是存在一个风险,如果该DLL依赖其他对应的DLL,就会报错报道。 So we don't recommend it.所以我们不推荐它。

The best way is to install the whole nuget package with all the related dlls.最好的方法是安装包含所有相关 dll 的整个 nuget 包。

Hope it could help you.希望能帮到你。

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

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