I have written a BHO in c# .NET target framework : 4.6.1 BHO is working fine with Visual Studio 2015 Community DEBUG Mode. But its not working while building in release mode (Platform target : Any CPU). Although I could see the add-on into manage add-on tab. IE version : 11.175.18362.0 Update version : 11.0.130 (KB4503259)
I have COM register/unregister functions as below
public static string RegBHO = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Browser Helper Objects";
public static string RegCmd = "Software\\Microsoft\\Internet Explorer\\Extensions";
[ComRegisterFunction]
public static void RegisterBHO(Type type)
{
string guid = type.GUID.ToString("B");
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegBHO, true);
if (registryKey == null)
registryKey = Registry.LocalMachine.CreateSubKey(RegBHO);
RegistryKey key = registryKey.OpenSubKey(guid);
if (key == null)
key = registryKey.CreateSubKey(guid);
key.SetValue("NoExplorer", 1);
registryKey.Close();
key.Close();
}
}
[ComUnregisterFunction]
public static void UnregisterBHO(Type type)
{
string guid = type.GUID.ToString("B");
// BHO
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegBHO, true);
if (registryKey != null)
registryKey.DeleteSubKey(guid, false);
}
// Command
{
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey(RegCmd, true);
if (registryKey != null)
registryKey.DeleteSubKey(guid, false);
}
}
Current System : Windows 10. I could see there are two instances of IE.One in Program Files(x86) and another in Program Files .
Post Build Event Commands that I have used as below (VS2015 opened in Admin Mode)
"%windir%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" /unregister "$(TargetDir)$(TargetFileName)"
"%windir%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe" "$(TargetDir)$(TargetFileName)"
"%windir%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" /unregister "$(TargetDir)$(TargetFileName)"
"%windir%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe" "$(TargetDir)$(TargetFileName)"
What I could find till now . I may need to register this dll with regsvr32.exe which I am not sure. But When I am going to do that its giving me an error.
The module is loaded but could not find any entry point
Can anyone please help me to release this BHO for both IE 64 & x86?
TIA :)