How to enable teamcity agent for Build Tools 2013 - visual-studio-2013

Im trying to make a build of asp.net mvc 4 application on my teamcity server.
The server is Windows Server 2012 R2. with 64bit OS.
Teamcity version is 8.1 (build 29879).
If I set MSBuild version to MSBuild Tools 2013 agent is incompatible.
The reason is: Unmet requirements: MSBuildTools12.0_x64_Path exists
I made sure I install .net sdk, and as its a Windows Server 2012, .net 4.5 is already installed there (4.5.2 in my case). What should I do to make it work?

Have you installed the Build Tools? They no longer come with the .NET framework, part of Windows or not, but with the Studio or as a standalone installer. Don't forget to restart afterwards.

Related

No agent found in pool XXX which satisfies the following demand: visualstudio although vs2022 community is installed

We have a build agent (a self hosted buildserver) which apparently satisfies msbuild, but not visualstudio so we tried to install vs.
I installed vs2022 community on the server and restarted.
Still those mails comes when a change is detected in the repository.
No agent found in pool XXX which satisfies the following demand: visualstudio. All demands: msbuild, visualstudio, Agent.Version -gtVersion 2.192.0
Is community not an option?
Azure DevOps Server 2020 and below only officially supports Visual Studio 2019 and below for the tasks and the agent version it ships with. The latest agent version for Azure DevOps (Service) has the right updated scripts in the Capability Providers.
In case this is on an Azure DevOps Server and want to use Visual Studio 2022 / .NET 6, you need to:
Set a magic environment variable to be able to run a more recent agent version:
AZP_AGENT_DOWNGRADE_DISABLED=true
Upgrade to/Install agent version 2.195.0 or newer.
Install the Visual Studio 2022 compatible Visual Studio and MsBuild tasks into your server. Either by directly overwriting the tasks on the server:
npm install -g tfx-cli
tfx build tasks upload --task-zip-path Task.guid-version.zip --service-url https://yourtfs.com/tfs/DefaultCollection
You can download the latest zip file from my GitHub repo. Or download them yourself with my script.
Or installing them side-by-side as an extension which will give the tasks get a new unique id and a different reference name.
I've laid out the process in this GitHub repo and blogpost:
https://github.com/jessehouwing/azure-pipelines-tasks-zips
https://jessehouwing.net/adding-visual-studio-2022-to-azure-devops-server-2020/
The expectation is that Azure DevOps Server 2022 will be the first version to ship with official support for Visual Studio 2022.
Community is an option (but I did not test 2022). Check agent capabilities.

dotnet.exe won't run because api-ms-win-crt-runtime-l1-1-0.dll is missing

I need to host an ASP.NET Core 2.0 app in IIS on Windows Server 2008 R2 SP1. I'm following the Docs guide on how to Host ASP.NET Core on Windows with IIS.
After installation, I still can't run dotnet.exe. It calls for a DLL named api-ms-win-crt-runtime-l1-1-0.dll.
The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.
However, there are lots of instances of this file on the machine, in the following folders:
C:\Program Files\dotnet\shared\Microsoft.NETCore.App\2.0.3
C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\2.0.3
C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18972_none_a9a51144251fb166
C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.23175_none_aa31870f3e3ad077
C:\Windows\winsxs\amd64_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.23656_none_aa4830af3e29a3af
C:\Windows\winsxs\x86_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.18972_none_4d8675c06cc24030
C:\Windows\winsxs\x86_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.23175_none_4e12eb8b85dd5f41
C:\Windows\winsxs\x86_microsoft-windows-u..rsalcrt-apifwd-win7_31bf3856ad364e35_6.1.7601.23656_none_4e29952b85cc3279
The instruction says:
Install the .NET Core Windows Server Hosting bundle on the hosting system. [...] If the system doesn't have an Internet connection, obtain and install the Microsoft Visual C++ 2015 Redistributable before installing the .NET Core Windows Server Hosting bundle.
I have installed/repaired both of these packages multiple times but get the same error.
It's probably not that the DLL is missing, but rather one of the DLL's dependencies is missing.
Make sure you're installing the Update 3 version of the Visual C++ 2015 Redistributable.
One of the requirements of the Visual C++ 2015 Redistributable is KB2999226. Make sure this is installed as well.
If it's already installed, post the installation log from the Visual C++ 2015 Redistributable installer package.
on windows server 2012 R2
I had same issue. Windows update + installing windows specific update solved it.
see: https://github.com/dotnet/core-setup/issues/4388.
I installed this update:
https://support.microsoft.com/en-us/help/3118401/update-for-universal-c-runtime-in-windows
TL;DR: Install these Windows updates in this order:
KB2919442
KB2919355
KB2999226
After installing the above 3 Windows update in the correct order, the error about the missing dll should stop.
I ran into basically this same problem when attempting to deploy a .NET Core 2.1 application to a Windows 2012 R2 machine. The root cause seems to have been due to a corrupt installation of the Microsoft Visual C++ Redistributable.
From Microsoft's documentation:
Visual C++ Redistributable Packages install runtime components of
Visual C++ Libraries on a computer that does not have Visual C++
installed. The libraries are required to run applications that are
developed by using the corresponding version of Visual C++.
After some troubleshooting and research, I fixed the issue by manually installing these 3 Windows updates in this order:
KB2919442
KB2919355 (requires a reboot)
KB2999226
The order of installation of these Windows updates is important! KB2999226 depends on KB2919355, and KB2919355 depends on KB2919442.
After installing those Windows updates, dotnet.exe and the application began to run correctly.

Visual Studio 2017 build tools not installing on windows server 2012

I am trying my best to setup a build server. I went to install
and downloaded the latest build tools but as soon as I try to install it shows me this
So I though ok maybe it does not support it so I went here requirements
If you scroll down to build tools it says it support windows 2012 am I missing something.
thanks
Only Windows Server 2012 R2 (with Update 2919355): Essentials, Standard, Datacenter is Supported
https://learn.microsoft.com/en-us/visualstudio/productinfo/vs2017-system-requirements-vs

Deploying to Windows Server 2003

Using visual studio 2013 on a windows 8 machine I created a F# console application. The app runs fine on the dev machine. But when I build a debug release and export it to a windows 2003 server and attempt to run, I continually get the error: not a valid win32 application even though the build configuration is set to "any cpu". Does anyone know how to solve this error? Thanks.
You are probably using .NET Framework 4.5 wich is not compatible with Windows Server 2003.
If you are not using anything from .NET 4.5 you can change on Visual Studio the framework targeted by the application to 4 and then run it on Windows Server 2003.
Also, here is the list of requirements for .NET Framework 4.5
https://msdn.microsoft.com/en-us/library/8z6watww%28v=vs.110%29.aspx

How teamcity builds project and requirements of msdeploy on client machine

Just want to know whether msbuild is built in teamcity or teamcity uses the installed msbuild.exe on your build machine. I have no visual studio installed on my build machine. Little bit confused as where to locate msbuild.exe on machine if no visual studio installed.
Also requirements of msdeploy on client machine. Plz clarify.
TeamCity does not provide the compilers for any language, just the integration support to bring those tools together. For MSBuild specifically, you'll need the .NET framework installed, or Visual Studio:
MSBuild ships as part of the .NET Framework, starting with v2.0 in Visual Studio 2005 and updated in v3.5 with Visual Studio 2008.
Alternatively, you can make use of the Mono support that TeamCity provides to go down that road.

Resources