Jan 29 2012

Refreshing an expired STSTestCert WIF certificate

Category: .Net | Applications | PersonalRory Primrose @ 18:32
I have been using WIF for the last couple of years on a few of my projects and the STSTestCert gets a bit of a workout on my development machines. This certificate is only valid for 12 months. All the applications that use this test certificate will fail to execute authentication requests once this certificate has expired. Here is the easiest way to renew the certificate. Open up MMC and attach the Certificate Manager plugin for the local machine. Navigate to Certificates (Local Comput... [More]

Tags:

Jan 29 2012

How much do I love the yield statement?

Category: .Net | Software DesignRory Primrose @ 17:15
Quite simply, a lot. The yield statement seems to be such a simple part of C# yet it can provide such amazing power (being delayed enumeration). Outside of that power however, it can provide beautiful simplicity. Take the following abstract class for example: namespace MyApplication.Diagnostics { using System; using System.Collections.Generic; public abstract class DiagnosticTask { public abstract IEnumerable<DiagnosticTaskResult> ExecuteAll(); ... [More]

Tags:

Jan 24 2012

Configuring a TFS 2010 build agent to compile SharePoint 2010 projects

Category: .NetRory Primrose @ 07:09
I’ve been doing several TFS consulting gigs over the last couple of years. The one thing that keeps popping up is the requirement to build several types of platforms using TeamBuild/TFSBuild. My preference is to isolate build agents and their customisations. This means for example that I have a mix of build agents like the following: Standard (full VS install + any common additions - WiX for example) SharePoint BizTalk Tagging the build agents and configuring the build definitions fo... [More]

Tags: , ,

Jan 12 2012

Integration testing with Azure development storage

Category: .NetRory Primrose @ 17:43
I’ve been working on some classes that write data to Azure table storage. These classes of course need to be tested. Unfortunately the development fabric only spins up when you F5 an Azure project. This is a little problematic when the execution is from a unit test framework. Some quick searching brought up this post which provides 99% of the answer. The only hiccup with this solution is that it is targeting the 1.0 version of the Azure SDK. I have updated this code to work with the 1.6 version... [More]

Tags:

Nov 9 2011

Performance Testing a Load Test

Category: .NetRory Primrose @ 17:59
Running a load test in Visual Studio is a great way to put your code under stress. The problem is that once you have identified that there is a potential performance issue, how do you then narrow it down to particular methods in your code base. Using a Performance Session is great for this. The problem is that Visual Studio does not provide out of the box support for running a performance session against a load test. There is a reasonably easy workaround though. Any other profiling tool will also work using the... [More]

Tags:

Nov 7 2011

AssemblyVersion regular expression

Category: .NetRory Primrose @ 06:40
It seems that I keep having to come up with a regular expression that validates and parses a version string. I often use this for customising TFS build workflows for extracting and using application version information. The AssemblyVersionAttribute appears to have the following rules: Major version is required Minor version is optional and will default to 0 if not specified Minor version cannot be * Build and Revision versions are optional and may be * Revision number cannot... [More]

Tags:

Oct 27 2011

Getting the X509Certificate from a remote HTTPS resource

Category: .NetRory Primrose @ 11:45
How do you download the X509Certificate that secures a HTTPS channel? I want to do this for two reasons. Identify the reason for a trust failure Identify if the certificate is about to expire I ran all sorts of searches on the net about how to get the certificate of the remote host. Unfortunately the results were not quite what I was after. The answer is that the certificate is provided by HttpWebRequest.ServicePoint.Certificate. The tricky bit is that the certificate is only available... [More]

Tags:

Oct 25 2011

Designing Action and TryAction members

Category: Software Design | .NetRory Primrose @ 08:13
I have a pet peeve with how Action and TryAction style members are often implemented. Too often I see the following style of implementation. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; public class SomeClass { public Stream GetSomething(String referenceData) { if (String.IsNullOrWhiteSpace(referenceData)) { throw new InvalidOperationException(); } return new MemoryStre... [More]

Tags:

Oct 18 2011

Neovolve.Toolkit 1.1 Released

Category: .Net | My SoftwareRory Primrose @ 06:24
It has taken a while, but I have been able to push out a new release of my Neovolve.Toolkit. The major focus of this release has been in the custom activity support for WF4. This version is now distributed via an MSI. This release of the Neovolve.Toolkit package targets .Net 4 and contains support for WF4 as well as fixes to the existing code base. It supports the Client Profile version of the .Net 4 framework on many of the assemblies for a smaller footprint. The package now supports a VSIX... [More]

Tags:

Oct 10 2011

Dealing with ExecutionEngineException, code contracts and WF

Category: .NetRory Primrose @ 08:34
I recently battled the scary ExecutionEngineException. It’s scary because the exception itself does not provide any information about what has gone wrong and why. Figuring out why the exception is being thrown can get a little tricky. In my scenario, Visual Studio was crashing when trying to display a WF designer. After attaching another Visual Studio instance to debug the crash, I found that the exception being thrown in the designer was ExecutionEngineException. The place it was being thrown was in an evaluati... [More]

Tags: