You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes made in the DefaultDescriptorBuilder are to have spark support the Area viewlocations that are default in the MVC framework. Where as the AreaDescriptorFilter is basically legacy code left in to provide backwards compatibility for people who have their views in the old locations. However it cannot be discarded completely because its needed to set the Area key in the extra dictionary used in PotentialViewLocations.
Not sure what the right solution to this problem would be though. However i do have a suggestion. The current way in which the new locations are added feels like a hack, considering Spark has DescriptorFilters to modify the ViewLocations collection.
A solution could be to provide the controller and viewname to the DescriptorFilter(s) as well, basically allowing them to properly build a viewlocation themselves and add that to the collections. This way the AreaDescriptorFilter can be responsible for adding the new ~{0}Areas{0}{1}{0}Views{0}{2}{0}{3}.spark style location in the proper way.
The text was updated successfully, but these errors were encountered:
I ran into this issue purely by happenstance. When resolving a view inside the context of an area i am getting the following view locations returned.
(excerpt from the complete listing, showing only the relevant entry's
where Account is the area)
As you can tell these locations will never yield any correct path. I started digging and found out what the problem was.
In the
DefaultDescriptorBuilder
thePotentialViewLocations
adds the Area's path with the ~ in front.(see: https://github.com/SparkViewEngine/spark/blob/master/src/Spark.Web.Mvc/DefaultDescriptorBuilder.cs#L198) I understand why it does this. However it fails to take theAreaDescriptorFilter
into consideration. Causing the locations to show up as they do.The changes made in the
DefaultDescriptorBuilder
are to have spark support the Area viewlocations that are default in the MVC framework. Where as theAreaDescriptorFilter
is basically legacy code left in to provide backwards compatibility for people who have their views in the old locations. However it cannot be discarded completely because its needed to set the Area key in theextra
dictionary used inPotentialViewLocations
.Not sure what the right solution to this problem would be though. However i do have a suggestion. The current way in which the new locations are added feels like a hack, considering Spark has DescriptorFilters to modify the ViewLocations collection.
A solution could be to provide the controller and viewname to the DescriptorFilter(s) as well, basically allowing them to properly build a viewlocation themselves and add that to the collections. This way the AreaDescriptorFilter can be responsible for adding the new
~{0}Areas{0}{1}{0}Views{0}{2}{0}{3}.spark
style location in the proper way.The text was updated successfully, but these errors were encountered: