在 Visual Studio 中向项目添加引用和添加 Nuget 包之间的区别
Difference between adding a Reference and adding a Nuget package to a project in Visual Studio
我有一个 VS (2015) 项目。我看到我项目的解决方案资源管理器视图中有一个 "References" 部分,其中包括 System.Core 之类的内容。我假设这些是已添加到项目中的 .dll?
我还可以右键单击项目文件(同样在解决方案资源管理器中),然后 select 选择 "Manage NuGet Packages" 选项。我知道 NuGet 允许我向我的项目添加外部代码(例如外部 .dll 和相关文件)。
添加对我的项目的引用和向我的项目添加 .nupkg 有什么区别?是不是 .nupkg 可以包含除 .dll 之外的一大堆其他东西(例如文档)?我为什么要使用其中之一?
What's the difference between adding a reference to my project and
adding a .nupkg to my project?
NuGet本质上和手动添加引用没有什么区别,最终都是为项目添加引用。是一款自动为我们添加程序集并进行管理的工具,有效提高了我们开发项目的效率。
详情请查看the document about nuget:
Put simply, a NuGet package is a single ZIP file with the .nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number. Developers with code to share create packages and publish them to a public or private host. Package consumers obtain those packages from suitable hosts, add them to their projects, and then call a package's functionality in their project code. NuGet itself then handles all of the intermediate details.
Because NuGet supports private hosts alongside the public nuget.org host, you can use NuGet packages to share code that's exclusive to an organization or a work group. You can also use NuGet packages as a convenient way to factor your own code for use in nothing but your own projects. In short, a NuGet package is a shareable unit of code, but does not require nor imply any particular means of sharing.
.
Is it just that .nupkg can contain a whole bunch of other things aside
from a .dll (e.g. documentation)?
是的,NuGet 包可以在包中包含指定的文件。
Why would I use one or the other?
Nuget 提供了几个额外的好处:
- 它通过添加对
必要的程序集,创建和添加项目文件(例如
配置)等
- 它提供包更新
- 这一切都非常方便
我相信一旦你使用它,你就会发现它有很多好处。
查看 Why use NuGet 了解更多详情。
希望对您有所帮助。
我有一个 VS (2015) 项目。我看到我项目的解决方案资源管理器视图中有一个 "References" 部分,其中包括 System.Core 之类的内容。我假设这些是已添加到项目中的 .dll?
我还可以右键单击项目文件(同样在解决方案资源管理器中),然后 select 选择 "Manage NuGet Packages" 选项。我知道 NuGet 允许我向我的项目添加外部代码(例如外部 .dll 和相关文件)。
添加对我的项目的引用和向我的项目添加 .nupkg 有什么区别?是不是 .nupkg 可以包含除 .dll 之外的一大堆其他东西(例如文档)?我为什么要使用其中之一?
What's the difference between adding a reference to my project and adding a .nupkg to my project?
NuGet本质上和手动添加引用没有什么区别,最终都是为项目添加引用。是一款自动为我们添加程序集并进行管理的工具,有效提高了我们开发项目的效率。
详情请查看the document about nuget:
Put simply, a NuGet package is a single ZIP file with the .nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number. Developers with code to share create packages and publish them to a public or private host. Package consumers obtain those packages from suitable hosts, add them to their projects, and then call a package's functionality in their project code. NuGet itself then handles all of the intermediate details.
Because NuGet supports private hosts alongside the public nuget.org host, you can use NuGet packages to share code that's exclusive to an organization or a work group. You can also use NuGet packages as a convenient way to factor your own code for use in nothing but your own projects. In short, a NuGet package is a shareable unit of code, but does not require nor imply any particular means of sharing.
.
Is it just that .nupkg can contain a whole bunch of other things aside from a .dll (e.g. documentation)?
是的,NuGet 包可以在包中包含指定的文件。
Why would I use one or the other?
Nuget 提供了几个额外的好处:
- 它通过添加对 必要的程序集,创建和添加项目文件(例如 配置)等
- 它提供包更新
- 这一切都非常方便
我相信一旦你使用它,你就会发现它有很多好处。
查看 Why use NuGet 了解更多详情。
希望对您有所帮助。