如何将Nuget包装与SVN一起使用



在我的项目中,安装了一些Nuget包装。packages.config看起来像这样:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="Antlr3.Runtime" version="3.5.1" targetFramework="net461" />
  <package id="FluentNHibernate" version="2.1.2" targetFramework="net461" />
  <package id="Iesi.Collections" version="4.0.4" targetFramework="net461" />
</packages>

我承诺了我的项目,并在另一个位置(同一计算机(上对其进行了更新。但是现在,当我尝试构建项目时,我会遇到以下错误:

1>------ Build started: Project: OnlineApplicationMapping, Configuration: Release Any CPU ------
1>C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1820,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
1>C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1820,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "FluentNHibernate, Version=2.1.2.0, Culture=neutral, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
1>C:Program Files (x86)MSBuild14.0binMicrosoft.Common.CurrentVersion.targets(1820,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Iesi.Collections, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
1>C:branchesVersionOnlineApplicationMappingMappingONLINE_ANTRAG_TYPMap.cs(1,7,1,23): error CS0246: The type or namespace name 'FluentNHibernate' could not be found (are you missing a using directive or an assembly reference?)
1>C:branchesVersionOnlineApplicationMappingMappingONLINE_BEFUELL_MAPMap.cs(1,7,1,23): error CS0246: The type or namespace name 'FluentNHibernate' could not be found (are you missing a using directive or an assembly reference?)
1>C:branchesVersionOnlineApplicationMappingMappingONLINE_ANTRAG_TYPMap.cs(11,34,11,61): error CS0246: The type or namespace name 'ClassMap<>' could not be found (are you missing a using directive or an assembly reference?)
1>C:branchesVersionOnlineApplicationMappingMappingONLINE_BEFUELL_MAPMap.cs(11,35,11,63): error CS0246: The type or namespace name 'ClassMap<>' could not be found (are you missing a using directive or an assembly reference?)

似乎缺少了Nuget包装中的DLL。

我真的必须将DLL放入存储库中吗?在这种情况下,Nuget不应该从某些服务器获取文件?

好。我终于在Austin t French和Felix-B的帮助下得到了这个(请参阅评论(。我试图遵循https://learn.microsoft.com/en-us/nuget/consume-packages/package-restore-troubleshooting章节:"其他潜在条件">

这就是我所做的:

  • 我关闭了Visual Studio
  • 我删除了"软件包"文件夹(在解决方案文件中(
  • 我从这里下载了最新的nuget.exe:https://www.nuget.org/downloads
  • 我从命令行中称为" nuget locals"。
  • 我重新开放Visual Studio
  • 我在解决方案上右键单击(在VS中(,然后选择:"还原nuget软件包"
  • 我重建解决方案

最新更新