Announcement

Collapse
No announcement yet.

Com Interop DLL cannot be found by VB.NET DLL

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Com Interop DLL cannot be found by VB.NET DLL

    Hi Gurus

    I wrote a "Active X" UserControl DLL in VB.NET and placed it on a iis 6 webserver. I embeded it with the object tag and the communication to functions and propertys in the vb.net control works great.

    As A reference I added the COM component UIRESOURCELib.dll in the Visual Studio 2005. When the DLL starts the functions from the UIRESOURCELib, i get the following error in the IE7

    ************** Exception Text **************
    System.IO.FileNotFoundException: Could not load file or assembly 'Interop.UIRESOURCELib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
    File name: 'Interop.UIRESOURCELib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
    at SoftwareCorner.Data.loadData()
    at SoftwareCorner.myControl.myControl_Load(Object sender, EventArgs e)
    at System.Windows.Forms.UserControl.OnLoad(EventArgs e)
    at System.Windows.Forms.UserControl.OnCreateControl()
    at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
    at System.Windows.Forms.Control.CreateControl()
    at System.Windows.Forms.Control.WmShowWindow(Message& m)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
    at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
    at System.Windows.Forms.UserControl.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    at System.Windows.Forms.Control.ActiveXImpl.System.Wi ndows.Forms.IWindowTarget.OnMessage(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



    The Application shall be executed on the client. UIRESOURCELib supports functions to connect to a System Management Server and get packages that are deployed to the users pc.

    the Interop.UIRESOURCELib.dll is in the same folder on the webserver as my DLL. My DLL is loaded into the GAC on the users PC but the Interop.UIRESOURCELib.dll does not show up there.

    Please help Have you got any idea what could cause the problem or what i can do to make my DLL recognize the UIRESOURCELib=?

    Best Regards,

    Kaysetoaster

  • #2
    i think the interop Assembly needs to be placed in the GAC also. And therefore it needs to be strongnamed.
    IIRC the project for your ActiveX control should have a Wrapper ... something ... key property where you can specify the strongname key file for the generated interop assembly.

    Comment


    • #3
      Strongname?

      Hi Ralf,

      sry ich spreche auch Deutsch . Um missverständnissen aus dem weg zu gehen: es handelt sich bei dem Control NICHT um ein ActiveX ocx, sondern um eine DLL die aus einem Windows Control Library Projekt generiert wurde.

      Als Wrapper habe ich ein CAB projekt erstellt, die generierten Dateien eingefügt und über ein INF -File bestimmt welche DLL die erste auszuführende ist. Hat aber leider nicht Funktioniert. Nehme mal an das geht nur mit OCX files.

      Wie kann ich denn einen Strongname erstellen? und wie kann ich festlegen, dass das UIResource - Interop - DLL mit in den GAC geladen wird?

      Grüße,

      Kaysetoaster

      Comment


      • #4
        Also um eine DLL in den GAC zu bekommen gehst du in die Systemsteuerung unter "Verwaltung" und dann z.B. auf "Microsoft .NET Framework 1.1 Configuration". Dann im linken Baum auf Arbeitsplatz und Assemblycache. Jetzt auf "Eine Assembly zum Assemblycache hinzufügen". Jetzt brauchst du deine DLL nur noch hinzufügen.
        Um einen Strongname zu erstellen fügst du zwisch <Namen der DLL> und .dll noch einen Punkt ein und einen weiter namen. (Also z.B. aus "active.dll" wird dann eben "active.strongname.dll"

        Comment

        Working...
        X