Category Archive: Coding

Mar 06 2013

Could not load type ‘System.Runtime.CompilerServices. ExtensionAttribute’ from assembly mscorlib when using ILMerge

Works On My Machine

I ran into a pretty horrible problem with ILMerge this week when attempting to build and deploy a windows service I’d been working on. While the merged executable & subsequently created MSI worked fine on my own machine, it gave the following rather nasty problem when run on a colleagues machine. It turns out that …

Continue reading »

Permanent link to this article: http://trycatch.me/could-not-load-type-system-runtime-compilerservices-extensionattribute-from-assembly-mscorlib-when-using-ilmerge/

Jan 25 2013

Automatically update the AssemblyFileVersion attribute of a .NET Assembly

There is support in .NET for automatically incrementing the AssemblyVersion of a project by using the “.*” notation. e.g. [assembly: AssemblyVersion("0.1.*")] Unfortunately the same functionality isn’t available for the AssemblyFileVersion. Often times, I don’t want to bump the AssemblyVersion of an assembly as it will effect the strong name signature of the assembly, and perhaps …

Continue reading »

Permanent link to this article: http://trycatch.me/automatically-update-the-assemblyfileversion-attribute-of-a-net-assembly/

Dec 14 2012

Adding Custom Message Headers to a WCF Service using Inspectors & Behaviors

CustomHeader

Often, you’ll need to pass some piece of information on some or all of your  WCF Service operations. For my team, we had recently exposed some functionality in an old WCF Endpoint via a Web Front End and wanted to log some auditing information on each and every Service Call. Obviously modifying every single method …

Continue reading »

Permanent link to this article: http://trycatch.me/adding-custom-message-headers-to-a-wcf-service-using-inspectors-behaviors/

Dec 04 2012

Unexpected Variable Behaviour in DOS Batch and Delayed Expansion

cmd

What would you expect the following piece of Code to print. if the directory ‘A’ doesn’t exist @ECHO OFF IF ’1′==’1′ ( CD a ECHO %ERRORLEVEL% ) CD a ECHO %ERRORLEVEL% Not very intuitive right? This is because the DOS batch processor treats the whole if statement as one command, expanding the variables only once, before …

Continue reading »

Permanent link to this article: http://trycatch.me/unexpected-variable-behaviour-in-dos-batch-and-delayed-expansion/

Nov 23 2012

.NET Windows Services – Tips & Tricks

Add Installer to Windows Service

If you’ve ever worked with windows services, you’ll know that they’re a very powerful tool to have in your background processing arsenal. Unfortunately they can be also quite a pain to work with in developer land. Recently we’ve been spinning up a lot of new windows service projects in work as part of a Business …

Continue reading »

Permanent link to this article: http://trycatch.me/net-windows-services-tips-tricks/

Older posts «