migrating-webapi-cors

Automate CORS configuration migration from ASP.NET Web API to ASP.NET Core.

19|2|Updated May 13, 2026
One-click install
npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-webapi-cors
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrating-webapi-cors
Source: https://github.com/microsoft/upgrade-agent-plugins/tree/main/plugins/upgrade-agent/extenders/upgrade-dotnet/upgrade/skills/lazy/libraries/migrating-webapi-cors
Command: npx skills add https://github.com/microsoft/upgrade-agent-plugins --skill migrating-webapi-cors

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the migration of CORS configuration from ASP.NET Web API to ASP.NET Core, solving the need for developers to manually replace obsolete CORS handling in ASP.NET Web API projects with modern CORS policies in ASP.NET Core.

Core Features & Use Cases

  • Automated Migration: Automates the process of converting CORS configuration settings.
  • Legacy to Modern: Facilitates the upgrade from deprecated to current CORS policy implementations.
  • Use Case: When transitioning an ASP.NET Web API project to ASP.NET Core, this Skill ensures CORS configurations are correctly updated for seamless interoperability with the new framework.

Quick Start

Use the Skill to upgrade the CORS settings of your project by executing 'migrating-webapi-cors --start'.

Frequently Asked Questions about migrating-webapi-cors

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

FAQPage Schema
How do I migrate CORS configuration from ASP.NET Web API to ASP.NET Core?

Migrating CORS configuration from ASP.NET Web API to ASP.NET Core involves replacing obsolete Microsoft.AspNet.WebApi.Cors settings with modern Microsoft.AspNetCore.Cors policies. This Skill automates the detection and conversion of CORS configurations to ensure seamless interoperability with the new .NET framework.

What is the difference between ASP.NET Web API CORS and ASP.NET Core CORS?

ASP.NET Web API CORS relies on the deprecated Microsoft.AspNet.WebApi.Cors package, whereas ASP.NET Core CORS uses the modern Microsoft.AspNetCore.Cors library for policy management. The migration process involves updating API controllers and middleware to align with the current cross-origin resource sharing architecture.

How do I automatically replace deprecated CORS policies in my .NET project?

To automatically replace deprecated CORS policies in a .NET project, you can execute the migration process using the provided scripts. This detects legacy CORS configuration settings and replaces them with current ASP.NET Core CORS policy implementations without manual code edits.

Can I use this migration tool for any ASP.NET Web API project transitioning to ASP.NET Core?

Yes, this migration process is designed for ASP.NET Web API projects transitioning to ASP.NET Core. It specifically targets scenarios where legacy Microsoft.AspNet.WebApi.Cors is obsolete, ensuring CORS configurations are correctly updated for the new framework environment.

Why do I need to update cross-origin resource sharing settings when moving to ASP.NET Core?

Updating cross-origin resource sharing settings is necessary because ASP.NET Core uses a different CORS architecture than ASP.NET Web API. Migrating ensures that your web API maintains secure and proper cross-origin requests without relying on deprecated package dependencies.