Is it possible to run an FxCop Code Analysis from the MSBuild command line with VS NOT installed? - msbuild

Our final build server does not have Visual Studio 2010 installed. It uses the MSBuild.exe from the .NET 4 SDK. As part of our code delivery process to our customer we need to allow him to build the projects from the command line on a Visual Studio 'agnostic' server and also to run Code Analysis rules on that machine.
On the visual studio side we started out with AllRules.rules and created exceptions going foreward so naturally we'd like the exceptions to carry over to the code analysis on the build server.
Is this possible ?
Thanks in advance.

Using standalone FxCop you can customize your CI process as you wish. Open this link and go to "Setting up continuous FxCop code analysis" chapter.
Link above seems to be dead now. You can try to look here on this SO question

Related

SonarQube scanner for MSBuild missing CA issues

We use SonarQube 5.3 to analyze our C# code.
The analysis is triggered from the vNext build on TFS 2015 (on premise).
We have a quality profile with rules from the C# analyzer plugin (Sxxx) and some FXCop rules (CAxxxx).
We've made a .ruleset that reflects the quality profile to be able to run the code analysis from Visual Studio 2015.
However I'm missing some code analysis warnings/errors in SonarQube that are showing up when running the code analysis locally and also show up in the build log. Both in the MSBuild output that is visible when the build is running on the server, as in the [AssemblyName]CodeAnalysisLog.xml.
The weird thing is, we've been solving a lot of issues lately and we have solved several CA1725 issues that were visible in SonarQube. Now we have a number of CA1725 issues (not suppressed) still visible in the logs and the XML, but they don't show up in SonarQube.

Using FxCop code analysis for .NET 4.5 applications

Is it possible to use FxCop for .NET 4.5 applications?
I am looking to use FxCop with the Visual Studio 2013 Professional edition.
Visual Studio 2013 Professional comes with Static Code Analysis (which is FxCop, just a fancy name for it).
In this link some information is provided:
As a developer, you can run code analysis on your project automatically or you can run it manually.
To run code analysis each time that you build a project, you select Enable Code Analysis on Build (defines CODE_ANALYSIS constant) on the project's Property Page. For more information, see How to: Enable and Disable Automatic Code Analysis for Managed Code.
To run code analysis manually on a project, on the Analyze menu, click Run Code Analysis on ProjectName. For more information, see How to: Enable and Disable Automatic Code Analysis for Managed Code.
This version runs perfectly on .NET 4.5.
FxCop 1.36 is a standalone version of Code Analysis. Microsoft no longer supports or works on the standalone version and currently only working on the integrated version that is included in Visual Studio.
There is a Uservoice going on which asks Microsoft to update the standalone FxCop version. See this link.

Microsoft Fake in Build server

I have a mstest project that uses Microsoft fake assembly. The test methods are executing fine in my local Visual studio ultimate. I never check in the fake dll in to repository (SVN), assuming that it will be created in the build server (Jenkins). Later I understood that the build server is using MSBuild.exe to build the solution and since MSBuild.exe doesn't know how to create the fake assembly, the build seems failing. Installing the Visual studio ultimate in the build server is the only one option or is there any other ways to execute the unit test (like check in the fake dll in to repository).
You need Visual Studio Ultimate or Visual Studio Premium (if you are using a version later than Visual Studio 2012 Update 2) to be able to generate fakes. Also please make sure that your build script is using vstest.console.exe to execute tests. Fakes is not supported by MSTest.exe

How do I create a package of my application in VB.net which can run on other's systems too?

I made an application in Visual Studio 2012 using VB.net language.
I want to make a package or a setup so that any user whether they have visual studios or not can run my application.
I searched on internet and what I found is that there is something like statically or dynamically linking. Do these relate to my question?
Please give me a step by step method of packaging so that my application can run on Windows without needing Visual Studio or any other program to run it.
You will find it in the menu under Build -> Publish.
This will produce an executable that can be run without Visual Studio. The .NET Framework has to be installed on the computer though, but that usually is.

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.