none
Referenced assembly 'AxInterop.MSComCtl2' does not have a strong name RRS feed

  • Question

  • Hi,

    I have converted my project from vb6 to VB.Net and so the attached MSCOMCTL.OCX file has been converted to AxInterop.MSComCtl2.dll, but when I try to build the .Net project, am getting the following error,

    Unable to emit assembly: Referenced assembly 'AxInterop.MSComCtl2' does not have a strong name

    Few other such OCX files have also been converted to AxInterop dlls (as below) for which no error has come.

    AxInterop.Threed.dll

    AxInterop.ComCtl3.dll

    I don’t know why am getting error only for this AxInterop.MSComCtl2.dll

    Please guide me to solve this issue.

    Note:

    Am using VS2008. Have my own signing key. I need to signing my application for sure.


    Thanks, Karthikeyan.V

    Monday, June 18, 2012 7:46 AM

Answers

  • Hi Icewar,

    Nice to see you.

    Since the error message is "Referenced assembly 'AxInterop.MSComCtl2' does not have a strong name", it indicates the assembly needs strong name, but now, it doesn't have.

    Please take a look at this similar thread:

    http://social.msdn.microsoft.com/forums/en-US/clr/thread/ce1b0aa5-bdeb-4b94-8739-629e0b9bf768 

    Try using aximp.exe instead of tlbimp.exe, it support OCX controls.  The IDE automatically uses strong names for wrappers if you add a reference *after* you've signed the project.  Doing it the other way around gives you unsigned wrappers.  Fix it by removing the references, then re-adding them.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 20, 2012 6:25 AM
    Moderator

All replies

  • I would recommend you to use .net base class libraries for serial communications in vb.net

    Take a look at this link. Would help you out.


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 8:07 AM
  • Hi Rohit,

    Am using 'AxInterop.MSComCtl2' for AxDTPicker functionality and not the serial communication.

    Also, am eager to know, why the error is coming for this specific dll alone and not for other OCX related converted dlls.


    Thanks, Karthikeyan.V


    Monday, June 18, 2012 8:42 AM
  • for replacing dtpicker, consider using DateTime Picker available in winforms, it would reduce external dependency in your project.

    http://social.msdn.microsoft.com/forums/en-US/clr/thread/e6a6be79-540d-49d0-a1cd-c188878ca823

    Strong Name Explained


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 9:14 AM
  • Yes, i know that. But still i need to know why the error is coming for this specific dll alone and not for other OCX related converted dlls.

    Thanks, Karthikeyan.V

    Monday, June 18, 2012 9:50 AM
  • Are you using 64bit OS? If yes, make sure it's registered correctly and working in your vb6.0 project. Then try to register using WOW technology of MS. The major difference with this common controls and other OCX is they were developed for 32 bit .

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 10:27 AM
  • Am using a 32-bit computer (OS is xp).

    Thanks, Karthikeyan.V

    Monday, June 18, 2012 10:29 AM
  • try the link I posted earlier by hitting "WOW"

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 10:33 AM
  • That link has steps to register this OCX file if we are using a 64-bit version. But am using windows-xp 32-bit.

    Thanks, Karthikeyan.V

    Monday, June 18, 2012 10:37 AM
  • No it's for 64 bit only. Check with first line of question "I receive the following error when trying to install the FLAC frontend on Windows 7 (64 Bit):"

     


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 10:41 AM
  • I too mean the same. That link does not help me.


    Thanks, Karthikeyan.V

    Monday, June 18, 2012 10:55 AM
  • Karthikeyan,

           Try manually doing all the process using tlbimp.exe and the /keyfile switch. Sometimes it just reference a COM object
    from the VS.NET IDE, it generates an interop wrapper, but doesn't use the /keyfile switch so it is not signed.

    Locate Common Control library "ComCtl32.dll" on your hard drive, then create the wrapper
    assembly with tlbimp

    tlbimp.exe ComCtl32.dll /keyfile:mykey.snk /out:interop.ComCtl32.dll

    Then add a reference to interop.ComCtl32.dll.


    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Monday, June 18, 2012 11:16 AM
  • Good, now the question raises...

    In my vb6 project both the OCX files are being referenced,  MSCOMCTL.OCX and MSCOMCT2.OCX

    I don't know why the auto generation of the related interop file is being named like 'AxInterop.MSComCtl2'

    So, if manualy needs to create the same file, then from which OCX file should i do that.

    MSCOMCTL.OCX or MSCOMCT2.OCX

    I have tried creating from both of these ocx files separately, when i add the corressponding dll, the required functionality itself throws compile errors.


    Thanks, Karthikeyan.V

    Monday, June 18, 2012 1:11 PM
  • Hi Icewar,

    Nice to see you.

    Since the error message is "Referenced assembly 'AxInterop.MSComCtl2' does not have a strong name", it indicates the assembly needs strong name, but now, it doesn't have.

    Please take a look at this similar thread:

    http://social.msdn.microsoft.com/forums/en-US/clr/thread/ce1b0aa5-bdeb-4b94-8739-629e0b9bf768 

    Try using aximp.exe instead of tlbimp.exe, it support OCX controls.  The IDE automatically uses strong names for wrappers if you add a reference *after* you've signed the project.  Doing it the other way around gives you unsigned wrappers.  Fix it by removing the references, then re-adding them.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 20, 2012 6:25 AM
    Moderator
  • Hi Mike Feng,

    Bingo... aximp.exe did it. Thank you very much.

    I have found the answer for my earlier question, out of the 3 interop dlls it has showed the AxInterop.MSComCtl2.dll as error for the 1st time. Once i have signned this and build my project then it showed one more similar interop dll from the remaining dlls. Indirectly we need to sign in all the interop dlls too.

    Thanks a lot.


    Thanks, Karthikeyan.V

    Wednesday, June 20, 2012 11:33 AM
  • Hi Icewar,

    You are welcome.

    I am glad your issue is gone.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 20, 2012 11:36 AM
    Moderator