We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View compilation does not retain the directory structure. For example, the view /Views/Authorization/Logout.cshtml is compiled as Logout.cshtml. The corresponding log output is Initializing Razor view compiler with compiled view: '/Logout.cshtml'. That is why the view lookup failed with the log outputs Could not find a file for view at path '/Views/Authorization/Logout.cshtml'. and Could not find a file for view at path '/Views/Shared/Logout.cshtml'. To fix the lookup I added a view-location format without directory structure by calling services.AddControllersWithViews().AddRazorOptions(_ => { _.ViewLocationFormats.Add("/{0}.cshtml"); }. I would rather have liked to change the view compileation such that it retains/respects the directory structure. I couldn't figure out how to do that though. Other people had similar issues, see dotnet/aspnetcore#52248 and https://www.reddit.com/r/dotnet/comments/14zd7zp/brand_new_default_aspnet_core_mvc_8_project/ and https://techcommunity.microsoft.com/t5/net-runtime/net-8-0-2-update-causes-asp-net-core-mvc-index-view-not-found/m-p/4058976
/Views/Authorization/Logout.cshtml
Logout.cshtml
Initializing Razor view compiler with compiled view: '/Logout.cshtml'
Could not find a file for view at path '/Views/Authorization/Logout.cshtml'.
Could not find a file for view at path '/Views/Shared/Logout.cshtml'.
services.AddControllersWithViews().AddRazorOptions(_ => { _.ViewLocationFormats.Add("/{0}.cshtml"); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
View compilation does not retain the directory structure. For example, the view
/Views/Authorization/Logout.cshtml
is compiled asLogout.cshtml
. The corresponding log output isInitializing Razor view compiler with compiled view: '/Logout.cshtml'
. That is why the view lookup failed with the log outputsCould not find a file for view at path '/Views/Authorization/Logout.cshtml'.
andCould not find a file for view at path '/Views/Shared/Logout.cshtml'.
To fix the lookup I added a view-location format without directory structure by callingservices.AddControllersWithViews().AddRazorOptions(_ => { _.ViewLocationFormats.Add("/{0}.cshtml"); }
. I would rather have liked to change the view compileation such that it retains/respects the directory structure. I couldn't figure out how to do that though. Other people had similar issues, see dotnet/aspnetcore#52248 and https://www.reddit.com/r/dotnet/comments/14zd7zp/brand_new_default_aspnet_core_mvc_8_project/ and https://techcommunity.microsoft.com/t5/net-runtime/net-8-0-2-update-causes-asp-net-core-mvc-index-view-not-found/m-p/4058976The text was updated successfully, but these errors were encountered: