2

I installed both Bonjour SDK for Windows v2.0.4 and Bonjour 3 for Windows 8 and 8.1 from Apple's website on my Windows 8.1 machine. When I try to use the Bonjour package in my C# code, the package is not recognized and I can't use the SDK. Any ideas why this would happen?

Edit: Turns out it was because Interop.Bonjour.dll was not among the References, so I added it and now I don't get the error. However, when I try to use a class of Bonjour package, like below:

DNSSDService service = new DNSSDService();

I get an exception with the message:

Creating an instance of the COM component with CLSID {24CD4DE9-FF84-4701-9DC1-9B69E0D1090A} using CoCreateInstanceFromApp failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Please make sure your COM object is in the allowed list of CoCreateInstanceFromApp.

My code is written for a Windows 8.1 Metro app if that helps.

halileohalilei
  • 2,220
  • 2
  • 25
  • 52
  • 1
    Can you elaborate on _When I try to use the Bonjour package in my C# code, the package is not recognized_? How do you use the package and how is it not recognized? – Martin Liversage Dec 11 '13 at 15:02
  • I add using Bonjour; along with others, and it gets underlined with the error: "The type or namespace name 'Bonjour' could not be found (are you missing a using directive or an assembly reference?)" – halileohalilei Dec 11 '13 at 15:09
  • 1
    You need to add a reference to the Bonjour SDK probably by browsing to the right assembly DLL (or it might be in the GAC). Adding a `using` statement in the source code does not add any references to your project. – Martin Liversage Dec 11 '13 at 15:17
  • Please see my edit above. – halileohalilei Dec 11 '13 at 15:26
  • Windows Store apps cannot load arbitrary COM objects. This is an arbitrary COM object, so it's not got permission to load – Anya Shenanigans Dec 11 '13 at 15:39
  • So, does that mean I can't use the Bonjour SDK on my Windows 8.1 Store apps? – halileohalilei Dec 11 '13 at 19:25

0 Answers0