Как использовать пакеты 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)\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?)

Похоже, dll из пакетов NuGet отсутствуют.

Мне действительно нужно помещать DLL в репозиторий? Разве в этом случае NuGet не должен получать файлы с какого-то сервера?

🤔 А знаете ли вы, что...
C# поддерживает LINQ (Language Integrated Query) для удобного запроса и обработки данных.


1
907
1

Ответ:

Решено

в порядке. Наконец-то я получил это с помощью 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».
  • Я восстановил решение