Yes, they should go in
wwwroot. Currently there is no built-in way to secure
wwwroot directories. But creating a middleware module to accomplish it is pretty straightforward. There is an easy to follow tutorial here.
If you’re not familiar with developing middleware, I posted a GitHub project that shows how to create middleware in three easy steps. You can download the project here.
You don’t need a controller to access static files.
- AddTransient, AddScoped and AddSingleton Services Differences
- Increase upload file size in Asp.Net core
- Access the current HttpContext in ASP.NET Core
- Token Based Authentication in ASP.NET Core
- How to read request body in an asp.net core webapi controller?
- Return View as String in .NET Core
- Dynamically access table in EF Core 2.0
- ASP.NET Core return JSON with status code
- Inject service into Action Filter
- .NET Core 2.2 Can’t be Selected In Visual Studio Build Framework
- How to read values from the querystring with ASP.NET Core?
- How to instantiate a DbContext in EF Core
- IdentityServer4 Role Based Authorization for Web API with ASP.NET Core Identity
- Upload files and JSON in ASP.NET Core Web API
- How do I access Configuration in any class in ASP.NET Core?
- Render Razor View to string in ASP.NET Core
- How to resolve IOptions instance inside ConfigureServices?
- Change route collection of MVC6 after startup
- Unable to resolve service for type while attempting to activate
- @Html.Action in Asp.Net Core
- JsonSerializerSettings and Asp.Net Core
- How do I get the kestrel web server to listen to non-localhost requests?
- ASP.NET Core 3.0 System.Text.Json Camel Case Serialization
- How to return a specific status code and no contents from Controller?
- How to seed an Admin user in EF Core 2.1.0?
- How do I write logs from within Startup.cs?
- Parse and modify a query string in .NET Core
- Asp.net core Identity successful login redirecting back to login page
- Command dotnet ef not found
- ‘No database provider has been configured for this DbContext’ on SignInManager.PasswordSignInAsync
- Unable to create migrations after upgrading to ASP.NET Core 2.0
- .NET Core Identity Server 4 Authentication VS Identity Authentication
- Get current URL in a Blazor component
- Uploading and Downloading large files in ASP.NET Core 3.1?
- ASP.NET Core 2.0 disable automatic challenge
- How to consume a Scoped service from a Singleton?
- Integration test and hosting ASP.NET Core 6.0 without Startup class
- Get all registered routes in ASP.NET Core
- What are the costs and possible side effects of calling BuildServiceProvider() in ConfigureServices()
- Read appsettings json values in .NET Core Test Project
- Correlation failed in net.core / asp.net identity / openid connect
- Windows authentication in asp.net 5
- Setting up Swagger (ASP.NET Core) using the Authorization headers (Bearer)
- .NET Core 3.0: Razor views don’t automatically recompile on change
- Proper way to register HostedService in ASP.NET Core. AddHostedService vs AddSingleton
- No service for type ‘Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]’ has been registered
- Identity in ASP.Net Core 2.1< - Customize AccountController
- How do I reference a .NET Framework project in a .NET Core project?
- Pass Array into ASP.NET Core Route Query String
- ASP.NET Core 1.0 on IIS error 502.5 – Error Code 0x80004005