Welcome to Shaun Luttin's public notebook. It contains rough, practical notes. The guiding idea is that, despite what marketing tells us, there are no experts at anything. Sharing our half-baked ideas helps everyone. We're all just muddling thru. Find out more about our work at bigfont.ca.

Run codeformatter on an ASP.NET 5 project

Tags: c#, asp.net, asp.net-5

Add a *.csproj to the root of your project (or an ancestor directory). It will be the target, can be named anything, and contains the following:


<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Compile Include=".cs" />
    <Compile Include=".**.cs" />
  <Target Name="Compile">
    <Csc Sources="@(Compile)"/>

Then run the following command:

.\CodeFormatter.exe path\to\Code2Format.csproj /nocopyright /aggressive

This assumes that you've already cloned and built the codeformatter repo.