【问题标题】:Trouble with nuget packnuget包的问题
【发布时间】:2018-04-02 22:17:36
【问题描述】:

我正在使用带有本地 nuget 库的 Nuget.exe 版本 4.3.0.4406,并且发现包位置之间不匹配。

当我安装一个包时,它会安装到 c:\projects\ProjectX.1.0.0.0。

但是,当我尝试打包引用 ProjectX 的项目时,它似乎正在寻找类似 c:\projects\ProjectX\1.0.0.0 的路径。

为了澄清,nupkg 确实存在于 nuget 将其放在 ProjectX.1.0.0.0 下的位置,但它似乎使用 ProjectX\1.0.0.0 查找引用。

我得到的实际错误是:

    Missing C:\Projects\packages\projectX\1.0.0.0\projectx.1.0.0.0.nupkg
Unable to find 'ProjectX.1.0.0.0.nupkg'. Make sure the project has been built.
NuGet.CommandLine.CommandLineException: Unable to find 'ProjectX.1.0.0.0.nupkg'. Make sure the project has been built.
   at NuGet.CommandLine.ProjectFactory.AddDependencies(Dictionary`2 packagesAndDependencies)
   at NuGet.CommandLine.ProjectFactory.ProcessDependencies(PackageBuilder builder)
   at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath, NuGetVersion version, String suffix, Boolean buildIfNeeded, PackageBuilder builder)
   at NuGet.Commands.PackCommandRunner.BuildFromProjectFile(String path)
   at NuGet.CommandLine.PackCommand.ExecuteCommand()
   at NuGet.CommandLine.Command.ExecuteCommandAsync()
   at NuGet.CommandLine.Command.Execute()
   at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

【问题讨论】:

    标签: package nuget file-location


    【解决方案1】:

    看来我的解决方案是包括

    developmentDependency="true"
    

    在有问题的包中,然后将它们也包含在 nuspec 的依赖项部分中。

    【讨论】:

      猜你喜欢
      • 2019-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-11
      • 2014-01-15
      • 1970-01-01
      • 1970-01-01
      • 2021-07-31
      相关资源
      最近更新 更多