NuGet Package Dependencies

后端 未结 1 699
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-18 06:44

Is it true that for every dependency that a package has on some other library, that those libraries need to be resolved and installed as well?

For example, I created

相关标签:
1条回答
  • 2021-01-18 07:22

    When a consumer installs your nuget package, nuget will automatically resolve and install the dependent packages as well.

    It is possible to include the dlls within the package but it is not recommended. Because one way or another they will have to have references to the dlls they need to use your package( in this case NLog, PostSharp and WindowsAzure.Storage). Its better that the consumer have controll over what libraries are installed.

    Another benefit of having dependencies via nuget is that the consumer may decide to install a newer version of WindowsAzure.Storage library which he can do easily when you don't have the dll injected into the package. Otherwise you can get into some messy assemblies runtime errors.

    You control what your package contains via nuspec file used to build the nuget package.

    0 讨论(0)
提交回复
热议问题