This project is read-only.

Accessing Shared View Dll from GAC

Oct 14, 2013 at 5:15 PM
I compiled my shared views as a separate dll(EmbeddedViews.dll) and was able to access in MVC 4 Project. Now i registered the shared view(EmbeddedViews.dll) Dll into GAC(Global Assembly Cache ) and trying to access the shared view in MVC4 project. It could not find the location of the view. I added the namespace of the dll in Web.config of the MVC4 project view.
Is it possible to access the dll from GAC??
Oct 14, 2013 at 11:11 PM
Did you add the GAC assembly to the <system.web> \ <compilation> \ <assemblies> section?
Oct 15, 2013 at 2:43 PM
I added below lines of code in Views Web.config of my MVC4 Project
<compilation>
  <assemblies>
    <add assembly="EmbeddedViews, Version= 1.0.0.0, Culture=neutral, PublicKeyToken=7ed82c28818e9b49" />
  </assemblies> 
</compilation>

I also tried to add the same in web.config of the project. It is not working. What could be wrong??
Oct 15, 2013 at 3:46 PM
Are you using WebActivator? I think the problem is that it doesn't support GAC assemblies. Can you try just calling your RazorGeneratorMvcStart.Start method yourself from your site's App_Start logic?
Marked as answer by BPR on 10/16/2013 at 7:20 AM
Oct 15, 2013 at 9:31 PM
I tried calling RazorGeneratorMvcStart.Start method from the App_Start logic and that worked. Than you for your help..
Oct 15, 2013 at 9:37 PM
Great! Note that if you do that, you don't need the <assemblies> section above.
Oct 16, 2013 at 3:19 PM
What you pointed out is correct. <assemblies> section mentioned above did not work for me. so i removed it from my web.config file.