locked
regasm fails registering DLL RRS feed

  • Question

  • I am trying to build a DLL that contains a GUID CLSID with vs 2005 . It inherits from DirectShow base classes.

     When I build I get a message "assert failure line 388 g_hInst != o in .\dllsetup.cpp "
    If I click "continue " I get a message "Dll Register Server in .\Debug/Yuvgray.dll succeeded ". But the buildlog shows a message "error PRJ0019 : A tool returned an error code from "Registering DLL " .
    It  shows that regasm.exe failed. What can I do.?

    Previously, I registered a GUID which I call in the dll. Seems my register operation wasn't complete. The registry contains only the partial  GUID CSLID but it doesn't contain a Interface Identifier, or a version, or a library identifier. Are they necessary? Should they be in the registry?
    Tried using regasm.exe  instead of regsvr32.exe but it failed, too.
    Thanks for any helpful suggestions.


    Will



    Friday, May 29, 2009 5:35 PM

Answers

  • Hello Will,

    Thanks for your feedback!

    The Message "assembly is not a valid .NET assembly" indicates that our assembly is not valid. The Asssembly Registration Tool (Regasm.exe) reads the metadata in an assembly and adds the necessary entries to the registry, then we could use it as if it were a COM class. We could get more information about Assembly Registration Tool by clicking here.

    To generate a .NET .dll file in Visual Studio 2005, the most common way is:
     1. Open Visual Studio 2005
     2. Click File->New Project
     3. Choose Visual C# or Visual Basic on the left
     4. In the Templates panel on the right, choose Class Library project

    If you are more familiar with C++ language, please refer to the link below, it contains the detailed steps on how to create libraries using C++.
    http://msdn.microsoft.com/en-us/library/f3cye135(VS.80).aspx

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by liurong luo Thursday, June 25, 2009 8:55 AM
    Wednesday, June 3, 2009 3:22 AM

All replies

  • Hello Will,

    The Project Build Error "Error PRJ0019" may caused by:
     1. The tool returned an error code without error messages
     2. We have no previledage (run Visual Studio in an Administrator account) to complete the operation.
    For more information on the Error PRJ0019, please refer to: http://msdn.microsoft.com/en-us/library/yzk29wdw(VS.80).aspx

    Based on the above analysis, please run Visual Studio as an Administrator. If that could not solve the issue, please tell us more information:
     1. what the Operating System do we use?
     2. what kind of DLL project do we build? managed or native coded?
     3. do we custom the build steps or build event?

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    Monday, June 1, 2009 4:02 AM

  •  

    Hi Roahn:

     

    I am using XP home edition. I should also mention that I am renovating code samples from a vs2003 program to vs2005. The code is native.

     

    I do not customize the build step or the post-build event.

      I ran regasm.exe independently on the .dll file produced by the build, which gave a message “assembly is not a valid .NET assembly.”   So, the linker is not producing the correct file. I am going to build my dll completely from scratch on a new template. It will be managed.

    Which vs2005 template do I use to generate a ..NET  dll?

    Thanks for your help.

    Will

     

     

    Tuesday, June 2, 2009 3:36 PM
  • Hello Will,

    Thanks for your feedback!

    The Message "assembly is not a valid .NET assembly" indicates that our assembly is not valid. The Asssembly Registration Tool (Regasm.exe) reads the metadata in an assembly and adds the necessary entries to the registry, then we could use it as if it were a COM class. We could get more information about Assembly Registration Tool by clicking here.

    To generate a .NET .dll file in Visual Studio 2005, the most common way is:
     1. Open Visual Studio 2005
     2. Click File->New Project
     3. Choose Visual C# or Visual Basic on the left
     4. In the Templates panel on the right, choose Class Library project

    If you are more familiar with C++ language, please refer to the link below, it contains the detailed steps on how to create libraries using C++.
    http://msdn.microsoft.com/en-us/library/f3cye135(VS.80).aspx

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
    • Marked as answer by liurong luo Thursday, June 25, 2009 8:55 AM
    Wednesday, June 3, 2009 3:22 AM