What do I need to install a Visual Studio 2010 (sln)-compatible Build Agent in TeamCity? - visual-studio-2010

I seem to be unable to install a build agent on our TeamCity 5.1.2 build server that is compatible with a VS2010 (sln) build configuration.
Under "Build Runners", the following runners are listed:
Ant: Runner for Ant build.xml files
Duplicates finder (.NET): C# and VB duplicate code finder
Command Line: Simple command execution
And under "Compatible configurations", the project I've configured to build with the Visual Studio 2010 (sln) build runner is listed under "Incompatible configurations".
To install the build agent, I'm simply running the .msi installation package, but it seems the default settings are not good enough. The build server machine has Visual Web Developer Express 2010 as well as .NET versions 2.0-4.0 installed, but no full version of VS. Do I need anything more?
(I have no experience whatsoever of building with msbuild scripts, so if I can I want to avoid having to do that.)

I think I figured it out:
Install the Windows SDK from Microsoft. Right now, the latest version is 7.1.
Note that since I just suddenly noticed that it worked, I don't know for certain that this is what did it - it might me completely irrelevant, but this is the only thing in my configuration I changed that I think could be relevant.

TeamCity build agent does not detect .NET 4.0 Client Profile as dotNetFramework4.0. Check you have full .NET Framework 4.0 installed.
Another reason of that is build agent has corrupted plugins. To fix it:
- stop agent
- remove /plugins, /system, /tools folders
- start agent
- wait till agent autoupgrade (agent service may be shown as stopped, just wait)

Related

Visual Studio Build Not Deploying Upon Build

I am trying to do a Visual Studio Build on TFS 2017. So far, it seems to do the build, but will not do the standard Publish/Deploy I am used to on my local file system, with the Precompiled WCF app, etc. This is what I have so far attached as images, and the PublishProfile I have switched to in desperation. They have VS 2017 installed on the build server, and have updated the MS Build to the latest version. Please help! :)
Visual Studio Build
VM Deploy XML
Check the build log to see whether the deployment executed.
Run the MSBuild command locally on the build agent machine to see whether it works.
Try the following arguments:
/p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:WebPublishMethod=FileSystem /p:publishUrl="$(build.artifactstagingdirectory)\\" /p:DeployDefaultTarget=WebPublish

Missing last version 2019 of visual studio on TFS build configuration [duplicate]

This question already has an answer here:
Team Foundation Server 2018 Build agent Capabilities VS 2019
(1 answer)
Closed 3 years ago.
In the configuration of build step in my TFS server (Version 16.131.27701.1), the version 2019 of visual studio is missing.
This version is installed on my build agents.
How to add this version in the select list of the msbuild step ?
VS2019 is not yet fully supported in vNext Build on tfs2018/2017.
Please first upgrade your build agent version to latest. As you can see in this link System Capabilities do not support VS2019 with prior build agent version.
Then you can try follow to jessehouwing's suggestion to install a newer version task. Details refer this question: Missing last version 2019 of visual studio on TFS build configuration
CAUTION this may cause issues when upgrading to another server version at a later stage, may require newer versions of the Azure Pipelines Agent and can put you in an unsupported state.
You can clone the Azure Pipelines Tasks repo, build it locally and then use tfx-cli to upgrade the built-in tasks in your server.
git clone https://github.com/Microsoft/azure-pipelines-tasks.git
cd azure-pipelines-tasks
npm install
npm run-script build --task MSBuildV1
npm run-script build --task VstestV2
npm run-script build --task VSBuildV1
npm install tfx-cli#latest -g
tfx build tasks upload --task-path .\MSBuildV2 --service-url {{https://server/tfs/collection}}
tfx build tasks upload --task-path .\VsTestV2 --service-url {{https://server/tfs/collection}}
tfx build tasks upload --task-path .\VsBuildV1 --service-url {{https://server/tfs/collection}}
Repeat for every Project Collection on your server.
Another workaround is using MSBuild task instead of Visual Studio Build Step, then specify the location of MSBuild 16.0, it should be:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe
Please take a look at this similar question: Team Foundation Server 2018 Build agent Capabilities VS 2019
I am on TFS 2017.3.
After installing VS2019 on one of my build servers and looking at the build agent capabilities I do not see VS2019 listed. I'm betting that you need to have Azure DevOps server installed in order to use it.

TFS Build Fails - Task could not find "AL.exe" using the SdkToolsPath

My TFS Build task in Windows Server 2012 R2 fails throwing the error as stated below
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets (2863, 5)
Task could not find "AL.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx40Tools-x86". Make sure the SdkToolsPath is set and the tool exists in the correct processor specific location under the SdkToolsPath and that the Microsoft Windows SDK is installed
Copied AL.exe from different location and pasted in C:\Program Files (x86)... as suggested here but it didn't solve my issue.
Install the Windows SDK from Microsoft site and/or configure RegEdit. This should work
For anyone out there, if you ware trying to update your Visual Studio Build Tools to newer version, make sure that "Build" task in tfs finds proper MSBuild folder- if agent that runs the build is old, it might not find new Visual Studio Build Tools. I just changed method of locating MSBuild from "Specyfic Version" to "Specyfic Path" in "Build" and pointed to new VS Build Tools

Why am I getting "File type is not supported" on TeamCity 9 when using NUnit 3?

I'm using TeamCity Enterprise 9.1.5 (build 37377).
I have created a Build Configuration.
I have created an NUnit Build Step.
For NUnit Runner I selected NUnit 3.
For Path to NUnit Console Runner I entered: packages\NUnit.ConsoleRunner.3.7.0\tools\nunit3-console.exe
In my Visual Studio solution I have installed the NUnit.Runner package.
When I run the Build Configuration I get the following error in the logs:
File type is not supported
How do I get my NUnit tests to run in TeamCity?
What worked for me:
I uninstalled NUnit.Runner and installed the following packages:
NUnit.ConsoleRunner
NUnit.Extension.NUnitProjectLoader
NUnit.Extension.TeamCityEventListener (not sure if this is needed, or not)
Why is the error being generated?
The ConsoleRunner can't handle .nunit files. That ability is part of NUnit.Extension.NUnitProjectLoader. The directory that extension is in will need to be listed as part of the .addins file. (I can't find the GitHub links where I found that information.)
How I troubleshooted:
TeamCity generated an .nunit file. I copied that file from the agent to my development machine to troubleshoot and run nunit3-console.exe myself. Once it ran on my development machine, TeamCity worked, too.

MsTest fails when running unit tests as part of CI using TFS 2008

My configuration:
VS2010 solution
TFS 2008
Build server - TFS 2008
Build server also has VS2008 Team Suite and VS2010 ultimate installed
TFS 2008 builds my VS2010 solution properly. But when it comes time to run the unit tests I get the following MsTest error.
Using "TestToolsTask" task from
assembly "D:\Program Files\Microsoft
Visual Studio
9.0\Common7\IDE\PrivateAssemblies\Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll".
Task "TestToolsTask" Command:
d:\Program Files\Microsoft Visual
Studio 10.0\Common7\IDE\MSTest.exe
/nologo
/searchpathroot:"D:\Builds\App\Source\86\Binaries"
/resultsfileroot:"D:\Builds\App\Source\86\TestResults"
/testcontainer:"D:\Builds\App\Source\86\Binaries\\Tests.dll"
/publish:"http://tfsServer:8080/"
/publishbuild:"vstfs:///Build/Build/26029"
/teamproject:"Proposal" The
"TestToolsTask" task is using
"MSTest.exe" from "d:\Program
Files\Microsoft Visual Studio
10.0\Common7\IDE\MSTest.exe". No platform specified for publish
operation. For switch syntax, type
"MSTest /help"
MSBUILD : warning MSB6006: "MSTest.exe" exited with code 1.
[D:\Builds\App\Source\86\BuildType\TFSBuild.proj]
The previous error was converted to a
warning because the task was called
with ContinueOnError=true. Build
continuing because "ContinueOnError"
on the task "TestToolsTask" is set to
"true". Done executing task
"TestToolsTask" -- FAILED.
I am not sure what is causing MsTest to fail.
Things tried:
- Provided write access to the build folder to the service account that builds the source on the build machine
You can execute a VS2010 build from within TFS2008's MSBuild, but it looks as if it's using Visual Studio 9.0 TestToolsTask (2008) to try to run a Visual Studio 10.0 (2010) test project (MSTest.exe). I'd try tweaking MSBuild to run the TestToolsTask from the "Microsoft Visual Studio 10.0" folder rather than "9.0", so that the entire process is using the same version of the tools. You can override the tools paths in your tfsbuild.proj file's Properties to ensure the correct version of Visual Studio is used to build with - something similar may apply to the test tools.
Alternatively, it's running the VS2010 test tools correctly, but still trying to use a command line that is specific to 2008 - check the settings and see if you can tweak the command line (you may need to override the MS targets files that is running the build if it's a 2008 version). For example in TFS 2010, a lot of command lines changed from using a simple "server:MyServer" to something like "collection:http://MyServer:8080/tfs/MyCollection". You may therefore have to alter the command line to gain full compatibility with the 2010 version of the tool that is now running, even if it still ultimately points at a 2008 server.
My third suggestion (which isn't necessarily very helpful) is to just upgrade to TFS2010 - it's typically a painless install, vastly better than 2008, and will eliminate any difficulties caused by using a hybrid 2008/2010 setup. (If it helps, I was reluctant to upgrade to 2010 because the 2005->2008 upgrade was 8 days of sheer hell. But in comparison the core of the upgrade to 2010 only took a few hours and "just worked" - the install/upgrade process is much improved)
Jason had the correct idea that lead me down to the correct solution.
In my case, I had to update the "Microsoft.TeamFoundation.Build.targets" to point to "Microsoft.TeamFoundation.Build.ProcessComponents.dll" (VS2010 dll) instead of "Microsoft.VisualStudio.QualityTools.MSBuildTasks.dll" (VS2008 dll)
I also had to make sure that the PlatformToBuild was specified in the TfsBuild.proj file.
Once these 2 steps were done, UnitTests were being run as part of the CI build using TFS2008 and a VS2010 solution.
I have blogged about the solution in detail here: http://blog.aggregatedintelligence.com/2011/03/vs2010-tfs-2008-and-unit-tests.html

Resources