locked
Updated DLL caused the error : (are you missing a using directive or an assembly reference?)

    Question

  • Hi,

    I have used two DLL files which are protected by a dongle, they are named : 'IndexAuto.dll', and 'SearchAuto1.dll'.

    The first version of them was 32 bit and was protected by a dongle that works only on Windows xp 32 bit.

    I was using it on the Visual Studio 2008, .Net Framework 3.5, and it was worked well.


    However, I asked the producer to give me a new dongle that works on an x64 system, since I must work on it to upgrade some tools that could not be work on x86.

    Now I have the new dongle with its new DLLs. The dongle is defined on the x64 system , and the DLLs are still 32 bit.

    BUT, I have a lot of errors during running the program, all of them related to the new DLLs.

    All the steps that I follow to use them as as follows:

    My new framework now is:

    • Windows 7, Home Premium , x64
    • Visual Studio 2010

    I did the following steps in order to reference the DLLs

        Verified that the dongle is defined on the system
        Opened the Cmd as administrator and wrote the command:

                  C:\windows\SysWOW64\regsvr32 f:\IndexAuto.dll
                  C:\windows\SysWOW64\regsvr32 f:\SeaAuto1.dll
            The Dlls registered successfully, and I found them at regedit

        Opened the Visual Studio 2010 tools, and run its command prompt as administrator to write the command:

                c:\program files (x86)\Microsoft Visual Studio 10.0\ VC> tlbimp f:\ IndexAuto.dll
                            That gives me the message:
                           "TlbImp : Type library imported to IndexAuto.dll"
                HOWEVER, when I implied it on SearchAuto as:

               c:\program files (x86)\Microsoft Visual Studio 10.0\ VC> tlbimp f:\ SearchAuto1.dll
               That gives me the message:
                "TlbImp : error TI1002 : the input file f:\SearchAuto1.dll" is not a valid type library"

        I copied the created IndexAuto.dll file at the directory:

               C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
            into :
               C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\IndexAuto.dll
           
              and then remove my old reference in the application and refere to the new file from the list of .NET references. Note that the new SearchAuto1.dll file can't be referenced due to the previously declared problem. So I leave the old reference as it is.

        NOW, when I try to build the project, I get a lot of error messages. Some of them are:

    "Error    3    The type or namespace name 'SearchAuto1' could not be found (are you missing a using directive or an assembly reference?)  "

    "Error    4    The type or namespace name 'SearchClass' could not be found (are you missing a using directive or an assembly reference?)"

    "Error    6    'IndexAuto.IndexerClass' does not contain a definition for 'AddPageBstr' and no extension method 'AddPageBstr' accepting a first argument of type 'IndexAuto.IndexerClass' could be found (are you missing a using directive or an assembly reference?)"

    "Error    7    'IndexAuto.IndexerClass' does not contain a definition for 'DeInitialize' and no extension method 'DeInitialize' accepting a first argument of type 'IndexAuto.IndexerClass' could be found (are you missing a using directive or an assembly reference?) "

    "Error    11    'IndexAuto.IndexerClass' does not contain a definition for 'Initialize' and no extension method 'Initialize' accepting a first argument of type 'IndexAuto.IndexerClass' could be found (are you missing a using directive or an assembly reference?)"

    "Error    174    Interop type 'IndexAuto.IndexerClass' cannot be embedded. Use the applicable interface instead."

    "Error    24    The type 'IndexAuto.IndexerClass' has no constructors defined"

    NOTE: I have some other files attached with the Dlls, I put all of them at the bin directory of the project that reference them.

    Please help me to solve the problem.
    Thanks so much in advance.
    Cheers.



    Aya Zoghby

    Monday, December 31, 2012 7:48 AM

Answers

  • Thank you  so much, and I have solved the problem as follows:

    1- The produced send me the .tlb files to be used with the 'tlbimp' instead of the .dll files.

    2- I changed the platform of the project to be 'X86' rather than 'Any CPU'

    Regards.

    Aya.


    Aya Zoghby

    • Marked as answer by ZoghbyAya Tuesday, January 01, 2013 10:55 AM
    Tuesday, January 01, 2013 10:54 AM

All replies

  • Hi Aya,

    Please try your application without dongle.

    Generally, An 32bit application can only refer the 32bit references, and 64bit application can only refer the 64bit references.

    When this way works, there should be related to the dongle, and visit its official site, please.

    Thank you.


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, January 01, 2013 2:20 AM
    Moderator
  • Thank you  so much, and I have solved the problem as follows:

    1- The produced send me the .tlb files to be used with the 'tlbimp' instead of the .dll files.

    2- I changed the platform of the project to be 'X86' rather than 'Any CPU'

    Regards.

    Aya.


    Aya Zoghby

    • Marked as answer by ZoghbyAya Tuesday, January 01, 2013 10:55 AM
    Tuesday, January 01, 2013 10:54 AM