A patch came out in January which fixes the noise issue in TeamBuild reports. Build reports now only display one build step per project build by the solution after this patch is applied.
This has been an interesting nut to crack. There are several published ways to inject a version number into WiX as part of a TeamBuild process. This is the way that I have found has the best results.
The following target overrides the ResolveSolutionPathsForEndToEndIteration MSBuild target to inject a $(VersionNumber) value if a custom version number has been defined or calculated in the build script. The default implementation of ResolveSolutionPathsForEndToEndIteration is called if no version number has been defined or calculated.
I previously posted about XML comments and the include element for documenting code in Visual Studio. I commented against that post that xpath queries should end in /*. This tells the query to select all child elements of the xml node identified. Unfortunately this does not cover all scenarios where external xml can be included in xml documentation.
Take the following xml for example.
I have faced a bit of a curly one tonight with a class that I want to unit test. Part of its implementation is to use an instance that is created from a factory class. To adequately test the class, I need to get the factory to return a mock. The factory class is a closed design so this is difficult to achieve. The factory does however use a configuration value to help it determine the concrete type to create.
The difficulty with this scenario is that Type.GetType (using the configuration value) isn’t able to load the mock type directly. The solution to this problem is to use a wrapper around the mock. In doing this, the type loaded by Type.GetType is a statically defined type that happens to hold a reference to the mocked object to which it simply forwards on the required calls.
SCOM supports collecting event records that can be reported on. It has inbuilt support for reading the Windows Event Log or a CSV file, but becomes limited beyond that. I played with the idea of getting SCOM to read records out from a database in order to populate these SCOM events. Unfortunately there is not much information on the net about how to get it to work.
The attached SCOM management pack shows an example of how to get this to work. It uses a Microsoft.Windows.TimedScript.EventProvider to read database records into a PropertyBag and to define how the database fields map to SCOM fields. A rule data source then points to the EventProvider and provides the configuration options for hitting the database.
A word of caution though, you need to be careful not to dump too much information into the SCOM data warehouse as it is not designed for collecting large amounts of event records in this manner.
I’ve come across this one a few times and I can never remember what the answer is off the top of my head.
We are getting the msbuild script to execute psexec to invoke msiexec on a host machine to install an msi compiled by the build script. This is done so that the build script can then execute integration and load tests on the deployed application.
In modifying the build script, it seems like I have accidentally changed the psexec arguments which has caused psexec to hang on the build agent. In this case, it is happening when -accepteula is not passed to psexec.
The build script should look like this for executing psexec -> msiexec.
PostSharp.Laos is a Lightweight Aspect-Orientated System for PostSharp that makes it really easy to include AOP in your code. In this demo, PostSharp will be used to aspect the RunTest() method in the following application. The aspect will output console messages before and after the aspected method is executed.
PostSharp is a very power AOP framework. It changes the IL emitted from the compiler according to the aspects that it finds. The way PostSharp can be implemented ranges from very easy to very complex.
The demos in this series will look at a very simple scenario. PostSharp will be used to aspect the RunTest() method in the following code. The aspect used will output console messages surrounding the RunTest method.
There are many AOP frameworks around and they all use one of just a few techniques to inject code into join points. Oren has previously posted a list of these types of AOP techniques with their advantages and disadvantages. This list is copied below for reference: