404 error for any action with asp.net core MVC

youen

With a brand new project created from scratch (not a visual studio template), using Kestrel as server, and a very simple Startup.cs that just initializes MVC with services.AddMvc(); and app.UseMvc();, any request to a controller action returns a 404 error instead of running the action.

youen

Turns out there was a typo in my project.json.

This compiles but does not work: "Microsoft.AspNetCore.MVC": "1.0.0-rc2-final",

This works fine: "Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",

Don't see the difference? Took me quite a while to find it. The version that does not work is using uppercase MVC, while the correct version is Mvc. Why it compiles but silently fails at runtime is a mystery for me though.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Getting 404 not found when calling Asp.Net Core MVC action from Jquery

ASP.NET Core WebAPI 404 error

How to fix error 404 when logging out on an ASP.NET Core MVC app against Azure AD?

Change controller route name in ASP.NET Core MVC 404 error

Error 404 when calling POST method in asp.net mvc Core 2.1

Displaying a 404 Not Found Page for ASP.NET Core MVC

Edit action with Dependency Injection ASP.Net Core MVC

ASP.NET Core MVC equivalent of Start Action Specific Page

Asp.net core MVC make action optional in routing

Compress filter at the action level for ASP.NET Core MVC

Controller action alias in ASP.NET MVC CORE

How to pass an object to an action method in ASP.NET Core MVC

jquery not sending data to Post Action Asp.Net Core MVC

Why do I get a HTTP ERROR 404 when listing products by category using ASP.NET Core 6 MVC with pagination?

ASP.NET MVC 5 - Error Handle for - 404 Page not found

Encrypted String originates 404 error in ASP.NET MVC

Routing issue in Asp.net MVC (404 Error)

Getting error 404 not found with ASP.NET MVC Area routing

ASP.NET MVC API PUT getting 404 error

Server error in application '/'. HTTP 404. MVC ASP.NET

asp.net mvc + routelink get only 404 error

How to fix ASP.Net Core 404 error on IIS?

ASP.NET Core 404 Error When Published to IIS 7.5

Postman getting 404 error for ASP.NET Core Web API

ASP.NET Core - Download .exe returns 404 error

ASP.NET Core 404 Error on IIS 10

Asp.Net Core WEB API error 404 calling method

getting json error when invoking asp.net core action

ASP.NET Core MVC NET 5.0 HTTP Error 500.0