I have a MVC 4 project where I load views from dynamically loaded assemblies. This works fine, as long as I do not use strongly typed views, as I get a "Type or Namespace not found" exception in that case.
I then tried to add a
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
to my Application_Start
, but the event is never hit to resolve the assemblies searched by the razor view engine.
Same problem exists also for resources, but there it just uses the base culture and at least does not crash.
I know my event resolves the assemblies fine, as when I use the same classes in my code the event is hit and I can use the classes/resources fine.
Does anyone know how to resolve assemblies used in Razor views?
For now I use a dirty hack
by copying the assemblies to the /bin
folder, which basically works, but produces some other problems aside from beeing
just a ugly hack
I also tried AppendPrivatePath
, which also did not help for the razor views.