How do you run MStests through TeamCity and the MSBUILD option? Do you put these settings in the main solution?
Thanks
It is possible to configure sln2008 runner to start mstest for you.
Another way is to write custom msbuild script that first calls and than call mstest.exe process. To report generated .trx file please use TeamCity Service Message:
##teamcity[importData type='mstest' path='']
Related
We use TeamCity as our build server - how does one setup TeamCity to run SonarQube analysis for C# / .NET solutions?
I'm thinking we'll need to execute the MSBuild runner as a command line task since the TeamCity SonarQube runner doesn't call the MSBuild SonarQube runner.
(It would be great if http://docs.sonarqube.org/display/PLUG/C%23+Plugin described this scenario.)
EDIT
The URL in the original post has changed. Correct link is here.
You're right: There are build step/tasks for the MSBuild SonarQube Runner available out-of-the-box for Team Foundation Server 2015 (and soon Jenkins) - but not for TeamCity. You indeed need to use the command line step/task to manually invoke the MSBuild SonarQube Runner begin and end phase, and MSBuild in between.
From there, the actual configuration and usage is identical to the command line scenario, which is why the TeamCity doesn't have its own documentation.
Here is what I did to run this via a build task
Put the following command as a .cmd file in the solution root
cd %system.agent.home.dir%
C:\sonarqube\bin\MSBuild.SonarQube.Runner.exe begin /key:MyKey /name:MyProjectName /version:1
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild.exe" MySolution.sln /t:Rebuild
C:\sonarqube\bin\MSBuild.SonarQube.Runner.exe end
Create a "Command" task in TeamCity and execute the .cmd file
Apparently the default number of cores MSBuild will use during compilation is 1.
In TeamCity I have tried adding /m:8 to the Command line parameters field in an MSBuild Runner type task to tell the MSBuild compiler to use up to 8 cores to compile the projects within the solution.
(I realise the amount it can do in parallel depends on the dependencies between the projects in the solution.)
However when I look in the build logs I don't see any mention of that parameter?
Is this the right way to do this? Does anyone know if TeamCity supports this?
Note: This is on TeamCity 8.1.5 (build 30240)
If you have access to the build agent, when the build is in progress, you could login and start task manager, to see if there are multiple msbuild.exe (s).
I don't think that the build logs will have any info about this. What kind of info are you looking for?
i have created a Custom tool (SingleFile generator) using IVsSingleFileGenerator. Which takes "xyz.Resx" file as input and generate "xyz.Designer.resx.cs" file. This file can be generated on building/Saving the Application through IDE.
Issue is, I have given the Custom Tool Property for any .Resx file and build the application through MSBUILD. Now I am unable to build/
generate the "Designer.resx.cs" file.
How to prepare a Custom Task to run this custom tool through MSBUILD.
plz help in doing the same.
Thanks in advance.
I don't have much knowledge about this custom tool IVsSingleFileGenerator which you are using. To execute it in MSBuild you may need targets for the same given by them to generate the resx.cs file from .resx file. Or you may add a commandline call of this tool in your MSBuild script and try it.
I don't think you can run CustomTool from MsBuild. Since you're the one that wrote the tool, I would definitely suggest to create msbuild task and start using it.
Here are some ideas how to do that:
http://msdn.microsoft.com/en-us/library/t9883dzc.aspx
http://blogs.msdn.com/b/msbuild/archive/2006/01/21/515834.aspx
Another approach would be to write executable, but that will be less efficient.
Here is how you call executable from msbuild
<Target Name="your-target-name" AfterTargets="the-starting-point-of-your-target">
<Exec Command="your_exutable-here parameters_here" WorkingDirectory="your_working_folder" />
</Target>
Third approach would be to write inline msbuild task
http://blogs.clariusconsulting.net/kzu/writing-inline-msbuild-tasks-in-c-for-one-liners/
I hope that helps
I've created a custom MSBuild task for our database project. This tasks uses XLSX file to generate reference data insert scripts that get merged into the post deployment script.
I tested this with a test MSBuild proj and it works well.
Now when I integrate it into the real DBProj file, the output of the task is duplicated and I cant see the MSBuild output logging.
So, my questions are:
1) How can I see the full MSBuild logs in Visual Studio?
2) I'm not sure AfterBuild or BeforeBuild is running twice but maybe?
Thanks
You can debug your MSBuild scripts, set breakpoints, inspect values, etc... See here: http://blogs.msdn.com/b/visualstudio/archive/2010/07/06/debugging-msbuild-script-with-visual-studio.aspx
I'm kicking of an msbuild script using the Teamcity msbuild runner.
Unfortunately, I'm finding that the build log output is too verbose, specifically each message is prepended with:
[08:52:34]: [Project "SomeScript.msbuild.teamcity.patch.tcprojx" (CleanBuildAll target(s)):]
(The script, teamcity extension, and task being run).
Is there any way to remove this message prefix?
Limitation of Teamcity, their tech support was unable to help me.
The solution is use Hudson instead of Teamcity.