gpt4 book ai didi

来自可移植类库 : Value cannot be null or an empty string. 的 Nuget 参数名称:profileValue

转载 作者:行者123 更新时间:2023-12-03 23:55:43 26 4
gpt4 key购买 nike

我有什么

我有可移植类库 MyProj.Backend.Contracts.csproj与以下

项目.json:

{
"supports": {
"net46.app": {},
"uwp.10.0.app": {},
"dnxcore50.app": {}
},
"dependencies": {
"Microsoft.NETCore": "5.0.0",
"Microsoft.NETCore.Portable.Compatibility": "1.0.0",
"NuSpec.ReferenceGenerator": "1.4.2"
},
"frameworks": {
"dotnet": {
"imports": "portable-net452+win81"
}
}
}

和 nuspec:
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>MyProj.Backend.Contracts</id>
<version>1.0.0</version>
<dependencies>
<group targetFramework="dotnet">
<dependency id="System.Resources.ResourceManager" version="4.0.0" />
<dependency id="System.Runtime" version="4.0.20" />
</group>
</metadata>
</package>

请注意,我已将 NuSpec.ReferenceGenerator 添加到我的项目中,并将 '' 添加到我的项目 json 中。

但是,我仍然无法打包我的 PCL 库:
 nuget pack MyProj.Backend.Contracts.csproj
  Attempting to build package from 'MyProj.Backend.Contracts.csproj'.
Packing files from 'C:\Projects\MyProj\Backend\Contracts\Dev\bin\Contracts'.
Using ''MyProj.Backend.Contracts.csproj.nuspec' for metadata.
Value cannot be null or an empty string.
Parameter name: profileValue

我需要什么

如何修改我的 .nuspec 以便我可以从我的 PCL 库项目创建包?

最佳答案

这是新 project.json 和指定依赖项的问题。错误消息非常糟糕,但这里有一些关于如何使其工作的指导:https://github.com/ericstj/NuGetDocs/blob/ericstj/nuget3samples/NuGet.Docs/Create/nuget3-packages-walkthrough.md

简短的回答似乎是使用 Nuget 包 nuspec.referencegenerator 为您正确填写 nuspec 文件。

只是添加引用下面的评论;使用 Nuget 3.3(尚未使用 3.4 或更高版本进行测试),混合 csproj 和 project.json 文件似乎不起作用(或者它仅适用于部分场景)。如果您想使用 project.json,您似乎需要对代码文件使用新的 json 项目格式,反之亦然,恢复为标准的 nuspec 和 csproj 组合。

关于来自可移植类库 : Value cannot be null or an empty string. 的 Nuget 参数名称:profileValue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34811987/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com