-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Location for _ViewImport.cshtml & _ViewStart.cshtml not using ViewLocationExpander? #2990
Comments
Nevermind, made a mistake. |
They are passed using path from loaded View and not a processed path from the The problem is I use an |
Both _ViewImport.cshtml and _ViewStart.cshtml are handled in a hierarchical fashion based on the path of the view that is found, which is intended. Can you tell us more about what you are trying to accomplish? Why do you nee to add a path prefix? |
I use and |
Can you tell us why you are resolving views in this way? Is this intended to enable some sort of component model? |
Yes, I want to make it a modular solution where the module can contain controllers and embedded views. |
Can you show us an example of how you are setting this up? What do these components look like? Why do you need the fallback behavior for these specific files? |
IViewLocationExpander adds a location with prefix like "#Module#" based on the controller assembly used and also a locationwith prefix like "#Shared#" as a fallback incase specific view isn't in the module assembly (Also for _layout, _ViewImports and _ViewStart). And in the IFileProvider I get the view based on the location, if a prefix is present check in the module assembly resources. |
If you really want this today you can subclass and replace Suggest closing this /cc @Eilon |
I am not sure if it is by design, but the locations for
_ViewImport.cshtml
and_ViewStart.cshtml
the usedIViewLocationExpander
is not processed.As a workaround I extended my
FileProvider
to do it for those files.The text was updated successfully, but these errors were encountered: