我有一个自定义 NuGet 包 (My.Resources),其中包含程序集和对另一个自定义 NuGet 包 (My.Base) 的依赖项。
如果我安装该软件包,安装会成功完成,但不会添加程序集引用。这是完整的输出Install-Package
command:
Attempting to resolve dependency 'My.Base (≥ 1.0.0)'.
Installing 'My.Base 1.0.0'.
Added file 'My.Base.dll' to folder 'My.Base.1.0.0\lib\net45'.
Added file 'My.Base.1.0.0.nupkg' to folder 'My.Base.1.0.0'.
Successfully installed 'My.Base 1.0.0'.
Installing 'My.Rsources 1.1.0-beta0001'.
Added file 'My.Resources.dll' to folder 'My.Resources.1.1.0-beta0001\lib\net45'.
Added file 'My.Resources.XML' to folder 'My.Resources.1.1.0-beta0001\lib\net45'.
Added file 'My.Resources.1.1.0-beta0001.nupkg' to folder 'My.Resources.1.1.0-beta0001'.
Successfully installed 'My.Resources 1.1.0-beta0001'.
Adding 'My.Base 1.0.0' to WindowsFormsApplication8.
For adding package 'My.Base 1.0.0' to project 'WindowsFormsApplication8' that targets 'net45',
>> Assembly references are being added from 'lib\net45'
Added reference 'My.Base' to project 'WindowsFormsApplication8'
Added file 'packages.config'.
Added file 'packages.config' to project 'WindowsFormsApplication8'
Successfully added 'My.Base 1.0.0' to WindowsFormsApplication8.
Adding 'My.Resources 1.1.0-beta0001' to WindowsFormsApplication8.
Added file 'packages.config'.
Successfully added 'My.Resources 1.1.0-beta0001' to WindowsFormsApplication8.
虽然我们还有其他几个自定义 NuGet 包以相同的方式构建和构建,但这是唯一具有这种行为的包。这.nuspec
在 - 的里面.nupkg
看起来不错并且装配正确(net45
) 文件夹。
NuGet 将您的 NuGet 包视为本地化 NuGet 包 https://docs.nuget.org/create/creating-localized-packages仅包含语言资源。此类 NuGet 包中的程序集未被引用。
例如,如果将 My.Resources.dll 重命名为 My.Resources2.dll 之类的名称,则 NuGet 将引用该程序集。
基本上,任何以 .resources.dll 结尾的文件都被 NuGet 视为资源程序集,在安装 NuGet 包时不会引用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)