Use Subversion revision number as version number with MSBuild

(And handle revision numbers larger than 65534)

When using a system for continuous integration to automatically deploy your application, it is important to know what version of your code is deployed. This tutorial will show you how to automatically set the version number of the deployed .dll.

In a .NET project, the version number is defined in AssemblyInfo.cs, on the format 1.0.0.0. The numbers are MajorVersion.MinorVersion.Build.Revision. The two latter, build and revision numbers, should be set automatically by your CI system on each deploy.

Content of this tutorial

  • How to create an MSBuild target to automatically insert the revision number on build
  • What to do when your revision numbers are too large to use as .NET revision numbers
  • How to use Bamboo to get the latest revision number from Subversion and use this as an input parameter to MSBuild

Continue reading Use Subversion revision number as version number with MSBuild

How to use Bootstrap or other CSS frameworks on a small part of a page without affecting the rest of the page’s style

I’m currently working on a project where I have an AngularJS app (a form), that will be displayed on several different external websites. This means that I have to style the form to fit into several different page designs, with different existing stylesheets.

The form itself is styled using Bootstrap, one of the most commonly used front-end frameworks.

TL;DR: To style only a selected part of a website using a CSS framework, I create a container div around the app with a unique id, and then use LESS to change all the style definitions in the framework to only affect this particular id. This process is done automatically on build using .NET MVCs bundling framework.

Continue reading How to use Bootstrap or other CSS frameworks on a small part of a page without affecting the rest of the page’s style

AngularJS and .NET MVC: Convert templates from html to javascript and bundle app and templates together

I am working on a project where I have an AngularJS app on my own .NET MVC website, and I will display this app on several remote websites.

TL;DR: To get the AngularJS templates to load correctly on the remote website, I needed to convert the html template files to javascript and bundle them together with the rest of the app. This article will try to explain why and how to achieve this.

Continue reading AngularJS and .NET MVC: Convert templates from html to javascript and bundle app and templates together

SharePoint: Create a content organizer rule with many content type aliases using PowerShell

Why would I want to add many content type aliases to a content organizer rule?

When creating a content organizer rule in SharePoint, the default is that the rule is only valid for a single content type. To get around this limitation, you can add other content type names to the field Aliases (also known as RoutingAliases), displayed as “List of alternate names” in the SharePoint editor.

Continue reading SharePoint: Create a content organizer rule with many content type aliases using PowerShell