ERROR: Another instance is running

Hi, I'm trying to build a hello world in VS 2010 (Ultimate) to run on my mac.

Whenever I load the project, in the Output window I get this:
[2013-02-28 21:12:55.5] ERROR: Another instance is running
[2013-02-28 21:12:56.2] ERROR: Another instance is running

When I try to debug, VS appears to hang. Attached is a screenshot of when I click "Diagnose".

It always stops at "Checking for a valid connection to the server". The actions suggest a 2nd instance of Visual Studio is connected, but I don't have another instance open on the PC. Xamarin Studio isn't running on the Mac.

The two machines are on the same network, firewall is disabled, and obviously the other steps like "Resolving Mac Server IP Address" and "Connection to Mac server" is passing.

Suggestions on how to compile and run this??

Posts

  • (attached file)

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hi @ChristianPayne

    Please ensure that there is no mtbserver running on Mac.
    (You can check with ActivityMonitor and Kill it)

    You can check if the server state running a telnet command on Mac

    Remember: Only one instance of Visual Studio is allowed, ensure there is no hidden devenv process on your Windows.

    Thank you.

  • Hi @Jarina,

    Thanks for your reply.

    I killed mtbserver, obviously it restarted each time I tried to run.

    I was able to telnet on my mac. My guess that the mac is configured correctly.

    Is Visual Studio trying to connect twice?

    [2013-03-01 07:25:35.0] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
    [2013-03-01 07:25:35.6] ERROR: Another instance is running

    From what I can tell, the first line shows Visual Studio is connecting, but what causes the 2nd?

    Attached is a screenshot of task manager. The only instance of visual studio is the one I'm running. I'm on a home network, so there isn't a 2nd instance connecting elsewhere.

    So it's the same problem as before, failing at "Checking for a valid control connection"

    Thanks,

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    I can't understand why.

    Could you try.

    Uninstall Xamarin.iOS for Visual Studio (http://screencast.com/t/CDC0X2iQi)

    Install the Xamarin.iOS for Visual Studio (http://download.xamarin.com/MonoTouchforVisualStudio/Windows/mtvs-1.0.897.0.msi)

    And make a screencast of your issue?

    Thank you.

  • ChristianPayneChristianPayne USMember

    lol - me neither!

    For what it's worth, your screen capture has Xamarin 1.1, the link above takes me to 1.0

    Here's a screen capture of what I've tried:

    Is it likely something else is conflicting (Dropbox, Mozy backup etc.?)

    Thanks @Jarina,

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hi @ChristianPayne

    This is very weird.

    Looks like another software is connecting to the port 5000 on the Mac, what is causing the error "another instance running"

    When you start your mac, before start your PC, is there some mtbserver running?
    When you start your PC (before open Visual Studio), is there some mtbserver running?
    When you open Visual Studio (before open any project), is there some mtbserver running?

    Thank you.

  • ChristianPayneChristianPayne USMember

    I took drastic measures and reinstalled Windows - I thought with all my Visual Studio addins etc. something might have conflicted.

    So clean installed with Windows 8 & VS 2010 & 2012 - same problem.

    mtbserver is only running either when a Visual Studio IOS solution is open or via telnet.

    I shutdown both the mac & pc, started mac (no mtbserver), opened Visual Studio (no mtbserver). Opened a non IOS solution (no mtbserver). Opened the hello world, mtb is running.

    I took a screencast with wireshark running - http://www.screencast.com/t/HqsDg5jO

    (This was using telnet to connect)

    One thing I noticed that is different to mine and yours, is that I only see the first line:
    Apple SDK developer root: /Applications/Xcode.app/Contents/Developer

    Not the second one...
    Server IP Address etc. etc.

    I'm pretty confident the cause is on the mac side, just not sure what to do.

    Any suggestions @Jarina?

    Cheers,

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hello @ChristianPayne

    Can you try this:

    and type:

    HELO
    

    After that, you should see something like:

    MTBSERVERPORTS:64881
                    Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
        Server IP Address : 10.211.55.2
    

    What is your output?
    Thank you.

  • ChristianPayneChristianPayne USMember
    edited March 2013

    Hi @Jarina,

    Note sure if you included the correct link or not? For what it's worth, the telnet link to me to a "Troubleshooting #2" page.

    I took a screencast:

    I can confirm, MTBServer wasn't running when I started. It was running at the end.

    Cheers,
    Christian

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Sorry wrong link :)

    Your YouTube video is private. I think jing is the best tool for screencasts

  • ChristianPayneChristianPayne USMember

    Sorry, fixed the permissions.

    On my mac, I installed Xamarin studio. I noticed Mono Develop was still installed. Is that a possible source of conflict?

    I followed the steps here to uninstall it: http://monotouch.2284126.n4.nabble.com/Howto-uninstall-td4180855.html

    But still get the same results as described above...

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Is quite weird.

    Looks like your mtbserver freeze when trying to get the Peer Addres.

    Could you try this:

    • Open the Terminal.
    • type csharp.
    • Paste this code:

      System.Console.WriteLine (System.Net.Dns.GetHostEntry ("eyeBook").AddressList[0].ToString());
      
    • Replace eyeBook with your Mac host name.

    http://screencast.com/t/4MRj9plB

  • ChristianPayneChristianPayne USMember
    edited March 2013

    Yes, that's how I would describe it - it just freezes!

    Link to a screencast of the above steps:
    http://screencast.com/t/1eTSmXtP

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    I know this sounds silly.

    But could you try to change your mac name and try again?

    Can you try call:

    System.Console.WriteLine(System.Net.Dns.GetHostName ());
    

    Also remove your log file :

    sudo rm -f ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log
    

    And tail the log:

    touch  ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log
    tail -f ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log
    

    Open a new terminal and try connect from the telnet again ?

  • ChristianPayneChristianPayne USMember

    Hi @Jarina,

    Renaming the mac had the same affect - it hangs.

    I've run the commands you've suggested, interesting, the "tail" command seems to hang. You can see it in the screencast: http://screencast.com/t/OkvKsCtk

    Last login: Wed Mar  6 07:53:34 on ttys000
    192-168-1-110:~ christian$ sudo rm -f ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log
    192-168-1-110:~ christian$ touch  ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log 192-168-1-110:~ christian$ tail -f ~/Library/Logs/Xamarin/MonoTouchVS/mtbserver.log
    [06-Mar-2013 07:59:36] Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
    

    I didn't include it, but the result of:
    System.Console.WriteLine(System.Net.Dns.GetHostName ());

    is

    csharp
    192-168-1-110:~ christian$ csharp
    
    Mono C# Shell, type "help;" for help
    
    Enter statements below.
    csharp>  
    csharp> System.Console.WriteLine(System.Net.Dns.GetHostName ());
    192-168-1-110.tpgi.com.au
    csharp>  
    

    Cheers,

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hi @ChristianPayne

    I think after change your host name you should restart your Mac.

    There is definitely something wrong with your Mac (Network/Name resolution).
    Your bash does not show your Machine name, instead, it shows your IP

     192-168-1-110
    

    And this is probably confusing the mtbserver:

    Try this:

    • Rename your Mac on System Preferences > Sharing (and reboot after that)

    • Check if your HostName key is the name you set on:

      /Library/Preferences/SystemConfiguration/preferences.plist (System ▸ System ▸ HostName) 
      
    • Check if you have HOSTNAME environment variable:

      #>echo $HOSTNAME
      
    • Check if System.Net.Dns.GetHostName is returning your host name properly.

    • Check if System.Net.Dns.GetHostEntry (Dns.GetHostName ()).AddressList[0] is returning your right IP address.

  • ChristianPayneChristianPayne USMember

    I think we're making some progress!

    laptop-mac:~ christian$ csharp
    Mono C# Shell, type "help;" for help
    
    Enter statements below.
    csharp> System.Console.WriteLine(System.Net.Dns.GetHostName ());
    laptop-mac.local
    csharp> System.Console.WriteLine( System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName ()).AddressList[0]);
    192.168.1.110
    csharp>  
    

    Now if I telnet:

    laptop-mac:~ christian$ telnet laptop-mac.local 5000
    Trying 192.168.1.110...
    Connected to laptop-mac.local.
    Escape character is '^]'.
    Apple SDK developer root: /Applications/Xcode.app/Contents/Developer
    Server IP Address : 192.168.1.110
    helo
    MTBSERVERPORTS:51255;51265
    

    (I get the same result if I telnet locally or from the Windows PC.)

    But in Visual Studio, I still get the error:

    Visual Studio

  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    Hmmm..your mtbserver is showing two ports, this seem to be a old mtbserver.

    Could you type:

    /Developer/MonoTouch/usr/bin/mtouch --version
    
  • ChristianPayneChristianPayne USMember
    Last login: Wed Mar  6 13:08:20 on ttys001
    laptop-mac:~ christian$ /Developer/MonoTouch/usr/bin/mtouch --version
    mtouch 6.0.10.1359404674
    laptop-mac:~ christian$ 
    
  • ViniciusJarina.0630ViniciusJarina.0630 BRXamarin Team Xamurai

    This is not the latest version

    You should download the latest from

    http://download.xamarin.com/MonoTouch/Mac/monotouch-6.2.0.65.pkg

  • ChristianPayneChristianPayne USMember

    Woo hoo!

    Job done! Thank you very much for your help!!!

    So to summarise:

    • The Mac machine name somehow got stuck. I didn't match. I had to make sure:

      System.Console.WriteLine (System.Net.Dns.GetHostEntry ("mymachine").AddressList[0].ToString());

    worked

    • Old version of Monotouch - update to latest version

    Thanks again @Jarina,

Sign In or Register to comment.