MSBuild never deploys no matter its arguments - tfs

This is related to a question I asked yesterday but is probably best asked separately.
I have a TFS 2010 server running a build of a .csproj file, and an IIS6 box with msdeploy installed on it. I want to get the build automatically published by the build, but it never tries to run the publish no matter what I send into its parameters. I can put DeployTarget=TotalCarp and it still runs without error, but does not attempt to publish.
Heres the section of log from the build that is relevant:
Run MSBuild for Project
Initial Property Values
AdditionalVCOverrides =
CommandLineArguments = /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=TotalCarp /p:MsDeployPublishMethod=RemoteAgent /p:DeployIisAppPath="WebRoot/ExternalContractSupportWeb" /p:MsDeployServiceUrl=whatever /p:AllowUntrustedCertificated=True /p:UserName=Username /p:Password=Password
Configuration = Test
GenerateVSPropsFile = True
LogFile =
LogFileDropLocation = \g10svhudtfs\TFSBuilds\ExternalContractSupport\TestBuild\TestBuild_20101101.25\logs
MaxProcesses = 1
OutDir = C:\Builds\1\CustomerTerms\TestBuild\Binaries
Platform = Any CPU
Project = C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj
ResponseFile =
RunCodeAnalysis = AsConfigured
Targets =
TargetsNotLogged = String[] Array
ToolPath =
ToolPlatform = Auto
Verbosity = Diagnostic
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj" /m:1 /fl /flp:"logfile=C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.log;encoding=Unicode;verbosity=diagnostic" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=TotalCarp /p:MsDeployPublishMethod=RemoteAgent /p:DeployIisAppPath="WebRoot/ExternalContractSupportWeb" /p:MsDeployServiceUrl=whatever /p:AllowUntrustedCertificated=True /p:UserName=Username /p:Password=Password /p:OutDir="C:\Builds\1\CustomerTerms\TestBuild\Binaries\" /p:Configuration="Test" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\1\CustomerTerms\TestBuild\Sources\ExternalContractSupportWeb\ExternalContractSupportWeb.csproj.Any CPU.Test.vsprops" /dl:WorkflowCentralLogger,"D:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;BuildUri=vstfs:///Build/Build/49;InformationNodeId=5798;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://g10svhudtfs:8080/tfs/TFSCollection;"*WorkflowForwardingLogger,"D:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;"
Everything I've found on the web has at least an error code but this looks as though its worked but is obviously making no attempt to even try and deploy anything?

I just looked at this more and this will be the behavior you get if the files at %Program Files32%\MSBuild\Microsoft\VisualStudio\v10.0\Web are not on the machine. The reason for this is because the Web Application Project imports the file <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" /> which is installed by Team Build, then that file contains the import <Import Project="..\Web\Microsoft.Web.Publishing.targets" Condition="Exists('..\Web\Microsoft.Web.Publishing.targets')" /> which contains the logic for the Web Publishing Pipeline (WPP). Which are the targets which read DeployTarget, BuildOnDeploy, etc. The fact that the import is conditional is the reason that you are not getting an error. I am going to ask the dev why its conditional.

Related

TFS 2018 - Building pre-release packages

I'm using "TFS 2018 Update 2" and trying to build a package marked as a pre-release according to the microsoft semantic
I tried using the .nuspec file inserting the (ex: 1.0.0-beta and changing the Build number format as: $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)$(Suffix)
setting the $(Suffix) variable at queue time.
Every attempt failed: the package never contains the suffix, than is never marked as pre-release.
I see that the nuget pack command never contains the suffix (missing "-beta" after "2018.6.12.9"). In my test build $Suffix is set to "-beta":
nuget.exe pack
C:\agent_work\4\s\DotNetClassicLibrary\DotNetClassicLibrary.csproj
-NonInteractive -OutputDirectory C:\agent_work\4\a -Properties Configuration=debug -version 2018.6.12.9 -Verbosity Detailed
The Build task on TFS is:
"DotNetClassicLibrary / Build DotNetClassicLibrary_2018.6.12.9-beta /
Job / NuGet pack"
So I'm sure that the variable is assigned because of the presence of the suffix "-beta" in the path.
Here there is the configuration of the nuget pack task
This is the Build number format
I could reproduce your scenario on my side. In my opinion, Nuget pack task with build number doesn't support character or numbers. You may check this task and try to modify it.
case "byBuildNumber":
tl.debug("Getting version number from build number")
if(tl.getVariable("SYSTEM_HOSTTYPE") === "release")
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_AutomaticallyVersionReleases"));
return;
}
let buildNumber: string = tl.getVariable("BUILD_BUILDNUMBER");
tl.debug(`Build number: ${buildNumber}`);
let versionRegex = /\d+\.\d+\.\d+(?:\.\d+)?/;
let versionMatches = buildNumber.match(versionRegex);
if (!versionMatches)
{
tl.setResult(tl.TaskResult.Failed, tl.loc("Error_NoVersionFoundInBuildNumber"));
return;
}
if (versionMatches.length > 1)
{
tl.warning(tl.loc("Warning_MoreThanOneVersionInBuildNumber"))
}
version = versionMatches[0];
break;
As an alternative, you could choose Nuget custom, and specify the
pack command there with parameter -version $(Build.BuildNumber),
I've tried on my side, this works.

Test build step in TFS 2017 does not appear to run

I have been setting up build configurations in TFS 2017.
As part of the build configuration I have Test steps.
When the build runs the test steps seems to run without error.
I committed some code in with a test I set to fail, to make sure that TFS stopped the build in the event tests fail. I queued a new build and then surprisingly the build completed with no issue.
I am having this issue on full framework libraries, that are being packaged into NuGet packages and also having it with .net core projects.
On evaluating the log for the test step I see the following messages.
These are from a .Net Core build
The build log
The build step for a core project
These ones are from a full framework build config
The build log for full framework
##[section]Starting: Test Assemblies **\*test*.dll;-:**\obj\**
==============================================================================
Task : Visual Studio Test
Description : Run tests with Visual Studio test runner
Version : 1.0.85
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkId=624539)
==============================================================================
Preparing task execution handler.
Executing the powershell script: c:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\1.0.85\VSTest.ps1
Testing container: 'REGISTRY::HKEY_CLASSES_ROOT\CLSID\{177F0C4A-1CD3-4DE7-A32C-71DBBB9FA36D}'
Exists.
Adding Visual Studio setup helpers.
Getting Visual Studio setup instances.
Found 2 instances.
Description : Supports running automated tests and load tests remotely
DisplayName : Visual Studio Test Agent 2017
Id : 0f053fb9
InstallDate : System.Runtime.InteropServices.ComTypes.FILETIME
Name : VisualStudio/15.2.0+26430.6
Path : C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent
Version : 15.0.26430.6
VersionString : 15.0.26430.6
Description : Microsoft DevOps solution for productivity and coordination
across teams of any size
DisplayName : Visual Studio Enterprise 2017
Id : e4f83d45
InstallDate : System.Runtime.InteropServices.ComTypes.FILETIME
Name : VisualStudio/15.4.0+27004.2002
Path : C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
Version : 15.4.27004.2002
VersionString : 15.4.27004.2002
Testing leaf: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'
Exists.
Working folder: c:\agent\_work\11\s
Executing C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "c:\agent\_work\11\s\*******.EDI\*******.EDI.Tests\bin\Release\*******.EDI.Tests.dll" "c:\agent\_work\11\s\*******.EDI\*******.EDI\packages\FluentAssertions.4.19.4\lib\sl5\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\netstandard1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll" "c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll" /EnableCodeCoverage /logger:trx /TestAdapterPath:"c:\agent\_work\11\s"
Microsoft (R) Test Execution Command Line Tool Version 15.0.26228.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Warning: Using Isolation mode to run the tests as diagnostic data adapters were enabled in the runsettings. Use the /inIsolation parameter to suppress this warning.
Warning: Unable to load types from the test source 'c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Input string was not in a correct format.
Warning: Unable to load types from the test source 'c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll'. Some or all of the tests in this source may not be discovered.
Warning: No test is available in c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hans\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ru\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\tr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\uap10.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\netstandard1.0\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\dotnet\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\netcoreapp1.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\uap10.0\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\zh-Hant\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\cs\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\de\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\es\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\fr\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pt\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ja\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\ko\Microsoft.VisualStudio.TestPlatform.TestFramework.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.TestFramework.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\pl\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\it\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.resources.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestFramework.1.1.11\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll c:\agent\_work\11\s\*******.EDI\*******.EDI.Tests\bin\Release\*******.EDI.Tests.dll c:\agent\_work\11\s\*******.Web\*******.Web\packages\MSTest.TestAdapter.1.1.11\build\_common\Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll c:\agent\_work\11\s\*******.EDI\*******.EDI\packages\FluentAssertions.4.19.4\lib\sl5\Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
Attachments:
c:\agent\_work\11\s\TestResults\e806ae8a-20fe-40d7-956e-90b827a56c83\Dwainwright_ASSODOPDV01 2017-10-23 15_39_33.coverage
Information: Additionally, you can try specifying '/UseVsixExtensions' command if the test discoverer & executor is installed on the machine as vsix extensions and your installation supports vsix extensions. Example: vstest.console.exe myTests.dll /UseVsixExtensions:true
##[warning]No results found to publish.
##[section]Finishing: Test Assemblies **\*test*.dll;-:**\obj\**
The Build Step for full framework
How can i set up TFS so that the tests are actually ran, and more so, the build stops if any test fails.
Further info:
I have VS 2017 installed on the build server too.
The tests are written in NUnit. Not sure if something else needs adding to the build server. Almost looks as though the build server is trying to use MSTest; i see some references to MSTestAdapter
VSTest task cannot run .NET core tests as it uses the Test platform version 1. To run .NET core tests, we recommend using the .NET core task with the test command.
Reference https://github.com/Microsoft/vsts-tasks/issues/5066
As a workaroun you can manually invoke vstest.console.exe from folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\ and provide /Framework:FrameworkCore10.
C:\Program Files (x86)>dir vstest.console.exe /s
Volume in drive C is Windows
Volume Serial Number is 0835-B24B
Directory of C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Com
mon7\IDE\CommonExtensions\Microsoft\TestWindow
10/24/2017 02:55 PM 137,824 vstest.console.exe
1 File(s) 137,824 bytes
Directory of C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Com
mon7\IDE\Extensions\TestPlatform
09/04/2017 12:09 PM 133,240 vstest.console.exe
1 File(s) 133,240 bytes
Reference https://github.com/Microsoft/vstest/issues/579#issuecomment-339263411
UPDATE:
Make sure you are not missing and dependancies.
Check the packages.config, it should be similar as below:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.1.11" targetFramework="net452" />
<package id="MSTest.TestFramework" version="1.1.11" targetFramework="net452" />
</packages>

MSBuild Warning MSB3884 when building from command line

When building our solution on the build server (using Jenkins) with MSBuild 14 following warning occurs:
C:\Program Files
(x86)\MSBuild\14.0\bin\Microsoft.VisualBasic.CurrentVersion.targets(133,9):
warning MSB3884: ruleset file "ManagedMinimumRules.ruleset" could not
be found.
Executing the same command line call on my dev machine, this warning won't appear.
Any ideas why this warning appears on the build server?
I've already opened an issue for MSBuild: https://github.com/Microsoft/msbuild/issues/361
Solution: Create an empty rule set file and pass that as a command line parameter to MSBuild.
NoRules.ruleset file:
<?xml version="1.0" encoding="utf-8"?>
<!--
Problem: warning MSB3884
Visual Studio 2015 includes references to MinimumRecommendedRules.ruleset in .csproj files.
MSBuild 10 cannot find this reference and generates warning MSB3884.
Solution: Create NoRules.ruleset [this file] and pass it to MSBuild in a command switch. Need to pass full path name to MSBuild.
Example: MSBuild /property:CodeAnalysisRuleSet="$Workspace\NoRules.ruleset"
References:
https://msdn.microsoft.com/en-us/library/dd264949.aspx
https://msdn.microsoft.com/en-us/library/ms164311.aspx
-->
<RuleSet Name="NoRules" Description="This rule set contains no rules." ToolsVersion="14.0">
</RuleSet>
For a Jenkins build, add the following MSBuild switch to override the project settings and use the NoRules file:
/property:CodeAnalysisRuleSet="$Workspace\NoRules.ruleset"
You can just add the NoRules file to source control. I chose to build it on the fly in Jenkins with a Batch file prior to the MSBuild step:
set NoRules=NoRules.ruleset
#echo Making %NoRules%
if not exist %NoRules% (
#echo ^<?xml version="1.0" encoding="utf-8"?^> >%NoRules%
#echo ^<!-- >>%NoRules%
call :WriteToFile %NoRules% "Problem: warning MSB3884"
call :WriteToFile %NoRules% " Visual Studio 2015 includes references to MinimumRecommendedRules.ruleset in .csproj files."
call :WriteToFile %NoRules% " MSBuild 10 cannot find this reference and generates warning MSB3884."
#echo. >>%NoRules%
call :WriteToFile %NoRules% "Solution: Create NoRules.ruleset [this file] and pass it to MSBuild in a command switch."
call :WriteToFile %NoRules% " Need to pass full path name to MSBuild."
#echo Example: MSBuild /property:CodeAnalysisRuleSet="$WORKSPACE\NoRules.ruleset" >>%NoRules%
#echo. >>%NoRules%
call :WriteToFile %NoRules% "References:"
call :WriteToFile %NoRules% " https://msdn.microsoft.com/en-us/library/dd264949.aspx"
call :WriteToFile %NoRules% " https://msdn.microsoft.com/en-us/library/ms164311.aspx"
#echo --^> >>%NoRules%
#echo ^<RuleSet Name="NoRules" Description="This rule set contains no rules." ToolsVersion="14.0"^> >>%NoRules%
#echo ^</RuleSet^> >>%NoRules%
)
exit /b %errorlevel%
:WriteToFile
#echo %~2 >>%1
exit /b %errorlevel%
This file also shows the comments in the Jenkins ConsoleOut display. This should help you know what why you did this later.
related: VS2015: warning MSB3884: Could not find rule set file
Check your csproj has a DevEnvDir and not a path to VS (esp vs2010). I reckon your laptop's got the appropriate VS installed and your build server doesn't.
<CodeAnalysisRuleSet>ManagedMinimumRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;$(DevEnvDir)\..\..\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
Create the following folder on your build server:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\Rule Sets
Copy all of your ruleset files from your dev machine onto the build server.
Then add the following registry key by creating a "addkey.reg" file with the following contents:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\Setup\EDev]
"StanDir"="C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Team Tools\\Static Analysis Tools\\"
Run it on your build server, reboot, done, warning gone.
Add this property to the msbuild command:
CodeAnalysisRuleSetDirectories="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Static Analysis Tools\Rule Sets".
For example, I used this command
>"C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild" solutionName.sln /target:build /property:Configuration=Release;CodeAnalysisRuleSetDirectories="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Team Tools\Static Analysis Tools\Rule Sets"

Build on TFS 2013 failed but okay locally

When I checked in the code, TFS 2013 built the solution automatically. It is okay in local VS 2013 but failed in TFS.
Here is the summary.
Summary
FTPProcessor | Any CPU
1 error(s), 56 warning(s)
$/xxxx/NewServiceHost/New-Branch/NewServiceHost/packageRestore.proj - 0 error(s), 0 warning(s)
$/xxxx/NewServiceHost/New-Branch/GenericWindowsServices.sln - 1 error(s), 56 warning(s)
C:\Builds\1\xxxx\FTP Processor (New)\src\.nuget\nuget.targets (71): The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll". Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\12.0\bin\amd64\Microsoft.Build.Tasks.v4.0.dll' or one of its dependencies. The system cannot find the file specified.
Other Errors
1 error(s)
Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Your TFS 2013 build server is using MSBuild 12.0 where CodeTasksFactory exists in Microsoft.Build.Tasks.v12.0.dll rather than Microsoft.Build.Tasks.v4.0.dll.
Ideally you should be doing the following:
1) Open your NuGet.targets file:
C:\Builds\1\xxxx\FTP Processor (New)\src.nuget\nuget.targets
2) Identify the task referencing the old DLL.
<UsingTask AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory" >
...
3) Then future proof it like so:
<UsingTask AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v$(MSBuildToolsVersion).dll" TaskFactory="CodeTaskFactory" >
...
As of VS2013,
you should be running MSBuild from C:\Program Files (x86)\MSBuild\12.0\Bin\
not from C:\Windows\Microsoft.NET\Framework64\v4.0.30319. See
http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx
source:http://gyorgybalassy.wordpress.com/2013/12/31/msb4175-the-task-factory-codetaskfactory-could-not-be-loaded/
it solved the issue for me.
After much research and trying a bunch of "hacks" I went on to understand the exact mechanics of nuget restore. It turns out, everything has changed since nuget 2.7+ and you're no longer required to include ".nuget" folder and the associated nuget.exe and nuget.target
To fix my build process and use the latest recommended approach, I did the following:
Move nuget.config to be with .sln file same folder path
Delete ".nuget" folder entirely
Delete references to that folder in .sln file
Delete following lines from any .csproj file
--
<RestorePackages>true</RestorePackages>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
--
This could take some time if your project solution has many files or you work on many projects built with Visual Studio 2013 and before.
The good news is, there's a powershell script that applies the above recursively on any folder:
https://github.com/owen2/AutomaticPackageRestoreMigrationScript/blob/master/migrateToAutomaticPackageRestore.ps1
In short, it reverses "Enable Nuget Package Restore", allowing the
newer package restore method to work.
In Visual Studio 2013, automatic package restore became part of the
IDE (and the TFS build process). This method is more reliable than the
older, msbuild integrated package restore. It does not require you to
have nuget.exe checked in to each solution and does not require any
additional msbuild targets. However, if you have the files related to
the old package restore method in your project, Visual Studio will
skip automatic package restore. (This behavior is likely to change
soon, hopefully it does).
You can use this script to remove nuget.exe, nuget.targets, and all
project and solution references to nuget.targets so you can take
advantage of Automatic Package Restore. It more or less automates the
process described here.
It will recurse through the directory you run the script from and do
it to any solutions that may be in there somewhere. Be careful and
have fun! (not responsible for anything that breaks)
A couple of good links on the subject:
http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
http://docs.nuget.org/consume/package-restore/migrating-to-automatic-package-restore
I had a similar issue. We are forced into using the older msbuild that comes with the framework, rather than the v14 version that comes with visual studio 2015 because we build some old Delphi.net code. Our vcxproj files are triggering some automatic code analysis target which has a task that relies on Microsoft.Build.Tasks.v12.0.dll. I was able to override that task by copying and pasting it into the top of the vcxproj and tweaking the path to the dll. The original task can be found in "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.Targets". So, in other words, you might be able to override the problem task in your project.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- override a task which we can't use with the old msbuild -->
<UsingTask TaskName="SetEnvironmentVariable" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<EnvKey ParameterType="System.String" Required="true" />
<EnvValue ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Environment.SetEnvironmentVariable(EnvKey, EnvValue, System.EnvironmentVariableTarget.Process);
}
catch {
}
]]>
</Code>
</Task>
</UsingTask>

Use MSDeploy to copy buildresult to targetserver

There is a webproject with a batchfile that generates all files needed on the targetserver and puts them in a folder "/Deployable" .
The batch file is quite involved because the project contains a pluginsystem and all plugins need to be copied to a certain location.
When I use webdeploy to deploy to the targetserver it happens what you expect: there are some of the needed assemblies copied over, but not the files as specified in the batchfile.
My plan is now to first execute the batchfile and then use webdeploy to copy the folder "/Deployable" to the targetserver. Can this be done with webdeploy?
This is what I see in Visual Studio deploy menue:
This is the resulting publish profile
<?xml version="1.0" encoding="utf-8"?> <publishData>
<publishProfile publishUrl="http://myserver/msdeployagentservice"
deleteExistingFiles="False"
ftpAnonymousLogin="False"
ftpPassiveMode="True"
msdeploySite="mysite/"
msdeploySiteID=""
msdeployRemoteSitePhysicalPath=""
msdeployAllowUntrustedCertificate="False"
msdeploySkipExtraFilesOnServer="False"
msdeployMarkAsApp="False"
profileName="publish_to_myserver"
publishMethod="MSDeploy"
replaceMatchingFiles="True"
userName="myuser"
savePWD="True" userPWD="xxx" SelectedForPublish="True" />
</publishData>>
I think there is an ability to add third-party files into webdeploy package by modifying .csproj file, however, I have never had to use it.
Alternatively, you can easily achieve the same result by using MSDeploy's command-line client and its sync verb, by specifying your /Deployable folder as the -source argument and your target server's msdeploy service as the -dest, e.g.:
$(WebDeployToolPath)\msdeploy -verb:sync -source:dirPath='Deployable\' -dest:dirPath='$(DeployDirectoryLocalPath)',computerName=$(DeployTargetURL),userName='$(DeployUserName)',password='$(Password)',authType='Basic' -verbose -allowUntrusted
Substitutions:
$(WebDeployToolPath) - full path to folder with msdeploy executable (e.g. c:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe )
Deployable\ - full path to the folder you wnat to copy to the target server.
$(DeployDirectoryLocalPath) - full local path to the target folder on the target server.
$(DeployTargetURL) - web deploy service URL (e.g. https://192.168.142.55:8172/MsDeploy.axd or http://myserver/msdeployagentservice)
$(DeployUserName) - username to be used for deployment (should be admin for Win 2003)
$(Password) - user's password.
That's it - this command will synchronize Deployable\ folder with $(DeployDirectoryLocalPath) folder (i.e. make the content exactly match).
You can wrap it into an msbuild target in your .csproj file:
<PropertyGroup>
<DeployTargetURL Condition="'$(DeployTargetURL)'==''">https://192.168.142.55:8172/MsDeploy.axd</DeployTargetURL>
<DeployUserName Condition="'$(DeployUserName)'==''">tergetServer\Administrator</DeployUserName>
<Password Condition="'$(Password)'==''">AdminPassword</Password>
<WebDeployToolPath Condition="'$(WebDeployToolPath)'==''">c:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe</WebDeployToolPath>
<Target Name="Deploy">
<Exec Command=""$(WebDeployToolPath)"\msdeploy -verb:sync -source:dirPath='Deployable\' -dest:dirPath='$(DeployDirectoryLocalPath)',computerName=$(DeployTargetURL),userName='$(DeployUserName)',password='$(Password)',authType='Basic' -verbose -allowUntrusted " />
</Target>
And than run it from the command-line in the following way:
%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe MyProject.proj /t:Deploy*

Resources