msbuild-modernization

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

Updated Jul 20, 2026
One-click install
npx skills add https://github.com/Netcodr81/kinetic-reports --skill msbuild-modernization-netcodr81
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: msbuild-modernization
Source: https://github.com/Netcodr81/kinetic-reports/tree/main/.github/skills/msbuild-modernization
Command: npx skills add https://github.com/Netcodr81/kinetic-reports --skill msbuild-modernization-netcodr81

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Legacy .NET projects carry verbose XML boilerplate, explicit file lists, packages.config, and AssemblyInfo.cs files that make builds harder 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 projects via ToolsVersion attributes, explicit <Compile Include> lists, packages.config, and .csproj files over 50 lines. - Seven-Step Migration Checklist: Covers replacing the project root element, mapping TargetFrameworkVersion to TargetFramework, removing explicit file includes, deleting AssemblyInfo.cs, migrating packages.config to PackageReference, and stripping boilerplate. - Consolidation Guidance: Explains Central Package Management with Directory.Packages.props and shared settings via Directory.Build.props/targets. - Use Case: A team maintaining a .NET Framework 4.7.2 solution with 65-line .csproj files uses this Skill to reduce each project to ~11 lines, migrate NuGet references, and enable nullable reference types. ## Quick Start Ask the AI to convert my 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 remove default configuration boilerplate. Tools like try-convert can automate the first pass.

How to migrate packages.config to PackageReference?▼

Convert each <package> entry in packages.config to a <PackageReference Include="..." Version="..." /> item 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, <Import Project="$(MSBuildToolsPath)"> lines, explicit <Compile Include> entries for every file, a packages.config file, and Properties/AssemblyInfo.cs. A .csproj over 50 lines for a simple project is likely legacy.

Can SDK-style projects still target .NET Framework?▼

Yes, SDK-style projects support .NET Framework targets such as net472 or net48 via the TargetFramework property. You get implicit globbing and PackageReference benefits without moving to .NET 6 or 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. Files needing special metadata may still require explicit includes.