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 …
Category Archive: C#
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 …
Permanent link to this article: http://trycatch.me/automatically-update-the-assemblyfileversion-attribute-of-a-net-assembly/
Sep 07 2012
Checking if a user account is enabled in .NET
Here’s a handy little code snippet to figure out if a local windows user account is enabled or not using the System.DirectoryServices namespace. private static bool IsUserAccountEnabled(string username) { try { var result = new DirectoryEntry { Path = “WinNT://” + Environment.MachineName + “,computer” } .Children .Cast<DirectoryEntry>() .Where(d => d.SchemaClassName == “User”) .First(d => …
Permanent link to this article: http://trycatch.me/checking-if-a-user-account-is-enabled-in-net/
Sep 05 2012
Combinatorics in .NET – Part II – Creating a Nuget Package
In the last post we looked at the Combinatorics Library, a .NET Assembly which provides Combinatoric generation capabilities to your .NET Applications. Now lets look at bundling up that solution & deploying the package to Nuget. Nuget is an online .NET Package Repository & associated Visual Studio extension that makes it easy to manage external assemblies …
Permanent link to this article: http://trycatch.me/combinatorics-in-net-part-ii-creating-a-nuget-package/
Sep 01 2012
Combinatorics in .NET – Part I – Permutations, Combinations & Variations
Recently while working on a project, I had need to generate combintations and permutations of sets of Inputs. In my search for a decent combinatorics library for .NET, (something which is missing from the BCL), I came across a Codeproject Article from Adrian Akision. The implementation included a C# Generics Collection implementation for creating …
Permanent link to this article: http://trycatch.me/combinatorics-in-net-part-i-permutations-combinations-variations/

