1

Resolved

Option to always use physical views if they exist

description

Hi

We are using RazorGenerator in a base project, which we then rollout to multiple Other Sites.
So far this is working really well except we have found that when we override views in our Other Sites, they are not showing on the actual sites after
the first deployment, its reverting back to the original base views.

We have tracked this down to a particular situation.
  1. The PrecompiledMvcEngine has an option for UsePhysicalViewsIfNewer, which we have set to true
  2. On our development environment, the overriden views work on our own machines initially. We then commit our changes to SVN.
  3. When we deploy the webiste code, or someone else checks out the Other Site, it is not using the overridden view.
  4. When other people / builds check out the Other Site from SVN, all files in the Other Site have the same modified date
This means that we will never be able to override the base views on Other Sites.

We are wondering if there is a configuration parameter on PrecompiledMvcEngine that specifies to always
use the physical views if they exist for a site?

If there's not, can we get one added please.
I've included an example of generally how we would like the PrecompiledMvcEngine to work for this situation.

Thanks for your help
saan

file attachments

comments

pranavkm wrote Jun 7, 2012 at 4:20 PM

Since Mvc's looks up View Engines sequentially, you should be able to achieve this by tweaking "ViewEngines.Engines.Insert(0, engine)" to append it to the end of the list. This way if one of the other view engines preceding ours says it has a file corresponding to the virtual path, it will win.

Could you check if this works in your scenario?

saan800 wrote Jun 8, 2012 at 11:21 AM

Yes, ordering the ViewEngines works
Thanks for your help

pranavkm wrote Jul 30, 2012 at 5:10 AM

Please reopen if the work item if you're still seeing this issue