gpt4 book ai didi

c# - 在 Linux 中,当我使用 nuget pack 时,它会引发 "Cannot create a package"

转载 作者:太空宇宙 更新时间:2023-11-04 12:21:41 26 4
gpt4 key购买 nike

这是我的[完整代码]( https://github.com/roroco/nuget-pack-raise-cannot-create-err ),我只用了下面的代码:

//Ro/Dep/TestNuget.cs

namespace Dep
{
public class TestNuget
{

}
}

并遵循 Dep.nuspec

<?xml version="1.0"?>
<package >
<metadata>
<id>Ro.Dep</id>
<version>1.0</version>
<title>Dep</title>
<authors>roroco</authors>
<owners>roroco</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>prpr</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
</package>

当我跟随并引发错误时:

roroco@roroco ~/Downloads/test/cs/create-nuget-dep-and-use-it/Dep $ nuget pack -Verbosity detailed Dep.nuspec 
Attempting to build package from 'Dep.nuspec'.
System.InvalidOperationException: Cannot create a package that has no dependencies nor content.
at NuGet.PackageBuilder.Save (System.IO.Stream stream) [0x0005b] in <0800978c21b14124ab3d9821cb98ed45>:0
at NuGet.Commands.PackCommand.BuildPackage (NuGet.PackageBuilder builder, System.String outputPath) [0x00088] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.BuildFromNuspec (System.String path) [0x00054] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.BuildPackage (System.String path) [0x00013] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.PackCommand.ExecuteCommand () [0x000a5] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Commands.Command.Execute () [0x000ca] in <e3902586c3ab4cf69b6ed7a8d575962f>:0
at NuGet.Program.Main (System.String[] args) [0x0018b] in <e3902586c3ab4cf69b6ed7a8d575962f>:0

这是我的环境:

roroco@roroco ~/Downloads/test/cs/create-nuget-dep-and-use-it/Dep $ lsb_release -a
No LSB modules are available.
Distributor ID: LinuxMint
Description: Linux Mint 18 Sarah
Release: 18
Codename: sarah

NuGet Version: 2.12.0.0

最佳答案

我找到了解决方案,sudo apt install nuget -y install nuget 2,当我下载 latest nuget.exe(4.1.0) 时, 并运行 mono path/to/nuget.exe pack, 它工作

关于c# - 在 Linux 中,当我使用 nuget pack 时,它会引发 "Cannot create a package",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45758703/

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