When there are multiple _viewStart.cshtml files in nested folders are they additive or does the _viewStart file in the last folder take prescience?
For example:
With the following folder structure
/Views
_viewStart.cshtml
/Views/Module1
_viewStart.cshtml
/View/Module1/Partial
_viewStart.cshtml
Is the logic in the _viewStart file in /View/Module1/Partial the only logic used or is the logic in the two parent folders (/View/Module1 and /View) used? If there is a Layout=”…” in /Views would it be applied to any files in /View/Module1 or /View/Module1/Partial?
From my testing it appears the _viewStart files are “inheriting” from their parent _viewStart files unless a value like “Layout” is overridden specifically.
They are all executed in folder-hierarchy order. So in the example you show, all three would be executed, in the order you have them listed.
/Views/_viewstart.cshtmlthen/Views/Module1/_viewstart.cshtmlthen/Views/Module1/Partial/_viewstart.cshtml