GitHunt
RO

RoryDuncan/msbuild-project-organizer

A dotnet tool for organizing messy csproj files

MSBuild Project Organizer

Unit Tests

A console application for organizing messy .csproj files.

Install

You can install as a dotnet tool from NuGet

Usage

See Usage

Development

Run dotnet build src

Run Tests

Run dotnet test.

Example Changes

Before

Some messy XML

<Project>
  <ItemGroup>
    <Content Include="jquery.js" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Views/Index.cshtml" />
    <Content Include="croppie.js" />
    <Compile Include="DashboardController.cs" />
    <Content Include="Views/Dashboard/Index.cshtml" />
    <Compile Include="Bundling.cs" />
    <Content Include="Views/Home.cshtml" />
    <Content Include="jquery.validator.js" />
    <Compile Include="HomeController.cs" />
  </ItemGroup>
</Project>

After

<?xml version="1.0" encoding="utf-8"?>
<Project>
  <!-- Compiled C# Files -->
  <ItemGroup Label=".cs files">
    <Compile Include="Bundling.cs" />
    <Compile Include="DashboardController.cs" />
    <Compile Include="HomeController.cs" />
  </ItemGroup>
  <!-- Published Files -->
  <ItemGroup Label=".cshtml files">
    <Content Include="Views/Dashboard/Index.cshtml" />
    <Content Include="Views/Home.cshtml" />
    <Content Include="Views/Index.cshtml" />
  </ItemGroup>
  <ItemGroup Label=".js files">
    <Content Include="croppie.js" />
    <Content Include="jquery.js" />
    <Content Include="jquery.validator.js" />
  </ItemGroup>
</Project>

You can also see the dogfooding examples:

Languages

C#100.0%

Contributors

MIT License
Created September 27, 2020
Updated April 5, 2023
RoryDuncan/msbuild-project-organizer | GitHunt