No agent could be found with the following capabilities Xamarin.Android - tfs

I'm trying to create a build definition to build and package an Android app based on Xamarin Forms.
I want to do so thanks to TFS 2017 Update 1 on premise.
I've installed Visual Studio 2017 and Xamarin on my build server, and even after restarting my server, my agent does not find the Xamarin.Android capability.
I'm still getting en error while queuing one build :
No agent could be found with the following capabilities AndroidSDK, MSBuild, Xamarin.Android, JDK
The only capability that is missing on my agent is the Xamarin.Android.
Do you have any idea on how to add it on my agent ?
Regards

Add an environment variable named Xamarin.Android and the value of this would be
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin
or change it wrt your Visual Studio version and installation path.

Install Visual Studio 2017 on the build server and check Xamarin in the setup
Please check on the build server for an environment variable named Xamarain.Android and if it not exist add it or add an capability in TFS on the agent

Related

Using VS2019 with TFS2018 vnext build system without server side work around

I recently ran into a problem trying to use VS2019 with the TFS2018 vnext build system.
You cannot select VS2019 in the "Visual Studio Build" step, and selecting "Latest" does not use Visual Studio 2019.
On a test server, upgrading the server software from TFS 2018.3 to Azure Devops Server 2019 fixes the issue. Is there a simple work-around that would allow Visual Studio 2019 to be used without affecting the TFS server in a questionable way.
This question extends the question here:
Using VS2019 with TFS2018 vnext build system
Instead of using the Visual Studio Build step, I tried switching to the MSBuild Build step and specified the path to msbuild.exe as follows:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin
The build ran successfully and used Visual Studio 2019.

TFS 2017 - Build Server does not build Visual Studio 2017

After upgrade of Visual Studio 2017 last week on my build server, the MS Build 15.0 is not in use anymore. So whenever I try to compile visual studio 2017 projects which use new feature they will fail.
The Warning in build log is:
Visual Studio version '15.0' not found. Looking for the latest
version.
And the error is:
something.cs(542,41): Error CS1525: Invalid expression term 'int'
Which is because build server is using MS build 14.0 I guess.
So far I have
1- Uninstall and Reinstalled the Visual Studio 2017 on the build server.
2- Installed "Visual Studio Build Tools 2017".
And nothing works.
I have read some articles and apparently there are missing registry values but I don't know how to create them.
Appreciate your helps on this topic.
I am using TFS 2017 SP1 (On premises) and Visual Studio 2017 latest updates.
This may due to the VS is installed after the build agent configured. Then reregister the build agent with TFS, since the system capabilities are only discovered when the agent is first configured -- any changes made after that are not captured.
More ways please refer this similar question: No agent could be found with the following capabilities: msbuild, visualstudio, vstest?
Or install the latest version of the agent for now, which appears to be capable of detecting VS2017.
Also remember to select VS2017 in Visual Studio Version picklist of Visual Studio Build task.
I have resolved this issue by upgrading my TFS from TFS 2017 SP1 to
TFS 2017 SP2.
Thanks to #Patrick-MSFT and #Martin Ullrich for your help.

TFS Build Failure - Unable to find Visual Studio 2017

After updating to TFS 2017 Update 2 RC1, my builds are failing because Visual Studio 2017 (MSBuild 15.0) is not found. I am using the 'Visual Studio Build' task with 'Latest' selected as the Visual Studio version.
I have reinstalled Visual Studio Build Tools 2017.
I have repaired my TFS installation.
I have reinstalled my Build Agent.
I have verified that my Build Agent has Visual Studio 2017 and MSBuild 15.0
capabilities.
The only way I am able to get a successful build is to replace my 'Visual Studio Build' tasks with 'MSBuild', and manually direct to the MSBuild executable. I don't find this acceptable, I have too many Build configurations that would need to be changed. And when the next version of MSBuild comes out, I have to manually update them all.
Build Agent Capabilities:
MSBuild
Visual Studio
Suggest you directly select VS2017 instead of latest in the VS version option, then trigger the build again.
To narrow down the issue, you could try below ways:
Create a new build definition with the same settings to build the
project
Use the build definition to build another Visual Studio 2017 project such as a new created one
Enable TFS Build debug logging by adding a variable named
system.debug and setting its value to 'true'. This will enable full debug logging to correct more info.

TFS 2010 issues building C#6.0 code with MS Build 14

We have TFS 2010 running happily on a dedicated build server.
I have installed Microsoft Build Tools 2015, which includes MS Build 14 successfully on the build machine, but not Visual Studio 2015.
I've created a custom template which alters the "ToolsPath" property of the "Run MSBuild" activity to "C:\Program Files (x86)\MSBuild\14.0\Bin".
The build runs, but fails on this particular error:
(CoreCompile target) ->
CSC : error CS1566: Error reading resource 'ProjectName.exe.licenses' --
'Could not find file 'C:\develop\Sources\ProjectName\obj\x86\Release\ProjectName.exe.licenses'.' [C:\develop\Sources\ProjectName\ProjectName.csproj]
The same project builds fine using Visual Studio 2015 running from another machine.
It makes no difference whether the TFS build definition includes these MS Build arguments or not:
/tv:14.0 /p:VisualStudioVersion=14.0
Does anybody have a success story of using a TFS 2010 build agent to successfully build a C#6.0 project?
I solved this in the end by installing Visual Studio 2015!
The /tv:14.0 /p:VisualStudioVersion=14.0 argument may don't work for MSBuild Tools.
You should customize the tfs build process template to set ToolPath of the Run MSBuild for Project to target to MSBuild14; and set ToolVersion to "14.0".
Check this link for the detailed information:BuildActivity ignores ToolsVersion

Unable to build WiX 3.10 project in TFS 2015

I am using TFS 2015 trail version in windows server 2012.I created windows service project in visual studio community edition along with WiX Project to package the windows service. If i build the solution from visual studio, I am able to get the MSI. But if i use Visual studio build in TFS 2015,i get the following error.
"Unexpected exit code received from msbuild.exe: 1" and "Task VSBuild
failed. This caused the job to fail. Look at the logs for the task for
more details."
I refered the below links as reference :
http://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html-
http://wixtoolset.org/documentation/manual/v3/msbuild/daily_builds.html
1) I am unable to follow the first link steps as i got struck in step 2:
i am unable to find configuration folder in build definition.
I was reading that we do not have TFSBuild.proj straing from TFS version 2010.
"Right-click on the Build Definition and select View Configuration
Folder." "Check out and open the file named TFSBuild.proj."
2)I am unable to follow second link as well. I am getting below error:
"The imported project "C:\wix\3.8\Wix.targets" was not found. Confirm
that the path in the declaration is correct, and that the
file exists on disk."
since I am new to TFS Build 2015, any help or guidance will be appreciated.
Beginning with NuGet 2.7, the NuGet Visual Studio extension integrates into Visual Studio's build events and restores missing packages when a build begins. This feature is enabled by default. If you are using NuGet to install Wix packages, that's why you can get a successful build from visual studio.
If you want to use NuGet to install Wix packages, you can create one build.proj to restore these packages during build. Check: http://docs.nuget.org/consume/package-restore/team-build
If you don't use NuGet to install Wix packages, a traditional way you can refer to:http://edwinfrey.com/blog/2012/06/11/building-wix-msis-in-tfs-preview/

Resources