Итак, я использую Jenkins и создаю приложение с помощью c #.Сначала я запустил Jenkins на своей локальной машине, и у меня все заработало нормально.Следующим шагом было создание его из внешнего сервера, на котором работала собственная копия Jenkins.Когда я делаю это, я получаю следующее предупреждение:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\Program Files (x86)\Jenkins\workspace\Joshua_Jenkins_Freestyle\ConsoleApp2\ConsoleApp2.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\Program Files (x86)\Jenkins\workspace\Joshua_Jenkins_Freestyle\ConsoleApp2\ConsoleApp2.csproj]
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "System.Data", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project. [C:\Program Files (x86)\Jenkins\workspace\Joshua_Jenkins_Freestyle\ConsoleApp2\ConsoleApp2.csproj]
, которое, как я считаю, приводит к следующей ошибке:
UnitTest1.cs (10,21): ошибка CS0012: TheТип 'System.Attribute' определен в сборке, на которую нет ссылок.Необходимо добавить ссылку на сборку «System.Runtime, версия = 4.0.0.0, культура = нейтральная, PublicKeyToken = b03f5f7f11d50a3a».[C: \ Program Files (x86) \ Jenkins \ workspace \ Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj] UnitTest1.cs (9,10): ошибка CS0616: «Атрибут класса Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute» не является[C: \ Program Files (x86) \ Jenkins \ workspace \ Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj] UnitTest1.cs (18,10): ошибка CS0616: «Атрибут класса Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute» не является[C: \ Program Files (x86) \ Jenkins \ workspace \ Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj] UnitTest1.cs (26,10): ошибка CS0616: «Атрибут класса Microsoft.VisualStudio.TestTools.UnitTesting.TestCategoryAttribute не является атрибутом класса[C: \ Program Files (x86) \ Jenkins \ workspace \ Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj] UnitTest1.cs (26,35): ошибка CS0616: «Атрибут класса Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute не является атрибутом»[C: \ Program Files (x86) \ Jenkins \ workspace \ Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj] UnitTest1.cs (6,6): ошибка CS0616: «Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute» не является классом атрибута [C: \ Program Files (x86) \ Jenkins \ workspace \Joshua_Jenkins_Freestyle \ UnitTestProject1 \ UnitTestProject1.csproj]
пытается понять это безуспешно.
Первым делом я попытался установить целевую версию моего проекта на ту же .Net Framework, которая использовалась внешним сервером Jenkins (4.6), в ссылках на проект.это не сработало.
Любая помощь приветствуется.