I have two ASP.NET Core MVC projects. Both projects have the same files in their wwwroot
folders.
My question: is it possible to specify a custom location for the wwwroot
folder, so that I could access the same wwwroot
folder in both projects?
I have already read similar questions like:
- ASP.Net Core: Use Shared Project to share static assets (css / js) between many projects,
- Share static files between ASP.NET Core Projects,
- Shared wwwroot files in different projects,
- Virtual directory inside of ASP.NET Core app in IIS
With the help of the above listed questions, I identified two approaches
- using a virtual directory
- including the files using
app.UseFileServer
However, I was not able to reference the files using relative paths, e.g. in _Layout.html
the reference ~/lib/bootstrap/dist/css/bootstrap.min.css
does not work.