繁体   English   中英

如何在 svn 中使用 NuGet-Packages?

[英]How to use NuGet-Packages with svn?

在我的项目中安装了一些 NuGet-Packages。 package.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)\MSBuild\14.0\bin\Microsoft.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)\MSBuild\14.0\bin\Microsoft.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)\MSBuild\14.0\bin\Microsoft.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:\branches\Version\OnlineApplicationMapping\Mapping\ONLINE_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:\branches\Version\OnlineApplicationMapping\Mapping\ONLINE_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:\branches\Version\OnlineApplicationMapping\Mapping\ONLINE_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:\branches\Version\OnlineApplicationMapping\Mapping\ONLINE_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-Packages 中的 dll 丢失了。

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

好的。 我终于在 Austin T French 和 felix-b 的帮助下得到了这个(见评论)。 我试图按照https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore-troubleshooting章节中的命令进行操作:“其他潜在条件”

这就是我所做的:

  • 我关闭了 Visual Studio
  • 我删除了“包”文件夹(在解决方案文件夹中)
  • 我从这里下载了最新的 NuGet.exe: https ://www.nuget.org/downloads
  • 我从命令行调用了“nuget locals all -clear”。
  • 我重新打开了 Visual Studio
  • 我右键单击解决方案(在 VS 中)并选择:“还原 Nuget 包”
  • 我重建了解决方案

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM