© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
8 replies
Anton

❔ ASP.NET Core reroute requests for static files to a different server

This is supposed to be implemented by
Microsoft.AspNetCore.SpaServices.Extensions
Microsoft.AspNetCore.SpaServices.Extensions
, like this guy does here https://github.com/MakotoAtsu/AspNetCore_Vite_Template
However there's an issue: I want a) to be able to start the server separately, b) to use the manifest generated by Vite to provide the files.

The code in the template above doesn't actually work as I need it to: it looks at the dist folder to get the available files, while what should actually happen is it should read in the manifest file generated by vite, which remaps the files correctly and whatnot. So I need a custom
FileProvider
FileProvider
. The problem with that is the method
GetFileInfo
GetFileInfo
, which returns an
IFileInfo
IFileInfo
, which has to implement
CreateReadStream()
CreateReadStream()
, which I have no idea why aspnet core needs in the first place, and I don't know how to implement it myself. The implementations provided by aspnet core deal with actual files on disk or embedded resources, but not files streamed over http, so idk what to do.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Static files asp.net
C#CC# / help
3y ago
❔ ASP.NET to .net Core
C#CC# / help
3y ago
[ASP.NET Core] Apply a selfsigned certificate to asp.net core?
C#CC# / help
4y ago
❔ ASP.NET Core Persist Task between requests
C#CC# / help
4y ago