msbuild-modernization

Convert legacy MSBuild projects to SDK-style format with PackageReference.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/1k-off/umbraco-observability-playground --skill msbuild-modernization-1k-off
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: msbuild-modernization
Source: https://github.com/1k-off/umbraco-observability-playground/tree/main/.agents/skills/msbuild-modernization
Command: npx skills add https://github.com/1k-off/umbraco-observability-playground --skill msbuild-modernization-1k-off

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you modernize legacy .NET project files (old .csproj/.vbproj) into SDK-style format so builds become simpler, faster to maintain, and consistent across environments.

Core Features & Use Cases

  • Legacy-to-SDK detection: Recognizes common indicators like ToolsVersion, classic <Import> entries, packages.config, and explicit <Compile Include> lists.
  • Migration checklist: Covers the required structural changes to the project file, including root element replacement, TargetFramework updates, removal of explicit includes, and assembly info handling.
  • Package and configuration modernization: Guides migration from packages.config to PackageReference, plus optional improvements like Central Package Management and shared Directory.Build.props consolidation.
  • Scope guardrails: Clearly restricts use to MSBuild/.NET build contexts and avoids projects already using SDK-style or non-.NET build systems.

Quick Start

Ask an AI assistant to modernize your legacy .csproj by converting it to SDK-style, migrating packages.config to PackageReference, and simplifying the file by removing explicit compile/content include lists and AssemblyInfo.cs equivalents.

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 file to SDK-style format?

Migrating packages.config to PackageReference is the standard approach for SDK-style .csproj files. This Skill guides the transition from legacy NuGet package management to PackageReference, and optionally implements Central Package Management for consolidated version control.

What is Directory.Build.props and when should I use it during MSBuild migration?

Directory.Build.props is a shared MSBuild configuration file used to consolidate common project settings. During MSBuild migration, you move shared properties from individual SDK-style projects into Directory.Build.props to simplify maintenance and ensure consistency across environments.

Can I use dotnet try-convert to modernize legacy .vbproj files to SDK-style?

Modernizing legacy .vbproj files to SDK-style format follows the same process as .csproj conversion. You update the root element to Microsoft.NET.Sdk, migrate TargetFrameworkVersion to TargetFramework, and remove explicit Compile lists, applicable to both VB.NET and C# .NET migration scenarios.

Does migrating to SDK-style projects remove the need for explicit Compile Include lists?

Yes, migrating to SDK-style projects enables implicit globbing, which automatically includes .cs and .vb files without explicit Compile Include lists. This removes verbose XML from your project file and simplifies build configuration maintenance.

What are the limitations of modernizing legacy MSBuild projects to SDK-style?

This MSBuild modernization process is restricted to .NET build contexts and should not be applied to projects already using SDK-style format or non-.NET build systems. It targets legacy projects with classic Import entries, ToolsVersion, and packages.config.