Could not load file or assembly 'vcWebCore' or one of its dependencies. The system cannot find the file specified.

All,
I have a web project that references a strong-name DLL which contains a HttpModule, it is called vcWebCore.dll.

The DLL is registered in GAC using the gacutil.exe and everything looks fine.
I can see the DLL in my c:\windows\assembly directory with the correct
version (1.0.0.0) and public key token.

However, at runtime I kept getting the error that the vcWenCore module could not be located:

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Could not load file or assembly 'vcWebCore' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 16: 	<system.web>
Line 17: <httpModules>
Line 18: <add type="Technesis.vcWebCore.Web.VcHttpModule, vcWebCore" name="VcHttpModule" />
Line 19: </httpModules>
Line 20: <!--
Does anyone know why or what I am missing
Thanks,

P.S. If I have the DLL in the bin folder everything works fine. But since this is a shared DLL I thought it has to be in GAC in order for my other we projects to be able to use it.
_____
Danny



Answer this question

Could not load file or assembly 'vcWebCore' or one of its dependencies. The system cannot find the file specified.

  • Evan Mulawski

    Hi,

    You can check the windows ("<%windir%>")folder permissions, the ASPNET should have Read & Execute permissions (The assembly folder takes the permission from this folder, as you can not assign permissions directly to the "Assembly" folder - because is a "vitual" folder -.

    Check also this article about running your website under different trust levels, that affects the access to the GAC.

    http://cyberforge.com/weblog/aniltj/archive/2004/04/27/486.aspx

    This another interesting article about accessing shared resources using ASP.NET : http://www.15seconds.com/issue/030926.htm

    Or, if you decide to use another account, this is another interesting article: http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnnetsec/html/SecNetHT01.asp

    Hope this helps

    Cheers



  • Bhatia Gaurav

    Salvador,
    Thanks a lot for the info. It is helpful and maybe others will benefit from it too.
    I finally figured out the root cause of the error.
    My HttpModule is a shred DLL and it is registered in GAC. In order to successfully access the
    DLL in GAC you need to specify name, version, culture and PublicKeyToken like the following:

    <compilation debug="true">
    <assemblies>
    <add assembly="vcWebCore, Version=1.0.0.1, Culture=neutral, PublicKeyToken=44E22FC27F7E627B"/>
    </assemblies>
    </compilation>

    Once I added the <compilation> element the HttpModule got picked up from the GAC.


  • knikki98

    Hi Danny,

    Usually this error is related with permissions, if you are using IIS5 the ASPNET user must have permissions to access to the GAC, if you are using IIS6 it will be the user of your applicationPool. Use the .NET framework Configuration applicaiton to check the permissions.

    Let me know if this helped.

    Regards



  • Mateus Stock

    Hi Salvador,

    Thanks a lot for providing the clue.
    Do you know how to check the ASPNET permission on GAC


  • Could not load file or assembly 'vcWebCore' or one of its dependencies. The system cannot find the file specified.