migrating-mvc-static-files

Migrate ASP.NET MVC static files to ASP.NET Core with IFileProvider.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the migration of ASP.NET MVC applications to ASP.NET Core by reorganizing static files and configuring middleware for efficient asset serving.

Core Features & Use Cases

  • Static File Reorganization: Moves Content/, Scripts/, and App_Data/ folders into wwwroot/ and configures UseStaticFiles middleware.
  • VirtualPathProvider Replacement: Transitions from VirtualPathProvider to IFileProvider and EmbeddedFileProvider.
  • Use Case: Ideal for upgrading MVC apps that serve CSS from ~/Content/, JS from ~/Scripts/, use VirtualPathProvider, serve embedded resources, or store files in App_Data/.

Quick Start

Migrate your MVC static files to ASP.NET Core by running the migrating-mvc-static-files skill.

Frequently Asked Questions about migrating-mvc-static-files

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

FAQPage Schema
How do I migrate ASP.NET MVC static files to ASP.NET Core conventions?

To migrate static files from ASP.NET MVC to ASP.NET Core, move your `Content/`, `Scripts/`, and `App_Data/` directories into the `wwwroot/` folder and enable the `UseStaticFiles` middleware in your Startup configuration.

What replaces VirtualPathProvider in ASP.NET Core static file serving?

VirtualPathProvider is replaced by `IFileProvider` and `EmbeddedFileProvider` in ASP.NET Core, allowing you to serve embedded resources and map virtual paths to physical files using the new file provider abstractions.

How does ASP.NET Core IFileProvider work for embedded resources?

ASP.NET Core `IFileProvider` abstracts file system access, and `EmbeddedFileProvider` specifically retrieves files embedded in assemblies, replacing the legacy `VirtualPathProvider` mechanism for serving embedded resources during migration.

Does this static file migration approach support apps using App_Data folders?

Yes, this migration approach explicitly supports ASP.NET MVC applications that store files in the `App_Data/` folder by relocating them into the `wwwroot/` directory to align with ASP.NET Core serving conventions.

What is the best way to configure UseStaticFiles middleware after upgrading MVC?

The best way to configure `UseStaticFiles` middleware after upgrading is to ensure all legacy static assets are reorganized under `wwwroot/` so the middleware can properly intercept and serve CSS and JavaScript file requests.