locked
"System Cannot Find Specified File."

    Question

  • Okay.  I've looked through all the posted questiones, and I could find an answer to my situation.  So here it is:

    I've developed a class using VS 2003/VB.NET using the .NET 1.1 framework that presents an object model for a specific XML document.  This class has properties, methods, and events.  I've exposed the class to COM InterOp and compiled it and tested the interface on the development PC.  Everything is great and happy with the world.  It works just like it's supposed to and I couldn't be happier.

    Then my world came crashing down when I tried to deploy this same DLL to another machine to make sure everything was good there.  I copied the DLL to the target machine.  I registered the DLL using regasm.exe on the target box using the /tlb[:filename] switch.  It reports back that it registered all types successfully.  Then when I go into Excel's VBA and try it out, I can add the reference, the intellisense works, but when I execute it chokes on the New declaration with the error message:  "System cannot find the specified file."

    Now I thought that I might be using another custom class as a reference within the DLL that I'm trying to work with, but that's not the case.  In this one, I'm only using System.* references.

    I'm stumped, and I hope that someone will know a possible answer.

    Thanks for all the assistance.

    Friday, January 19, 2007 3:35 PM

Answers

  • For avoid that you must use RegAsm in this way:

     

    RegAsm.exe yourdll.dll /ylb:yourdll.tlb /codebase

     

    /codebase generates the necesary entries in the registry pointing to your dll.

    Remember to unregister first for avoid stupid problems later.

    hope this works for you too.

    Saturday, January 20, 2007 5:35 PM

All replies

  •  

    Hi,

    Have you tried putting a copy of the DLL in both of these folders? >>

    C:\Windows\System

    and

    C:\Windows\System32

    Then restart the PC you are having trouble with?

    You may need to put the full path to the DLL in your application too.

     

    Regards,

    S_DS

     

    Saturday, January 20, 2007 5:15 PM
  • For avoid that you must use RegAsm in this way:

     

    RegAsm.exe yourdll.dll /ylb:yourdll.tlb /codebase

     

    /codebase generates the necesary entries in the registry pointing to your dll.

    Remember to unregister first for avoid stupid problems later.

    hope this works for you too.

    Saturday, January 20, 2007 5:35 PM
  •  

    i encouneterd this problem after using "regasm" for registering DLL files compiled with .net framework.

    i needed to use them in an ms access MDE and an VB6 application.

     

    i wanted to use a batch file to deploy the DLL files to a client (customer) machine.

     

    i had no luck until i saw your comment about: /codebase

     

    this flag solved the problem for me.

    thank you very much!

     

    Sunday, October 28, 2007 2:45 PM