Skip to content
New issue

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

Retain directory structure when compiling views #188

Open
simon-wacker opened this issue Jul 3, 2024 · 0 comments
Open

Retain directory structure when compiling views #188

simon-wacker opened this issue Jul 3, 2024 · 0 comments
Labels
backend bug Something isn't working ISE Fraunhofer Institute for Solar Energy Systems ISE low Low priority

Comments

@simon-wacker
Copy link
Contributor

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

@simon-wacker simon-wacker added bug Something isn't working low Low priority ISE Fraunhofer Institute for Solar Energy Systems ISE labels Jul 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in EQWIN-P Jul 3, 2024
@github-actions github-actions bot added the triage Review issue to make sure it is relevant, actionable, and has all the necessary information label Jul 3, 2024
@simon-wacker simon-wacker added backend and removed triage Review issue to make sure it is relevant, actionable, and has all the necessary information labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working ISE Fraunhofer Institute for Solar Energy Systems ISE low Low priority
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant