title: How to reference to assembly in mvc at runtime
body: <p>In my Asp.Net MVC application, i have some view file (<code>.cshtml</code>) which has reference to an external library which it will be loaded at runtime. so after app started, i load the assembly by Assembly.Load and i register the controllers by my own custom <code>ControllerFactory</code> and every thing is ok.</p>
  
  <p>But, in some views which has references to the dynamically loaded assembly, throws the :</p>
  
  <blockquote>
    <p>Compiler Error Message: CS0234: The type or namespace name 'MyDynamicNamespace' does not exist in the namespace 'MyApp' (are you missing an assembly reference?)</p>
  </blockquote>
  
  <p>exception that tells the razor compiler cannot resolve the related assembly.</p>
  
  <p><strong>My question</strong> is that, is there a way to register the assembly at runtime, to able the razor compiler can access to it and resolve it?</p>
  
  <p><strong>Notice</strong> that i can't use <code>BuildManager.AddReferencedAssembly</code> method because my assembly have to be loaded after app start, and the <code>BuildManager</code> does not support it.</p>