如果您需要更多细节,请告诉我。
配置:
控制台输出中的错误:
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9): 错误 MSB4062: 无法从程序集 C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll 加载 "Microsoft.CodeAnalysis.BuildTasks.Csc" 任务。无法加载文件或程序集 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。系统找不到指定的文件。请确认声明正确,程序集及其所有依赖项都可用,并且任务包含实现 Microsoft.Build.Framework.ITask 的公共类。 [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj]C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props(13,5): 错误 : Microsoft.Net.Compilers 仅支持 MSBuild v14.0 及以上版本 [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj]
完整控制台输出:
Started by user stav alfi Building in workspace C:\Program Files (x86)\Jenkins\workspace\new 3
git.exe rev-parse --is-inside-work-tree # timeout=10 Fetching changes from the remote Git repository git.exe config remote.origin.url https://github.com/stavalfi/c_sharp_example_project.git # timeout=10 Fetching upstream changes from https://github.com/stavalfi/c_sharp_example_project.git git.exe --version # timeout=10 git.exe fetch --tags --progress https://github.com/stavalfi/c_sharp_example_project.git+refs/heads/:refs/remotes/origin/ git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10 git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10 Checking out Revision a70858995d5557ae1483965072e2a66833f9979d (refs/remotes/origin/master) git.exe config core.sparsecheckout # timeout=10 git.exe checkout -f a70858995d5557ae1483965072e2a66833f9979d Commit message: "Add project files." git.exe rev-list a70858995d5557ae1483965072e2a66833f9979d # timeout=10 [new 3] $ cmd /c call C:\WINDOWS\TEMP\jenkins5187263831491564261.bat
C:\Program Files (x86)\Jenkins\workspace\new 3>nuget restore MSBuild auto-detection: using msbuild version '15.3.409.57025' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\bin'. All packages listed in packages.config are already installed.
C:\Program Files (x86)\Jenkins\workspace\new 3>exit 0 Path To MSBuild.exe: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe Executing the command cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /p:VisualStudioVersion=12.0 WebApplication2.sln " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\new 3 [new 3] $ cmd.exe /C " chcp 1252 && C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe /p:VisualStudioVersion=12.0 WebApplication2.sln " && exit %%ERRORLEVEL%% Active code page: 1252 Microsoft (R) Build Engine version 4.7.2053.0 [Microsoft .NET Framework, version 4.0.30319.42000] Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. Build started 04/10/2017 19:16:39. Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" on node 1 (default targets). ValidateSolutionConfiguration: Building solution configuration "Debug|Any CPU". Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (2) on node 1 (default targets). Project file contains ToolsVersion="15.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please seehttp://go.microsoft.com/fwlink/?LinkId=291333. GenerateTargetFrameworkMonikerAttribute: Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj]Done Building Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (default targets) -- FAILED. Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.Tests\WebApplication2.Tests.csproj" (3) on node 1 (default targets). Project file contains ToolsVersion="15.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333. Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.Tests\WebApplication2.Tests.csproj" (3) is building "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (2:2) on node 1 (default targets). Project file contains ToolsVersion="15.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may have been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333. C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props(13,5): error : Microsoft.Net.Compilers is only supported on MSBuild v14.0 and above [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj] Done Building Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (default targets) -- FAILED. Done Building Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.Tests\WebApplication2.Tests.csproj" (default targets) -- FAILED. Done Building Project "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" (default targets) -- FAILED.
Build FAILED.
"C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" (default target) (1) -> "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (default target) (2) -> (CoreCompile target) -> C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj]
"C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.sln" (default target) (1) -> "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2.Tests\WebApplication2.Tests.csproj" (default target) (3) -> "C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj" (default target) (2:2) -> (ValidateMSBuildToolsVersion target) -> C:\Program Files (x86)\Jenkins\workspace\new 3\packages\Microsoft.Net.Compilers.2.1.0\build\Microsoft.Net.Compilers.props(13,5): error : Microsoft.Net.Compilers is only supported on MSBuild v14.0 and above [C:\Program Files (x86)\Jenkins\workspace\new 3\WebApplication2\WebApplication2.csproj]
0 Warning(s) 2 Error(s)
Time Elapsed 00:00:00.37 Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure Finished: FAILURE