I migrate my ASP.NET application to ASP.NET Core.
works fine but
calls my CategoryController's CheckIsCustomPage action so my application raise exception of course.
What can i do?
app.UseMvc(routes =>
{
routes.MapRoute(
name: "Category",
template: "{sefLink}/{pageNumber}",
defaults: new { controller = "Category", action = "CheckIsCustomPage", pageNumber = "1" }
);
routes.MapRoute(
name: "Ajax",
template: "ajax/{action}",
defaults: new { controller = "Ajax" });
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
Sounds like you don't have static files configured. If your routing is coming into play that's after the point that static files should be served. Prior to your:
app.UseMvc ...
Make sure you have:
app.UseStaticFiles();
And that your css
folder is under wwwroot
I put css files to "Content" folder as my old ASP.NET applications. But i've changed folder to css it works now. Thank you.
docs.microsoft.com/en-us/aspnet/core/fundamentals/…