安装了詹金斯的服务器上是否需要安装Visual Studio?

时间:2018-11-27 07:38:29

标签: c# jenkins msbuild

在为.net项目构建jenkins构建时,我遇到了错误。

C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

由于它正在尝试在服务器上找到服务器上不存在的Visual Studio文件夹。因此,必须在服务器上安装Visual Studio吗? 以下是我在詹金斯中获得的完整错误日志。

Building in workspace C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT
C:\Program Files\Git\bin\git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
C:\Program Files\Git\bin\git.exe config remote.origin.url https://bitbucket.org/pure-nmittal/timesheet/src/master/ # timeout=10
Fetching upstream changes from https://bitbucket.org/pure-nmittal/timesheet/src/master/
C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_ASKPASS to set credentials 
C:\Program Files\Git\bin\git.exe fetch --tags --progress https://bitbucket.org/pure-nmittal/timesheet/src/master/ +refs/heads/*:refs/remotes/origin/*
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
C:\Program Files\Git\bin\git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision 25e45ba269d04cb48a4d17090e391df08f73bedf (refs/remotes/origin/master)
C:\Program Files\Git\bin\git.exe config core.sparsecheckout # timeout=10
C:\Program Files\Git\bin\git.exe checkout -f 25e45ba269d04cb48a4d17090e391df08f73bedf
Commit message: "profile"
C:\Program Files\Git\bin\git.exe rev-list --no-walk 25e45ba269d04cb48a4d17090e391df08f73bedf # timeout=10
[Timesheet_UAT] $ powershell.exe -NonInteractive -ExecutionPolicy ByPass "& 'C:\Windows\TEMP\jenkins2437051443515371203.ps1'"
--Restoring Nuget packages BEGIN--
MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin\amd64'.
All packages listed in packages.config are already installed.
--Restoring Nuget packages END--
Path To MSBuild.exe: C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe
Executing the command cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:DeployOnBuild=true /p:PublishProfile=UAT "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT
[Timesheet_UAT] $ cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" /p:DeployOnBuild=true /p:PublishProfile=UAT "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 14.0.23107.0
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 11/27/2018 1:30:20 AM.
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Any CPU".
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (2) on node 1 (default targets).
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default targets) -- FAILED.
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (1) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (3) on node 1 (default targets).
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1097,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\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj]
Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (3) is building "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (2:2) on node 1 (default targets).
C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default targets) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default targets) -- FAILED.
Done Building Project "C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default targets) -- FAILED.

Build FAILED.

"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default target) (3) ->
(GetReferenceAssemblyPaths target) -> 
  C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1097,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\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj]


"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default target) (2) ->
  C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.


"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.sln" (default target) (1) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet.Tests\FleetPride.Timesheet.Tests.csproj" (default target) (3) ->
"C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj" (default target) (2:2) ->
  C:\Program Files (x86)\Jenkins\workspace\Timesheet_UAT\FleetPride.Timesheet\FleetPride.Timesheet\FleetPride.Timesheet.csproj(440,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

    1 Warning(s)
    2 Error(s)

Time Elapsed 00:00:00.21
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE

0 个答案:

没有答案