The razor view does not see the external assembly

I installed a class in project 1 that extends WebViewPage so that I can add my own extension method. I followed this page: right here.

I have a second project that contains a class and an object. This .dll project is listed in project 1 and is registered in gacutil.

The extension method uses the object that is in project 2. Whenever I switch to using my recently implemented extension method on the page, I get a wonderful error CCS0012.

CS0012: The type "namespace.AppAuthentication.type" is defined in an assembly that is not referenced. You must add a link to assembly 'namespace.AppAuthentication'

I managed to debug and make sure that the object is configured correctly. Even when I parse it in JSON and show it on the console in jquery ... everything is there! Only when accessing an object in a view.

Project 2 is listed in project 1. Project 2. The DLL is registered in my gacutil. The only way this works is to establish that the "copy local" value is true in the link. Also, this is not an acceptable option for me. I tried everything under the sun, and everything listed on this post: right here.

I would really appreciate it if anyone could shed light on this issue. It seems to me that Razor cannot access the assemblies registered in the GAC.

* edit: fixed title

+3
source share
2 answers

. , . web.config, web.config. , :

<compilation debug="false" targetFramework="4.0">
 <assemblies>
  <add assembly="namespace.AppAuthentication />
 </assemblies>
</compilation>

WebViewPage!

+4

, GAC, .Net runtime .

, .

0

All Articles