locked
Converting a VB6 dll to VB.net and referencing in VS2005 RRS feed

  • Question

  • User2018219762 posted

    I was directed to update an old VB6 dll to VB .net as we are moving away from COM objects.  The dll contains one function that does a bunch of high math calculations.  I opened up a new class project in VS 2005, Imported System.Math, and then basically copied the function code from the VB6 project into the new class.  When compiling, I made the assemble COM-Visible and also checked the Register for COM Interop in the project properties.  I then copied the dll and tlb files to Windows/system32 and tried to register using Regasm.exe.  Even though I'm using the correct version for .Net 2, I still get error RegAsm : error RA0000 : Failed to load 'C:\WINDOWS\system32\eagetairmiles.dll' because it is not a valid .NET assembly.  When attempting to add a reference to it in my new .Net project, I see it in the COM tab - but in the location it was developed in, and I receive the following error: Converting the type library to a .Net assembly failed.  Type library mydllname was exported from a CLR assembly and cannot be re-imported as a CLR assembly.

    I did all this by following directions from various resources found via a Google search.  I have no idea how to make this work, or what harm I may have caused hacking at it all day.  Any assistance would be appreciated!

    Thursday, June 30, 2011 11:28 AM

All replies

  • User-1659704165 posted

    Hi,

    There is No Substitue for Logic.

    Better Option Would Be Try to understand Logic of Vb6.0 and Then Write Code in .Net

    Donot try to Blindly Copy The Code of Vb and Try to use in .net.

    Go Slow Step by Step 1 by 1.

    it will help You in Long Run.

    as far Registering of Dll is Concern of .net dll you have to do "Gacutil" for That.

    Thursday, June 30, 2011 12:35 PM
  • User2018219762 posted

    I completly understand the logic in the old dll - it is a math calculation for air miles.  The project compiles as I expected it would.  This has nothing to do with my question.  What the heck is Gacutil?

    Thursday, June 30, 2011 12:50 PM
  • User-370644568 posted

    Gacutil is used to add assembly to Global Assembly Cache.

    Wednesday, July 27, 2011 12:27 AM