How do I solve a “view not found” exception in asp.net core mvc project

前端 未结 16 1951
梦毁少年i
梦毁少年i 2020-12-09 15:53

I\'m trying to create a ASP.NET Core MVC test app running on OSX using VS Code. I\'m getting a \'view not found\' exception when accessing the default Home/index (or any oth

16条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-09 16:23

    FWIW, In our case we received this error when accessing localhost:/graphql even though the View/GraphQL/Index.cshtml was in the right place. We got the error because wwwroot/bundle.js and wwwroot/style.js was mistakenly not initially committed, since our .gitignore included wwwroot. Discovered it by inspecting the network traffic and seeing it was these files giving the 404 and not the Index.cshtml itself.

提交回复
热议问题