Yanıt BHO not loaded on 64bit IE on Windows 7 64bit

  • 21 Ekim 2011 Cuma 05:37
     
     

    Hi,

    I've developed a managed IE extension (BHO) using C# and MS Visual Studio 2010. The extension is very simple and works well on 32bit IE. But when I try to install it on a 64bit IE, the installer runs fine, but then when I go to IE -> Tools -> Addons my BHO is not found in there. I build my DLL with setting "For any CPU". The installer is build for "x86" platform. I use the following registry keys to register my BHO:

    public const string BHO_REGISTRY_KEY = @"Software\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects";

    public const string BHO_REGISTRY_KEY_64 = @"Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects";

    At first I was using only the first one but then after reading through some internet posts, I've added the second one as well. Some people say I should build a 64bit version of my DLL, but when I do that I got this exception during install:

    Error 1001. Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 

    Please, help me find out my problem. I use IE8 for testing.

    Thank you

Tüm Yanıtlar

  • 21 Ekim 2011 Cuma 16:58
     
     

    You have a 32bit BHO that cannot be loaded into a 64bit process.

    Try build two versions, one 32bit and one 64bit.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
  • 21 Ekim 2011 Cuma 20:26
     
     

    As I said, I've already done that. And it results in this error: 

    Error 1001. Exception occurred while initializing the installation: System.BadImageFormatException: Could not load file or assembly 

    As far as I know the 64bit IE uses virtualization an can load 32bit BHO. I guess my problem is related to registry settings or access permissions but could not figure it out.

    Why developing for IE should be so hard? It is so easy for Firefox and Chrome. 

  • 21 Ekim 2011 Cuma 21:10
     
     Yanıt
    If you already compiled two versions than something wrong in your registration process. Did you register your 32bit BHO using a 32bit program and the 64bit BHO with a 64bit program?

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
  • 23 Ekim 2011 Pazar 12:12
     
     

    I use regasm to register my BHO. The IE 64bit uses virtualization to load 32bit BHO. I've tested that on VMWare image and it works. The problem is that it works on some systems, but on others not. The problem is that on systems that do not work, no addons at all are loaded into the IE. I have installed Skype addon and it is visible in the IE 32bit but not in IE 64bit. It is some problem with the permission settings I guess but I cannot find out what.


    • Düzenleyen Inacent 23 Ekim 2011 Pazar 14:14
    •  
  • 23 Ekim 2011 Pazar 14:15
     
     Yanıt

    I found the problem. I should build x64 dll and register it with x64 bit regasm.

     

    Thank you

  • 28 Haziran 2012 Perşembe 11:18
     
     

    hi,

    I have encountered the same problem as you. I "build x64 dll and register it with x64 bit regasm". But I still cannot find it in IE9. My code came from http://www.codeproject.com/Articles/19971/How-to-attach-to-Browser-Helper-Object-BHO-with-C. The follows are what I have done:

    1, I changed the "Platform target" from "Any CPU" to "x64 in property setting.

    2, I built the project and got BHOHelloWorld.dll.

    3, I ran  "RegAsm.exe /codebase BHOHelloWorld.dll" in the terminal. It displayed "Types registered successfully".

    But I cannot find the add-on in IE9. I don't know what's wrong with it? I have spent much time on it.

    Please, help me!

    Thank you

  • 15 Ekim 2012 Pazartesi 09:57
     
     

    Have you find any solution ?

    I am with the same problem ???