Nuget Pack - 无法找到刚刚安装的软件包

时间:2017-04-03 10:37:27

标签: visual-studio nuget

VS 2015中的场景.Nuget 3.5

两个项目。 A和B. A创建Nuget包A.(取决于其他nuget源) B安装Nuget Package A. B创建Nuget包B.

将所有包打包并复制到驱动器号上。 Visual Studio有源代码。

将Nuget Package A安装到B中可以很好地工作。

但是在创建包B时

无法找到' packageA.nupkg'。确保项目已经构建。

我的配置有源,这就是它首先安装的原因。

我刚刚安装了这个软件包,它位于packages文件夹中,它列在packages.config中。

有什么想法吗?

<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
     <PropertyGroup>
       <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
       <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
       <ProjectGuid>{2E3C3C47-80B4-4B51-9039-438380C9A926}</ProjectGuid>
       <OutputType>Library</OutputType>
       <AppDesignerFolder>Properties</AppDesignerFolder>
       <RootNamespace>LucidOcean.Atlantis.Core</RootNamespace>
       <AssemblyName>LucidOcean.Atlantis.Core</AssemblyName>
   <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
   <FileAlignment>512</FileAlignment>
   <RestorePackages>false</RestorePackages>
   <TargetFrameworkProfile />
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <DebugSymbols>true</DebugSymbols>
   <DebugType>full</DebugType>
   <Optimize>false</Optimize>
   <OutputPath>bin\Debug\</OutputPath>
   <DefineConstants>DEBUG;TRACE</DefineConstants>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
 </PropertyGroup>
 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   <DebugType>full</DebugType>
   <Optimize>false</Optimize>
   <OutputPath>bin\Release\</OutputPath>
   <DefineConstants>TRACE</DefineConstants>
   <ErrorReport>prompt</ErrorReport>
   <WarningLevel>4</WarningLevel>
   <DebugSymbols>true</DebugSymbols>
 </PropertyGroup>
 <PropertyGroup>
   <SignAssembly>true</SignAssembly>
 </PropertyGroup>
 <PropertyGroup>
   <AssemblyOriginatorKeyFile>lucidocean.snk</AssemblyOriginatorKeyFile>
 </PropertyGroup>
 <ItemGroup>
   <Reference Include="Atlantis.Extensibility, Version=2017.0.0.9, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Atlantis.Extensibility.2017.0.0.9\lib\net461\Atlantis.Extensibility.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="AWSSDK, Version=2.3.55.2, Culture=neutral, PublicKeyToken=9f476d3089b52be3">
     <HintPath>g:\LucidOceanNugetServer\AWSSDK.2.3.55.2\lib\net45\AWSSDK.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\SharpZipLib.0.86.0\lib\20\ICSharpCode.SharpZipLib.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Atlantis.Core, Version=2017.0.0.3, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Atlantis.Core.2017.0.0.3\lib\net461\LucidOcean.Atlantis.Core.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Business, Version=2017.0.0.9, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Business.2017.0.0.9\lib\net461\LucidOcean.Business.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Data, Version=2017.0.0.9, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Data.2017.0.0.9\lib\net461\LucidOcean.Data.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Data.Utility, Version=2017.0.0.9, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Data.Utility.2017.0.0.9\lib\net461\LucidOcean.Data.Utility.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Web.Caching, Version=2017.0.0.3, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Web.Caching.2017.0.0.3\lib\net461\LucidOcean.Web.Caching.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Web.Communication, Version=2017.0.0.1, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Web.Communication.2017.0.0.1\lib\net461\LucidOcean.Web.Communication.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Web.Layouts, Version=2017.0.0.4, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Web.Layouts.2017.0.0.4\lib\net461\LucidOcean.Web.Layouts.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Web.Security, Version=2017.0.0.9, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Web.Security.2017.0.0.9\lib\net461\LucidOcean.Web.Security.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="LucidOcean.Web.Utility, Version=2017.0.0.8, Culture=neutral, PublicKeyToken=ff48a18f294fb322, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\LucidOcean.Web.Utility.2017.0.0.8\lib\net461\LucidOcean.Web.Utility.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.Report.Viewer.11.0.0.0\lib\net\Microsoft.ReportViewer.Common.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="Microsoft.ReportViewer.ProcessingObjectModel, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.Report.Viewer.11.0.0.0\lib\net\Microsoft.ReportViewer.ProcessingObjectModel.DLL</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.Report.Viewer.11.0.0.0\lib\net\Microsoft.ReportViewer.WebForms.DLL</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="Microsoft.SqlServer.Types, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
     <Private>True</Private>
   </Reference>
   <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="nunit.framework, Version=3.6.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\NUnit.3.6.1\lib\net45\nunit.framework.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="SimpleImpersonation, Version=2.0.1.27158, Culture=neutral, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\SimpleImpersonation.2.0.1\lib\net40-Client\SimpleImpersonation.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System" />
   <Reference Include="System.ComponentModel.DataAnnotations" />
   <Reference Include="System.Configuration" />
   <Reference Include="System.Core" />
   <Reference Include="System.Drawing" />
   <Reference Include="System.Messaging" />
   <Reference Include="System.Net.Http" />
   <Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Net.Http.WebRequest" />
   <Reference Include="System.Runtime.Serialization" />
   <Reference Include="System.Security" />
   <Reference Include="System.ServiceModel" />
   <Reference Include="System.Web" />
   <Reference Include="System.Web.Extensions" />
   <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.Http.WebHost, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>g:\LucidOceanNugetServer\Microsoft.AspNet.WebApi.WebHost.5.2.3\lib\net45\System.Web.Http.WebHost.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
     <HintPath>$(SolutionDir)packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
     <Private>True</Private>
   </Reference>
   <Reference Include="System.Xml.Linq" />
   <Reference Include="System.Data.DataSetExtensions" />
   <Reference Include="Microsoft.CSharp" />
   <Reference Include="System.Data" />
   <Reference Include="System.Xml" />
 </ItemGroup>

2 个答案:

答案 0 :(得分:2)

我使用这篇帖子How can .csproj know about its solution?输出$(SolutionDir)并发现了差异。

csproj,在.sln文件夹下一级,给我一个不正确的$(SolutionDir),当调用nuget pack b.csproj时 A.package比B.package高一级,而B则向下一级而没有找到packages文件夹。

文件夹\溶液\包 文件夹\溶液\项目A 文件夹\项目B

msbuild和Visual Studio 2015遇到了同样的问题。

由于我通过命令行使用msbuild和nuget,并且错误“cant find package”不包含它所寻找的文件夹,因此它成了一个不好的问题。

Nuget确实应该在pack命令上输出更多,而不仅仅是找不到packagename。完整的文件夹位置会有所帮助。

我将项目移动到相同的文件夹深度,然后找到了包。 奇怪的是,csproj导入/依赖关系只有.. \在提示上,这不足以找到包。我认为VS.NET 2015可能存在更新提示位置的问题。

答案 1 :(得分:1)

  

无法找到&#39; packageB.nupkg&#39;。确保项目已构建完成。

此错误应该无法找到&#34; packageA .nupkg&#34;而不是&#34; packageB.nupkg&#34;。我是对的吗?

如果是,那是因为包文件夹不在预期的位置

您可以检查解决方案文件夹下的packages文件夹中是否存在PackageA.nupkg。当nuget pack包依赖于packagesirectory时,应该有一个选项通过cmd行覆盖该配置,但选项-PackageDirectory 已将添加到nuget中打包命令。它打算在版本3.61中添加。有关详细信息,请参阅Issue 3378

要解决此问题,您可以将packages文件夹设置在预期位置,或使用.nuspec文件而不是.xxproj。

希望这可以帮到你。