简体   繁体   中英

MSBuild web deploy issue when migrating to new server

Background:

New to MSBuild and MSDeploy
Trying to build out a new Jenkins build server based on existing live one
There are known differences between server that I'm trying to work through
I'm just trying to bring the pieces forward that are needed (cleansing the junk)
To me this doesn't look like a Jenkins related issue because if I run command outside of Jenkins it still fails
The MSBuild information is all pulled down from git (same as live) so I'm running the same thing in that regards
I realize my statements are rather loose if that is the right word to use
Hopefully you don't stop reading here, because I'll supply some specifics though the build process is large.
Sorry about the formatting. Lot of copy and paste that the editor doesn't seem to handle well.

Problem:

What is happening is on the new dev server I'm getting to the following section and it fails.

PipelineCopyAllFilesToOneFolderForMsdeploy:
Publish Pipeline Deploy phase Stage PipelineCopyAllFilesToOneFolderForMsdeploy
Package:
Invoking Web Deploy to generate the package with the following settings:
$(LocalIisVersion) is 8
$(DestinationIisVersion) is 8
$(UseIis) is False
$(IncludeIisSettings) is False
$(_DeploymentUseIis) is False
$(DestinationUseIis) is False
GetMSDeployInstalledVersionPath:
$(_DefaultMSDeployMaxVersion) is 3
$(_MSDeployVersionsToTry) is 9.0
$(MSDeployPath) is C:\\Program Files\\IIS\\Microsoft Web Deploy V3\\
GenerateMsdeployManifestFiles:
Generate source manifest file for Web Deploy package/publish ...
PackageUsingManifest:
Packaging into D:\\workspace\\1002\\MSDeploy.
Starting Web deployment task from source:
manifest(D:\\workspace\\1002\\MSDeploy.SourceManifest.xml) to Destination: package(D:\\workspace\\1002\\MSDeploy).
C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\Web\\Microsoft.Web.Publishing.targets(4007,5): error : Web deployment task failed. (Package file 'D:\\workspace\\1002\\MSDeploy' does not have a .zip file name extension.) [D:\\workspace\\1002\\Site\\Integration\\Integration.csproj]
Package failed.
Done Building Project "D:\\workspace\\1002\\Site\\Integration\\Integration.csproj" (default targets) -- FAILED.

Here is that same section from our live Jenkins server for the same job.

PipelineCopyAllFilesToOneFolderForMsdeploy:
Publish Pipeline Deploy phase Stage PipelineCopyAllFilesToOneFolderForMsdeploy
Package:
Invoking Web Deploy to generate the package with the following settings:
$(LocalIisVersion) is 8
$(DestinationIisVersion) is 8
$(UseIis) is False
$(IncludeIisSettings) is False
$(_DeploymentUseIis) is False
$(DestinationUseIis) is False
Creating directory "D:\\workspace\\1002\\MSDeploy\\" .
GetMSDeployInstalledVersionPath:
$(_DefaultMSDeployMaxVersion) is 3
$(_MSDeployVersionsToTry) is 9.0
$(MSDeployPath) is C:\\Program Files\\IIS\\Microsoft Web Deploy V3\\
GenerateMsdeployManifestFiles:
Generate source manifest file for Web Deploy package/publish ...
PackageUsingManifest:
Packaging into D:\\workspace\\1002\\MSDeploy\\Integration.zip.
Starting Web deployment task from source:
manifest(D:\\workspace\\1002\\MSDeploy\\Integration.SourceManifest.xml) to Destination: package(D:\\workspace\\1002\\MSDeploy\\Integration.zip). Adding sitemanifest (sitemanifest). Adding IIS Application (D:\\workspace\\1002\\Site\\Integration\\obj\\Release\\Package\\PackageTmp) Creating application (D:\\workspace\\1002\\Site\\Integration\\obj\\Release\\Package\\PackageTmp)

You will notice the this one has one more value that the failing one doesn't:

Creating directory "D:\\workspace\\1002\\MSDeploy\\".

Additionally if I work my way back up through the build log I notice this significant difference.

Dev server

ValidateGlobalPackageSetting:
$(PackageAsSingleFile) is True
$(PackageFileName) is D:\\workspace\\1002\\MSDeploy. Validating...

Live server (working)

ValidateGlobalPackageSetting:
$(PackageAsSingleFile) is True
$(PackageFileName) is D:\\workspace\\1002\\MSDeploy\\Integration.zip. Validating...

I'm hoping by these differences and the error someone might have experienced this and knows where to point me to on the differences between the servers.

Here are some versions to note:

Windows
Both running Windows 2012 R2

MSBuild is being run throughout the build process from C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319
The file version is 4.7.3062.0
It is the same version on dev and live (working).
One thing is the live server doesn't show .NET 4.7 in Programs and Features though there install packages there that I sued to get 4.7 on dev. It is almost like the MSBuild was manually copied to live at some point. Or does this mean it came from VS install? Again dev and live msbuild versions are the same on both servers. New Dev fails. Live works.

Web
In Program and Features
Microsoft Wed Deploy 3.5 3.1237.1764
Web Deployment Tool 1.1.0618

.NET

dev

C:\\Users\\ccnet_new>wmic product where "Name like 'Microsoft .Net%'" get Name, Version
Name Version
Microsoft .NET Framework 4.5.1 Multi-Targeting Pack 4.5.50932
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack (ENU) 4.5.51209
Microsoft .NET Framework 4.6.1 SDK 4.6.01055
Microsoft .NET Framework 4.5 Multi-Targeting Pack 4.5.50710
Microsoft .NET Framework 4.7 SDK 4.7.02053
Microsoft .NET Framework 4.5.1 Multi-Targeting Pack (ENU) 4.5.50932
Microsoft .NET Framework 4.6.2 SDK 4.6.01590
Microsoft .NET Framework 4.7 Targeting Pack (ENU) 4.7.02053
Microsoft .NET Framework Cumulative Intellisense Pack for Visual Studio (ENU) 4.7.02558
Microsoft .NET Framework 4 Multi-Targeting Pack 4.0.30319
Microsoft .NET Framework 4.5 SDK 4.5.50709
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack 4.5.51651
Microsoft .NET Framework 4.6.1 Targeting Pack 4.6.01055
Microsoft .NET Framework 4.6.2 Targeting Pack 4.6.01590
Microsoft .NET Framework 4.5.1 SDK 4.5.51641
Microsoft .NET Framework 4.6.2 Targeting Pack (ENU) 4.6.01590
Microsoft .NET Framework 4.7 Targeting Pack 4.7.02053
C:\\Users\\ccnet_new>

Live

C:\\Users\\CCNET_NEW>wmic product where "Name like 'Microsoft .Net%'" get Name, Version
Name Version
Microsoft .NET Framework 4.5.1 Multi-Targeting Pack 4.5.50932
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack (ENU) 4.5.51209
Microsoft .NET Framework 4.6.1 SDK 4.6.01055
Microsoft .NET Framework 4.5 Multi-Targeting Pack 4.5.50710
Microsoft .NET Framework 4.5.1 Multi-Targeting Pack (ENU) 4.5.50932
Microsoft .NET Core Host FX Resolver - 2.0.9 (x64) 16.36.26615
Microsoft .NET Core Host - 2.0.6 (x86) 16.24.26212
Microsoft .NET Core Host FX Resolver - 2.0.6 (x64) 16.24.26212
Microsoft .NET Framework 4.6.2 SDK 4.6.01590
Microsoft .NET Framework Cumulative Intellisense Pack for Visual Studio (ENU) 4.7.02558
Microsoft .NET Core Runtime - 2.0.6 (x64) 16.24.26212
Microsoft .NET Core Host - 2.0.6 (x64) 16.24.26212
Microsoft .NET Framework 4 Multi-Targeting Pack 4.0.30319
Microsoft .NET Framework 4.5 SDK 4.5.50709
Microsoft .NET Framework 4.5.2 Multi-Targeting Pack 4.5.51651
Microsoft .NET Framework 4.6.1 Targeting Pack 4.6.01055
Microsoft .NET Framework 4.6.2 Targeting Pack 4.6.01590
Microsoft .NET Core Runtime - 2.0.9 (x64) 16.36.26615
Microsoft .NET Core Host - 2.0.9 (x64) 16.36.26615
Microsoft .NET Core Host FX Resolver - 2.0.6 (x86) 16.24.26212
Microsoft .NET Framework 4.5.1 SDK 4.5.51641
Microsoft .NET Core Runtime - 2.0.6 (x86) 16.24.26212
Microsoft .NET Framework 4.6.2 Targeting Pack (ENU) 4.6.01590
Microsoft .NET Core SDK - 2.1.202 (x64) 8.50.40411
C:\\Users\\CCNET_NEW>

The .NET core stuff I wouldn't think should matter (Update I installed and still didn't fix). The Intellisense shouldn't. So that leaves the 4.5 targeting. The rest should match up.
Update 4.5 targeting is there just hidden as system component

changed reference to Microsoft.cpp. Can anything in the c:\\Program Files(x86)\\MSBuild folder have anything to do with my issue. The look the same between both servers. Just saw some postings on this and was not sure.

Dev doesn't have files in the v4.0 folder and all the files are in V4.0\\V110 folder (prop files, target files, etc).

Finally Regedit for cpp

Live has VCTargetPath in v4.0 folder.

Dev does not have VCTargetPath in V4.0 folder.

There is so much more to the server and build process but I'm hoping this information will allow enough that someone might be able to help me.

In summary build on our live server works. Build on the new dev server I'm trying to build up does not work. There are pieces still different between the servers that seem like they shouldn't matter and I know that is not a great thing to say. Things like one has Java on it the other doesn't but but that is all around Jenkins. We don't have java stuff in our software. Things like differences in SSDT but my schema files get run against the DB fine so that shouldn't matter. I know I"m probably overlooking something. Hopefully someone can point me in that direction.

I should have also added that if I leave all file system structure in place after the failed build and go to the the command line and run:

D:\\workspace\\1002>c:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\MSBuild.exe "d:\\workspace\\1002\\Site\\Integration\\Integration.csproj" /target:package

It builds an Integrations.zip file, .deploy, .cmd file, etc in the folder d:\\workspace\\1002\\site\\Integration\\obj\\Debug\\Package

When I'm running and it fails I'm doing msbuild below.

Path To MSBuild.exe:
C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\msbuild.exe Executing the command cmd.exe /C " chcp 1252 & C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\msbuild.exe /t:FullBuild /p:Configuration=Release;Platform=AnyCPU;SourceDir=D:\\workspace\\1002;DefineConstants=NONE;PatchLoaderSwitches=--noninteractive;Package=TRUE;InstallStartTime=20190222085726 j6.proj " && exit %%ERRORLEVEL%% from D:\\workspace\\1002
[1002] $ cmd.exe /C " chcp 1252 & C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\msbuild.exe /t:FullBuild /p:Configuration=Release;Platform=AnyCPU;SourceDir=D:\\workspace\\1002;DefineConstants=NONE;PatchLoaderSwitches=--noninteractive;Package=TRUE;InstallStartTime=20190222085726 j6.proj " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 4.7.3062.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 2/22/2019 8:58:12 AM.
Project "D:\\workspace\\1002\\j6.proj" on node 1 (FullBuild target(s)).
LoadFeatures:
Features:
Core
WebIntegration

Found that the C:\\Program Files (x86)\\MSBuild\\Microsoft\\VisualStudio\\v11.0\\Web\\Microsoft.WEb.Publishing.targets file on Live was more recent than the file on Dev. Tried the file out on the Dev and it worked.

Not sure if I need to copy over more files from that location or not. Also assuming there was some sort of windows update that changed this file or someone manually copied it in on Live.

Old file was dated 6/26/2012. New file was dated 9/19/2013.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM