RazorGenerator
RazorGenerator copied to clipboard
Multiple projects with PrecompiledMvcEngine?
Shared views are in a separate "library" MVC project. The WebActivatorEx.PostApplicationStartMethod
is used to register the view engine.
But I also precompile views in my main MVC project. And so it also needs to register its views using WebActivatorEx.PostApplicationStartMethod
.
So now, I have the PrecompiledMvcEngine
registered twice.
Seems like its working, but I'm wondering if this is a good idea... am I doing it right? Can this lead to a race condition depending on which one is registered first? Can I somehow register it once for both assemblies?
Take a look at CompositePrecompiledMvcEngine
. e.g. see here.
Not much/any documentation for it unfortunately...So:
I don't understand the use case for it? Is it for the case where you want to have multiple assemblies register views, or, when one assembly "overrides" views from another assembly? Or both?
There is any samples or documentation provided for CompositePrecompiledMvcEngine
I see adding one library works perfectly but adding two compiled view libraries at a time is an issue.
I prepared some sample to demonstrate my issue. if i am referencing the projects ClassLib_PreCompiledVies
& Web_PreCompiled
to the WebApp_Test
.
Test Project: https://github.com/vyelchuri/PrecompiledViewsTest
How to register both assemblies with out any issue ?
Maybe just missing a binding redirect?