Bug 9702 - [Windows8] 'Bonjour initialization failure' error popup displayed when user create or open iOS application on visual studio
Summary: [Windows8] 'Bonjour initialization failure' error popup displayed when user c...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 0.x Insider Preview
Hardware: PC Windows
: Normal minor
Target Milestone: 1.3.x
Assignee: Dominique Louis
URL:
: 12004 12119 ()
Depends on:
Blocks:
 
Reported: 2013-01-22 04:38 UTC by Saurabh
Modified: 2016-04-27 12:58 UTC (History)
9 users (show)

Tags: error improvement
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
VERIFIED FIXED

Description Saurabh 2013-01-22 04:38:48 UTC
Steps to reproduce this issue:
1. Install MTVS.
2. Create or open any iOS application.

Actual result: When user create or open any iOS project on Visual Studio, It gives an error pop up 'Bonjour initialization failure' and Build Host  dialog popup appears which is searching Mac server.

Expected result: User should able to create or open any iOS application and should able to connect to mac server.

Supplement info:
https://gist.github.com/4593117
http://screencast.com/t/Dn1AilLvsPl

Environment details:
Windows8(32 bit)
VS2012/2010
MTVS 1.0.716
Comment 1 Marek Habersack 2013-01-22 04:55:09 UTC
It is possible that the Bonjour service failed to start during installation. Windows Installer service should have offered to restart the machine in such case. Restarting Windows manually or starting the Xamarin Bonjour Service manually from the Control Panel should work as a fix.
Comment 2 PJ 2013-01-22 11:59:53 UTC
Looking at the screencast, we have a number of opportunities to tell the user the right actions to take here.

Either the diagnostic tool step or the bonjour error should tell the user to restart the service and/or restart their computer.
Comment 3 PJ 2013-01-22 12:00:36 UTC
Putting this on the Big Splash in case we can fix this with just a text update on the error message.

If not, please put to V2
Comment 4 Dominique Louis 2013-01-22 12:50:43 UTC
Pj Unfortunately the diagnostics does additional steps to determine networks issues.

I think it would provide a better UX, but in V2 where we can maybe use the diagnositics classes to determine if everything is ok first before instantiating ZeroConfDiscovery().

Jose any suggestions?

I'll move to Splash 2.
Comment 5 Jose Miguel Torres 2013-05-08 07:14:44 UTC
We need to know if Xamarin Bonjour Service is installed in the target machine.
Comment 6 Marek Habersack 2013-05-08 08:20:39 UTC
Jose, it won't be if Apple Bonjour exists
Comment 7 Marek Habersack 2013-05-08 09:09:12 UTC
*** Bug 12119 has been marked as a duplicate of this bug. ***
Comment 8 Marc K 2013-05-15 02:58:25 UTC
Is there a fix for this problem available?
I've tried to manually delete the registry keys which were related to the Bonjour Service and which haven't been deleted after uninstalling all Xamarin software.
This broke my Windows system and I had to use Windows Restore to go back to a working system snapshot. Now that I know that iTunes or other Apple Software is using Bonjour, I might have the reason why my system broke.
Comment 9 Dominique Louis 2013-05-28 05:57:09 UTC
We believe these issues are caused by the fact that there is a Apple/Xamarin Bonjour Service on the machine, but it may not be working correctly. For those with either not working, a repair may be in order.

So to that end the change I've just push for the iOS installer will check to see if Apple Bonjour is already installed. 
If it is installed and not running, before the installation finishes, it will attempt to start the service. 
If the service starts within 60 seconds, then we know Bonjour is running.
If the service failes in some way, a registry entry will be created in 
HKEY_LOCAL_MACHINE\SOFTWARE\Xamarin\iOS\IsBonjourInstalled That will list the state of the Bonjour and a message, hopefully explaining the issue.
In this scenario, the user will need to fix their Bonjour installation before using the iOS product on Windows.

If no Bonjour service is found, just as it does now, it should install a Xamarin Bonjour service, and start it before the installation completes.

The only other changes is that to avoid clashes with subsequent Bonjour installers, when Xamarin.iOS is uninstalled. It will leave the Bonjour Service behind, as we risk breaking things due to the fact that our and Apples use the same name. Using different names would cuase a responder conflict.
Comment 10 PJ 2013-05-28 11:19:24 UTC
Heyo Dominique, in your testing for the fix, were you ever able to reproduce this issue on command? (Aka, get into the "there is a Apple/Xamarin Bonjour Service on the machine, but it may not be working correctly" state?

I want to make sure we can properly verify the fix.
Comment 11 Marek Habersack 2013-06-04 11:07:38 UTC
*** Bug 12004 has been marked as a duplicate of this bug. ***
Comment 12 Saurabh 2013-07-15 11:52:56 UTC
Today, we have checked this issue with latest builds:

MTVS 1.3.227
Windows 8 and 7
VS 2010/12
X.iOS 6.3.8.5(Mac  Server)

Now, On creating iOS application on VS, it does not give error pop up 'Bonjour initialization failure'. User is able connect to mac server successfully and able to run application on mac server successfully.
Comment 13 Kate Johnson 2016-04-27 12:58:50 UTC
All the above messages seem to suggest that this problem has been fixed and yet here I am with this same problem.

Service 'Bonjour Service' failed to start.

How can I fix this?