У меня есть базовое приложение .NET, которое ссылается на System.Data.SqlClient library
и его зависимости.Собирая проект локально, он работает без проблем, но когда я собираю его в конвейере DevOps Azure, он возвращает много «не найденных» ошибок об этой библиотеке.
Это ошибки:
Helpers\MicrosoftSQLServerHelper.cs(15,41): error CS0246: The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Helpers\MicrosoftSQLServerHelper.cs(19,42): error CS0246: The type or namespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Helpers\MicrosoftSQLServerHelper.cs(29,41): error CS0246: The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Helpers\MicrosoftSQLServerHelper.cs(43,42): error CS0246: The type or namespace name 'SqlCommand' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Helpers\MicrosoftSQLServerHelper.cs(55,41): error CS0246: The type or namespace name 'SqlConnection' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Helpers\MicrosoftSQLServerHelper.cs(59,39): error CS0246: The type or namespace name 'SqlBulkCopy' could not be found (are you missing a using directive or an assembly reference?) [d:\a\1\s\src\Visyon.ETLs.Executors\Visyon.ETLs.Executors.csproj]
Я проверил, какая команда запускается Azure DevOps для сборки проекта ("C:\Program Files\dotnet\dotnet.exe" build d:\a\1\s\src\Visyon.ETLs\Visyon.ETLs.csproj --configuration Release
), и я запустил на своей локальной машине.Локально это работает.
Кроме того, я использую стандартный шаблон сборки ядра .NET, предоставленный Azure DevOps, и запускаю сборку на агенте "VS2017".
Может ли кто-нибудь мне помочь?