[英]Created nuget package's dll can not be accessable from package's loaded project
我想创建.net核心类库的nuget包。
运行nuget spec和创建的Solution.nuspec文件。 我将其修改如下:
<?xml version="1.0"?> <package > <metadata> <id>Solution</id> <version>1.0.0</version> <authors>cc Team</authors> <owners>cc</owners> <licenseUrl></licenseUrl> <projectUrl></projectUrl> <iconUrl></iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description></description> <releaseNotes></releaseNotes> <copyright>Copyright 2017</copyright> <tags>c# .net</tags> <dependencies> <dependency id="NETStandard.Library" version="1.6.1" /> </dependencies> <references> <reference file="Solution.dll" /> </references> </metadata> <files> <file src="Solution.dll" target="lib\\netstandard1.6\\Solution.dll"/>
解决方案的文件的节点src值outpupath。 (BIN \\发布\\ netstandard1.6 \\ Solution.dll)
然后我搜索了错误,发现了这个:
"scripts": {
"postcompile": [
"dotnet pack --no-build --configuration %compile:Configuration%"
]
}
编译我的解决方案项目后,它将创建Solution.1.0.0-0.nupkg文件和Solution.1.0.0-0.symbols。 我将其放在本地软件包源中,但这些软件包未在“ Nuget软件包管理器”中列出。
你有什么主意吗?
我的经验是从有时糟糕的解决方案创建程序包。 从项目文件创建包可以解决此问题。
在我清理'C:\\ Users \\ XXX.nuget \\ packages \\ Solution'文件夹并再次添加软件包后,解决了我的问题。
因为我之前尝试过格式化不良的nutget软件包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.