msbuild-modernization

Migrates legacy MSBuild project files to SDK-style format with PackageReference and Directory.Build consolidation.

1|Updated Jun 1, 2026
One-click install
npx skills add https://github.com/D1ssolve/craft-agents --skill msbuild-modernization-d1ssolve
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-modernization
Source: https://github.com/D1ssolve/craft-agents/tree/main/skills/msbuild-modernization
Command: npx skills add https://github.com/D1ssolve/craft-agents --skill msbuild-modernization-d1ssolve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy .NET projects carry verbose XML, explicit file lists, packages.config, and AssemblyInfo.cs boilerplate that make builds hard to maintain. This Skill provides a step-by-step checklist to convert them into minimal SDK-style projects. ## Core Features & Use Cases - Legacy Detection: Identifies legacy indicators such as ToolsVersion attributes, MSBuildToolsPath imports, explicit Compile includes, and packages.config files. - Step-by-Step Migration: Covers replacing the project root element, mapping TargetFrameworkVersion to TargetFramework TFMs, removing explicit file includes, deleting AssemblyInfo.cs, and converting packages.config to PackageReference. - Consolidation & Modernization: Guides Central Package Management via Directory.Packages.props, shared settings via Directory.Build.props/targets, and enabling Nullable and ImplicitUsings. - Use Case: A 65-line legacy .csproj for a .NET Framework 4.7.2 library is reduced to an 11-line SDK-style project with PackageReference entries, then validated with dotnet build. ## Quick Start Ask the assistant to convert this legacy .csproj file to SDK-style format and migrate its packages.config to PackageReference.

Frequently Asked Questions about msbuild-modernization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a legacy .csproj to SDK-style format?

Replace the root element with <Project Sdk="Microsoft.NET.Sdk">, change TargetFrameworkVersion to TargetFramework (e.g., v4.7.2 to net472), delete explicit Compile includes and AssemblyInfo.cs, and convert packages.config to PackageReference entries. Tools like dotnet try-convert automate the first pass.

How to migrate packages.config to PackageReference in .NET?

Move each package entry from packages.config into <PackageReference Include="..." Version="..." /> items in the .csproj, then delete packages.config. Visual Studio offers a right-click migration option, and SDK-style projects auto-generate binding redirects.

What are the signs of a legacy MSBuild project file?

Legacy indicators include a ToolsVersion attribute, imports of Microsoft.Common.props or Microsoft.CSharp.targets, explicit Compile Include entries for every file, a packages.config file, and Properties/AssemblyInfo.cs. A simple project over 50 lines is likely legacy.

Can WPF or WinForms projects use SDK-style format?

Yes. Use the Microsoft.NET.Sdk.WindowsDesktop SDK, or set <UseWPF>true</UseWPF> or <UseWindowsForms>true</UseWindowsForms> in a standard SDK project, which is preferred for .NET 5 and later.

When should I not migrate a project to SDK-style?

Do not migrate projects already in SDK-style format, non-.NET build systems like npm or Maven, or .NET Framework projects that cannot move to SDK-style due to tooling constraints. The skill explicitly excludes these cases.