簡體   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