MSBuild Warning MSB3884 when building from command line - jenkins

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"

Related

Delphi MSBuild.exe error MSB4057 but can use IDE build project

I use Delphi XE4 on Windows7 and use Microsoft.NET/Framework/V3.5/MSBuild.exe .
I have added the MSBuild path to the environment variable.
But got this error :(
$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug
Microsoft (R) Build Engine Version 3.5.30729.5420
[Microsoft .NET Framework, Version 2.0.50727.8762]
Copyright (C) Microsoft Corporation 2007. All rights reserved.
Build started 2017/10/30 ▒W▒▒ 10:45:40.
Project "C:\DXE4_LangDLL\Project3.dproj" on node 0 (Build target(s)).
C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.
Done Building Project "C:\DXE4_LangDLL\Project3.dproj" (Build target(s)) -- FAILED.
Build FAILED.
"C:\DXE4_LangDLL\Project3.dproj" (Build target) (1) ->
C:\DXE4_LangDLL\Project3.dproj : error MSB4057: The target "Build" does not exist in the project.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.00
I tried use Microsoft.NET/Framework/V2.0.50727/MSBuild.exe and got the same message.
I was confuse because used Delphi IDE to build project successfully.
Can someone help me?
You have to set first the environmental variables. There is a batch file, at the path
C:\Program Files (x86)\Embarcadero\Studio\XX\rsvars.bat
that i use for command-line batch files, where XX the version of your RAD Studio.
I am not sure if it will work for Git bash as it is, but you can create a batch file that will combine the lines of rsvars.bat and the MSBuild line, and execute it
Something like:
#SET BDS=C:\Program Files (x86)\Embarcadero\Studio\XX
#SET BDSINCLUDE=C:\Program Files (x86)\Embarcadero\Studio\XX\include
#SET BDSCOMMONDIR=C:\Users\Public\Documents\Embarcadero\Studio\XX
#SET FrameworkDir=C:\Windows\Microsoft.NET\Framework\v3.5
#SET FrameworkVersion=v3.5
#SET FrameworkSDKDir=
#SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files (x86)\Embarcadero\Studio\XX\bin;C:\Program Files (x86)\Embarcadero\Studio\XX\bin64;C:\Users\Public\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof;%PATH%
#SET LANGDIR=EN
#SET PLATFORM=
#SET PlatformSDK=
$MSBuild.exe Project3.dproj /target:Build /property:configutation=Debug

xcopy /s /y "$(SolutionDir)packages\Apache.Ignite.1.6.0\Libs\*.*" "$(TargetDir)Libs" error while building in jenkins

Hello All,
while building Visual project project from jenkins am getting below error i have set msbuild plugin and set path in jenkins.
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command " [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: if not exist "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" md "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*" "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs"" exited with code 4. [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj]
Done Building Project "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default target) (1) ->
(ResolveAssemblyReferences target) ->
According to the error log:
error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*"
You can find $(SolutionDir) is Undefined.
That because you may build the a single project (NOT Solution) in jenkins. In this case, MSBuild running each project independently not the Solution, so MSBuild could not find the define for $(SolutionDir). It worked fine in Visual Studio, but not on the build server.
To resolve this issue, you can use $(ProjectDir)..\ instead of $(SolutionDir)
So the command line should be:
if not exist "$(TargetDir)Libs" md "$(TargetDir)Libs"
xcopy /s /y "$(ProjectDir)..\packages\Apache.Ignite.2.2.0\Libs\*.*" "$(TargetDir)Libs"
But, I found the command line in the error log is not same as in the title, so you may need to double check the command line.
Hope this helps.

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>

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*

Program compiles fine in the IDE but does not compile on the command line

I'm having some trouble with one of my builds. I'm using Jenkins to build a builderXE project but I'm getting the following errors.
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TSQLQuery::~TSQLQuery()' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TCustomSQLDataSet::~TCustomSQLDataSet()' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unresolved external '__fastcall Sqlexpr::TCustomSQLDataSet::ParamByName(const System::UnicodeString)' referenced from C:\JENKINS\WORKSPACE\project\STRINGLOOKUPFRMCODE.OBJ
C:\Program Files\Embarcadero\RAD Studio\8.0\Bin\CodeGear.Cpp.Targets(2341,5): error : Error: Unable to perform link
I read that paths could be fixed by using rsvars.bat but when I tried that nothing happens. This is what I tried.
"C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat" MSBuild "/t:Clean;Build" "/p:config=Release" "C:\jenkins\workspace\project\myProject.cbproj"
The project compiles with no problems in builderXE but when I uses Jenkins, or just the command line I get these errors. What do I need to do to get this to work again.
UPDATE: I have updated my post with the script I'm using.
set PATH="C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\release;C:\Program Files\Embarcadero\RAD Studio\8.0\bin;C:\Documents and Settings\All Users\Documents\RAD Studio\8.0\Bpl;C:\Program Files\Embarcadero\RAD Studio\7.0\bin;C:\Documents and Settings\All Users\Documents\RAD Studio\7.0\Bpl;C:\PROGRA~1\Serena\vm\win32\bin;C:\PROGRA~1\Serena\vm\common\bin\win32;C:\PROGRA~1\Borland\CBUILD~1\Projects\Bpl;C:\PROGRA~1\Borland\CBUILD~1\Bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Wave Systems Corp\Dell Preboot Manager\Access Client\v5\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\tmssoftware\TMS Component Pack\bpl\;C:\Program Files\SmartBear\Automated Build Studio\bin;C:\Program Files\Mercurial;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\borland\CBuilder5\Bin;C:\Program Files\Embarcadero\RAD Studio\8.0\bin;C:\Program Files\Embarcadero\RAD Studio\7.0\bin;%IMPLIB%;%ADV%\x86;C:\Program Files\TortoiseHg\;C:\Python26;C:\Program Files\Embarcadero\RAD Studio\8.0\lib\win32\debug;"
call "C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
MSBuild "C:\jenkins\workspace\project\myProject.cbproj" "/t:Clean;Build" "/p:config=Release"
In Jenkins, are you using the "Execute Windows Batch Command" to make these calls?
If so, try this:
call "C:\Program Files\Embarcadero\RAD Studio\8.0\bin\rsvars.bat"
MSBuild "/t:Clean;Build" "/p:config=Release" "C:\jenkins\workspace\project\myProject.cbproj"
The call command will run the batch file and set all the environment variables in the current session. These will then be available to your MSBuild call.
Also make sure that any dlls you need are in the current %PATH%. You can do this by:
set PATH=<your_dll_path_here>;%PATH%
This should be done right in the beginning.

Resources