locked
Issue Loading Assemblies From The GAC RRS feed

  • Question


  • Hello everybody,

    Apologies for the first post of this message, the truth is this has been driving me crazy all day.

    I've been trying to get a .net assemble (Foo) to access the Microsoft CAPICOM Active X control. Foo needs to sit on our remote server, so I've created an Interop assemble for CAPICOM on the remote server
    and moved it down to my development machine where it has been included into the Foo project.

    After compiling and moving Foo up to the server, I then registered Foo and Interop.CAPICOM into the GAC. Whenever Foo makes a call to CAPICOM a FileNotFoundException occurs (Why, I thought that the GAC was the first place the CLR looked!).


    Code Snippet

    System.IO.FileNotFoundException: Could not load file or assembly 'Interop.CAPICOM, Version=2.1.0.0, Culture=neutral, PublicKeyToken=da1125fb4c0e0e06' or one of its dependencies. The system cannot find the file specified.
    File name: 'Interop.CAPICOM, Version=2.1.0.0, Culture=neutral, PublicKeyToken=da1125fb4c0e0e06'
       at ******.******.DeCrypt(String ******)
       at ******.******.******(String ******)

    === Pre-bind state information ===
    LOG: User =******
    LOG: DisplayName = Interop.CAPICOM, Version=2.1.0.0, Culture=neutral, PublicKeyToken=da1125fb4c0e0e06
     (Fully-specified)
    LOG: Appbase = file:///c:/windows/system32/inetsrv/
    LOG: Initial PrivatePath = NULL
    Calling assembly : e2ehccm2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=2311e435f36c58f6.
    ===
    LOG: This bind starts in default load context.
    LOG: No application configuration file found.
    LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: Interop.CAPICOM, Version=2.1.0.0, Culture=neutral, PublicKeyToken=da1125fb4c0e0e06
    LOG: The same bind was seen before, and was failed with hr = 0x80070002.


    • Moved by jack 321 Monday, June 2, 2008 8:27 AM off topic
    Wednesday, May 28, 2008 4:06 PM

Answers

All replies

  • Is Interop.CAPICOM dll referenced in your project?

    Wednesday, May 28, 2008 6:43 PM
  •  AlexBB wrote:

    Is Interop.CAPICOM dll referenced in your project?



    Yep, the Interop assembly was generated on the production server using tlbimp.exe, and then moved to my development machine and included into the Foo project.

    I also made sure to include a
    namespace declaration inside the class file which calls CAPICOM.

    Code Snippet

    using CAPICOM;


    Wednesday, May 28, 2008 7:58 PM
  • I am very sorry for being pestySmile but:

     

    Do you have it under References in your project in the Solution Explorer? Your answer seems to indicate that you did it but just in case. If you did it don't bother responding. It will be assumed to be done.

     

    If everything has been done I don't quite understand why it fails.

     

    Are you able to do it in Debug mode? If you can do it in debug then there might be a parameter somewhere that do something to this effect. I am no quite familiar with it but I have a vague recollection that some sort of a switch could be needed. There are more knowledgeable people than me who can help.

     

    Another thing you can do is to include an additional path that points to this assembly in your project. You can do it in VS2008. You can add more than one.

     

    Wednesday, May 28, 2008 9:05 PM
  • Yes the assemble is under references.
    Thursday, May 29, 2008 7:58 AM
  • This was moved out of the forum.

    You can ask this question in another forum.

    Or I can move this to a specific forum if you'd like.

    Thanks!


    Ed Price a.k.a User Ed, Microsoft Experience Program Manager (Blog, Twitter, Wiki)
    Sunday, January 8, 2012 5:44 AM