TFS 2013 build does not deploy ASP.NET web application - msbuild

I have a new TFS 2013 instance with its own build server that compiles a solution and deploys a database project without error. I added an MS build activity for deploying the web application projects in the solution to a target server, and that activity appears to execute without error, but nothing is actually published in the target.
Running the same publish profile from within Visual Studio on my local machine works properly. I dont know if it is missing some dependency (Web deploy 3.5 is installed on both the build and target servers, I am reinstalling VS 2013 on the build server).
Are there any specific steps/prerequisites required to make this work correctly on a TFS 2013 build server? I cannot find anything on the web other than "Install VS and MSDeploy".
I have this all working properly on a 2010 build server.

After much testing and enabling diagnostic level logging, I found that the build activity was trying to use VS 2012 (version 11) activity targets for these VS 2013 (version 12) projects. (VS 2010, 2012, and 2013 have been installed on this server to support various build activities)
In the activity specific log file this looks like this...
CodeAnalysisTargets = C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\CodeAnalysis\Microsoft.CodeAnalysis.targets
This was causing the build process to log...
_DeploymentUnpublishable
Skipping unpublishable project
...and skip the publishing.
To fix this, I set the ToolVersion property of the MSBuild activity to "12.0" and re-ran the build

Related

Build BizTalk Project with Azure DevOps Build Pipeline

I've got a Visual Studio Solution which contains only BizTalk projects. These has the following settings.
BizTalk Server 2016
.NET Framework 4.6
On the server is installed.
BizTalk Developer 2016 (only the Project Build Components)
Visual Studio Build Tools 2019 with .NET 4.5.2 and 4.6 targeting pack
In my Azure DevOps Build Pipeline the build fails with the following error
##[error]CSC(0,0): Error CS2001: Source file 'C:\VSTS_Agent\vsts-agent-win-x64-2.144.2\_work\1\s\MyProject\MySchema.xsd.cs' could not be found.
If I'm searching for this error there are some hits. But I couldn't find something that helps for this problem. Is something missing that have also to be installed or configured?
The problem you have is that you have committed xsd*.cs files into your source code tracker. Try to remove them from your repos and build again it should work

Build and Test the ASP.NET Website and Libraries without having Visual Studio

I am a newbie in the DevOps world, and I would like to set up a CI server.
I have a Continuous Integration pipeline setup (with GO-CD pipelines) on my laptop. I am trying to move it to the server.
On the server, I do not have Visual Studio Tools so the existing MSBuild fails. Is there any way I can run the same pipeline on the server.
I have 2 projects in my MSBuild file.
Asp.Net website
MS Test Project
Regards,
Kritul
Build ASP.NET code on the Build Server without installing VS
Build ASP.NET 4.5 without Visual Studio on Build Server
Using MS Tests on Build Server without installing VS
Can I use mstest.exe without installing Visual Studio?

TFS2010 Xaml Build Controller With TFS 2015

We are attempting to upgrade our rather old TFS environment from TFS2008 to TFS2015. The upgrade of the server and database is not a problem and is fine.
The issue is our build machine. This is still a Windows 2003 Server that is running Visual Studio 2010 and VB6. We still have a need to use this build machine to build legacy VB6 projects. We have installed the TFS2010 XAML build controller on this server and successfully connected it to our test TFS2015 server. However when we try to run a Xaml build, (any Xaml build regardless of whether it builds VB6 or .NET) we get the following error message almost straight away.
TF900560: Could not start build: Cannot set unknown member 'Microsoft.TeamFoundation.Build.Workflow.Activities.TfsBuild.TargetsNotLogged'.
The XAML build are using the 'UpgradeTemplate.xaml' template and using the TFSBuild.proj we used under Visual Studio 2010.
We have a also set up a TFS2015 build controller on another (Server 2012) machine and that successfully starts the build process. However, our VB6 projects use a lot of third party components that will not install on Server 2012 so we can't use that.
Has anyone ever set up this kind of arrangement before? Is there anything we are missing or are doomed in this scenario? Obviously, we'd like to move away from VB6 apps, but that is not possible in the medium term.

Why does my build app fail when run outside of VS12 (i.e. when deployed)?

I've written a c# program that builds *.csproj and *.vcxproj using Microsoft.Build.Evaluation. It works great on both project types if I compile and run it from inside Visual Studio 12. But if I run the exe directly (outside of Visual Studio) I get the example error message below. The error occurs only for vcx projects; c# projects continue to build just fine
Question: Why am I getting this error? Why does my program work fine for both C# and vcx projects when run from within VS12, but fails, but only for vcx projects, when run outside of VS12?
Please don't chastise me for not using MSBuild.exe. My orders were to programmatically build C# and vcx projects using Microsoft.Build.Evaluation.
Code:
using Microsoft.Build.Evaluation;
...
Project proj = new Project("MyCppProject.vcxproj");
proj.Build(logger);
Runtime Error:
Building MyCppProject
Project "MyCppProject.vcxproj" (default targets):
VCMessage:
ERROR C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(518,5): Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.
Done building project "MyCppProject" -- FAILED.
One solution is to force the Visual Studio version as an environment variable prior to loading and building the project:
using Microsoft.Build.Evaluation;
...
Environment.SetEnvironmentVariable("VisualStudioVersion", "11.0")
Project proj = new Project("MyCppProject.vcxproj");
proj.Build(logger);
Visual studio maintains platform tool sets list supported for the version of Visual studio you are currently running for example on my machine I have VS 2008, 2010 and 2012
Now suppose when I install Visual Studio 2013 which has a Platform Toolset version of V120. What happens, is that the project saves this in its corresponding XML files in the format (vcproj, vcxproj, vcxproj.filter.user files).
now this valus is not known to VS 2012 so it complains when opened in VS 2012.
Similarly for opening VS 2012 project in VS 2010, as in your case and so on.
Solution:
To fix this issue, Open you solution file in notepad++.
Make these 2 changes
1) Replace
Format Version 12.00
with
Format Version 11.00
2) Replace
Visual Studio 2012
with
Visual Studio 2010
Then open the file again in visual studio and rebuild solution.

Getting Auto Deploy to work with MSBuild on a build server

Please pardon a newbie's question about MS TFS and Visual Studio 2012, I hope I'm using the correct vocabulary.
Our shop has recently moved to MS TFS and Visual Studio 2012 to build internal web services for integration. Currently we have a TFS 2010 Server running on Server2008R2 and a Build server on a Windows 7 box, our dev application server is also running Server2008R2. I have been given the job of getting a nightly build and deployment running. I have the build definition working but the deployment portion is not functioning. I have installed Web Deploy on both the dev application server and the build server as per these articles:
http://www.kevingao.net/version-control/how-to-auto-deploy-web-application-with-tfs-build-server.html
and
http://www.iis.net/learn/install/installing-publishing-technologies/installing-and-configuring-web-deploy
We have configured an user, web_deploy_dev in active director and that user is a local admin on the dev app server.
The parameters added to the build definition are:
/p:DeployOnBuild=True
/p:DeployTarget=MsDeployPublish
/p:MSDeployServiceURL="https://PA-APPSRV1-DEV:8172/msdeploy.axd" /* double quotes not in original code */
/p:DeployIISAppPath="DW/DWServices" /* E:\Webroot\DW\DWServices */
/p:CreatePackageOnPublish=True
/p:MsDeployPublishMethod=WMSVC
/p:AllowUntrustedCertificate=True
/p:UserName=migp\web_deploy_dev
/p:Password=******
I suspect that MSBUILD is not even calling msdeploy.exe as I see no errors in the windows event and application logs, but I do not know all the places to look. I can use a web browser and connect to the service on the dev app server as the web_deploy_dev user from the build server, I receive a web page not found error after inputting user name and PW, but I assume that is to be expected.
I am at a loss as to where to look next, I've tried searching the web but nothing I try seems to work.
Thank you in advance for your help and input.
Roy
It sounds like you are experiencing a problem where your build completes and claims success, but you aren't getting any error and nothing is actually deployed. When I've experienced this with my TeamCity build server, the problem was that MSBuild was not set up on the machine that would do the building and deploying. These are my steps to resolve the problem I think you might be having:
Make sure that at least Visual Studio Express is installed. you can tell if a full enough version of Visual Studio is installed by navigating to the
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\ directory. If you see folders like 10.0, 11.0, or '12.0', look inside them and verify that there is a Microsoft.WebApplications.targets file. Note the versions that pass that check.
In your Build Configuration, add a /p:VisualStudioVersion=12.0 or whatever version of Visual Studio is appropriate.
Let me know if this gets you anywhere or not. I'm really curious to hear if you are finding any errors or logs anywhere. Basically, in my experience using Web Deploy and MSBuild with TeamCity, if the machine that is building and deploying doesn't have the MSBuild installed with the Microsoft.WebApplication.targets file, it silently fails.