使用git子模块恢复Nuget Package [英] Nuget Package restore with git submodule

查看:325
本文介绍了使用git子模块恢复Nuget Package的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目,其中包括来自git的2个子模块。这两个项目都启用了nuget包恢复,也是父项目。
包含的两个子模块中的包文件夹未检入,在已签出的项目中不存在。
在构建父项目时,Nuget会尝试恢复子文件夹中的包,但将其包含在错误的包文件夹中!

  C:\Dev\git\oasisdb\odb_oasis_repository\ODB_OASIS_Repository\.nuget\NuGet.exeinstallC:\Dev\git\oasisdb\odb_oasis_repository\odb_oasis_rvm\ODB_OASIS_RVM_EF\\ \\ ODB_OASIS_RVM_EF \packages.config-source -  NonInteractive -RequireConsent -solutionDirC:\Dev\git\oasisdb\odb_oasis_repository\ODB_OASIS_Repository\



为什么nuget无法在子模块的解决方案目录中恢复?



谢谢

解决方案

Nuget正在恢复已打开的解决方案目录中的软件包。

编辑子模块项目的.csproj并修改来自以下内容的包dll引用:

 < ItemGroup> 
< Reference Include =Microsoft.Rest.ClientRuntime,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35,processorArchitecture = MSIL>
< HintPath> .. \packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\\\
et45\Microsoft.Rest.ClientRuntime.dll< / HintPath>
<私人>真实< /私人>
< /参考>

到:

 < ItemGroup> 
< Reference Include =Microsoft.Rest.ClientRuntime,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35,processorArchitecture = MSIL>
< HintPath> $(SolutionDir)\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\\\
et45\Microsoft.Rest.ClientRuntime.dll< / HintPath>
<私人>真实< /私人>
< /参考>

希望得到这个帮助!


i have a project where i include 2 submodules from git. Both projects have "nuget package restore" enabled, the parent project too. The package folder in the two included submodules is not checked in, does not exist in checked out projects. When building the parent project Nuget tries to restore the packages in the subfolders but into the wrong package folder!

"C:\Dev\git\oasisdb\odb_oasis_repository\ODB_OASIS_Repository\.nuget\NuGet.exe" install "C:\Dev\git\oasisdb\odb_oasis_repository\odb_oasis_rvm\ODB_OASIS_RVM_EF\ODB_OASIS_RVM_EF\packages.config" -source ""  -NonInteractive -RequireConsent -solutionDir "C:\Dev\git\oasisdb\odb_oasis_repository\ODB_OASIS_Repository\ "

Why does nuget not restore in the solution dir of the submodule?

Thanks

解决方案

Nuget is restoring the package in the opened solution directory.

You can edit the .csproj of the submodule project and modify package dll references from :

   <ItemGroup>
    <Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
      <HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
      <Private>True</Private>
    </Reference>

to :

 <ItemGroup>
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <HintPath>$(SolutionDir)\packages\Microsoft.Rest.ClientRuntime.2.1.0\lib\net45\Microsoft.Rest.ClientRuntime.dll</HintPath>
  <Private>True</Private>
</Reference>

Hope this help!

这篇关于使用git子模块恢复Nuget Package的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆