Problems registering assembly for COM

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Phil

    #1

    Problems registering assembly for COM

    VB2005
    I have created a class library project.
    I have created a class using the COM class template.
    In the Application tab under My projects if I click on Assembly Information,
    the 'Make assembly COM-visible' box is checked.
    In the Compile tab the 'Register for COM Interop box is checked.
    In the Signing tab the 'Sign the assembly' box is checked, and I have
    created a .snk file.
    The Delay sign only box is not checked.
    I have built the project and checked that I can reference and use it from
    VBA project on my machine.
    I have copied the dll onto another machine and issued the following command:

    regasm mydll.dll /tlb:mydll.tlb /codebase

    This appears to run successfully.

    When I try to use the dll from a VBA project on this machine, I can add the
    reference OK, and it shows up in the object browser, but when the code runs
    I get an error saying that the assembly or one of it's dependencies cannot
    be found.

    Any ideas?
    TIA
    Phil.


  • Walter Wang [MSFT]

    #2
    RE: Problems registering assembly for COM

    Hi Phil,

    Based on my experience, such error is usually caused by some dependent
    assemblies cannot be loaded by your assembly. You can either use Reflector
    (http://www.aisto.com/roeder/dotnet/) to open your assembly and see which
    referenced assemblies are missing or you can use Assembly Binding Log
    Viewer (fuslogvw.exe)
    (http://msdn2.microsoft.com/en-us/lib...c4(VS.80).aspx) to know
    which assemblies are failing to load.

    Hope this helps.


    Regards,
    Walter Wang (wawang@online. microsoft.com, remove 'online.')
    Microsoft Online Community Support

    =============== =============== =============== =====
    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.
    =============== =============== =============== =====

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Comment

    • Phil

      #3
      Re: Problems registering assembly for COM

      Based on my experience, such error is usually caused by some dependent
      assemblies cannot be loaded by your assembly. You can either use Reflector
      (http://www.aisto.com/roeder/dotnet/) to open your assembly and see which
      referenced assemblies are missing or you can use Assembly Binding Log
      Viewer (fuslogvw.exe)
      (http://msdn2.microsoft.com/en-us/lib...c4(VS.80).aspx) to know
      which assemblies are failing to load.
      Thanks, There shouldn't be any dependencies other than the standard VB
      runtime stuff, as I haven't added any references in this project. Other VB
      applications have been installed on that machine in the past, so I assumed
      everything needed would all be there already.
      I expect if I build a proper deployment package it will work, but this was
      just a quick test to see if I can access some of my code from VBA. It would
      have been much easier and quicker to simply recompile my code in VB6, but I
      shall persevere with the new more complicated ways of doing the simple
      things in .NET.

      Cheers,
      Phil.


      Comment

      • Walter Wang [MSFT]

        #4
        Re: Problems registering assembly for COM

        Have you tried the Assembly Binding Log Viewer, maybe it could give us some
        clue.


        Regards,
        Walter Wang (wawang@online. microsoft.com, remove 'online.')
        Microsoft Online Community Support

        =============== =============== =============== =====
        When responding to posts, please "Reply to Group" via your newsreader so
        that others may learn and benefit from your issue.
        =============== =============== =============== =====

        This posting is provided "AS IS" with no warranties, and confers no rights.

        Comment

        Working...