msbuild-modernization

Migrate legacy MSBuild project files to SDK-style format.

5.1k|377|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/dotnet/skills --skill msbuild-modernization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-modernization
Source: https://github.com/dotnet/skills/tree/main/plugins/dotnet-msbuild/skills/msbuild-modernization
Command: npx skills add https://github.com/dotnet/skills --skill msbuild-modernization

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you update legacy MSBuild project files (.csproj, .vbproj) to the modern SDK-style format, simplifying your build process and improving compatibility.

Core Features & Use Cases

  • Identify Legacy Projects: Detects outdated project file structures, packages.config, and AssemblyInfo.cs patterns.
  • Migrate to SDK-style: Guides you through replacing the project root, updating target frameworks, and removing boilerplate.
  • PackageReference Migration: Assists in moving from packages.config to the modern PackageReference format.
  • Consolidate Settings: Explains how to use Directory.Build.props and Directory.Build.targets for shared configurations.
  • Use Case: You have an older .NET Framework project with a large, complex .csproj file and a packages.config. This Skill will guide you to convert it to a lean, SDK-style project compatible with newer .NET versions.

Quick Start

Use the msbuild-modernization skill to convert a legacy .csproj file to SDK-style.

Frequently Asked Questions about msbuild-modernization

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

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

To migrate a legacy .csproj file to SDK-style, you update the project root element, set the target framework, remove boilerplate, and delete AssemblyInfo.cs. This Skill guides you through each step to produce a lean, modern project file.

What is the best way to move from packages.config to PackageReference?

Moving from packages.config to PackageReference involves tracking your existing dependencies and adding them directly into the SDK-style .csproj file. This Skill helps you transition your NuGet dependencies to the modern PackageReference format.

How does Directory.Build.props consolidate MSBuild configurations?

Directory.Build.props consolidates MSBuild configurations by defining shared build properties in a single file at the repository root. This Skill explains how to use it and Directory.Build.targets to eliminate duplicated settings across multiple projects.

Can I use this MSBuild modernization process for .NET Framework projects?

Yes, this MSBuild modernization process supports both .NET Framework and .NET Core migration scenarios. It detects outdated project structures and guides you in updating them to be compatible with newer .NET versions.

Why should I remove AssemblyInfo.cs when updating to SDK-style projects?

You should remove AssemblyInfo.cs when updating to SDK-style projects because the SDK automatically generates assembly metadata. This Skill identifies AssemblyInfo.cs patterns and helps you remove the boilerplate to prevent build conflicts.

What are the limitations of migrating old MSBuild project files to SDK-style?

Migrating old MSBuild project files to SDK-style can be challenging if the legacy .csproj contains highly custom build targets. This Skill addresses common migration tasks, but complex custom build logic may require manual review after conversion.