How to build a .sln file using mdtool on OS X

1.9k Views Asked by At

I'm trying to compile a .sln file within /SteamBot-master/SteamBot.sln. After research I found out that I can only use mdtool within the mdtool directory within Xamarin Studio. So what I enter into the Terminal is the following:

"/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool" -v build SteamBot-master/SteamBot.sln

This is the error message I get:

-bash: /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool: No such file or directory

The mdtool.exec application is within the MacOS file, I already checked that. When I try to run the application within Xamarin Studio, I get the following error:

/Users/Johannes/SteamBot-master/.nuget/NuGet.targets: Error: Command 'bash "/Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /Users/Johannes/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source ""  -RequireConsent -solutionDir "/Users/Johannes/SteamBot-master/"' exited with code: 127. (SteamTrade)

I'd really appreciate if someone could help me fix this so I can use the application. Thank you very much in advance, and I apologize for my lack of programming knowledge.

Edit: New Error Message

jo-macbook:~ Johannes$ /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -v build SteamBot-master/SteamBot.sln
Xamarin Studio Build Tool
Projektmappe /Users/Johannes/SteamBot-master/SteamBot.sln wird geladen
   Projektmappe /Users/Johannes/SteamBot-master/SteamBot.sln wird geladen
      Loading projects ..
Erzeuge Projektmappe: SteamBot (Debug)
   SteamTrade (Debug) wird erzeugt

      Build started 30.08.2015 14:59:16.
      __________________________________________________
      Project "/Users/Johannes/SteamBot-master/SteamTrade/SteamTrade.csproj"
      (Build target(s)):

        Target RestorePackages:
            Executing: bash
      "/Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono
      --runtime=v4.0.30319 /Users/Johannes/SteamBot-master/.nuget/NuGet.exe
      install "packages.config" -source ""  -RequireConsent -solutionDir
      "/Users/Johannes/SteamBot-master/"
            bash: /Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh:
      No such file or directory
      /Users/Johannes/SteamBot-master/.nuget/NuGet.targets: error : Command
      'bash "/Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh"
      mono --runtime=v4.0.30319
      /Users/Johannes/SteamBot-master/.nuget/NuGet.exe install
      "packages.config" -source ""  -RequireConsent -solutionDir
      "/Users/Johannes/SteamBot-master/"' exited with code: 127.
        Task "Exec" execution -- FAILED
        Done building target "RestorePackages" in project
      "/Users/Johannes/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED

      Done building project
      "/Users/Johannes/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED

      Build FAILED.
      Errors:

      /Users/Johannes/SteamBot-master/SteamTrade/SteamTrade.csproj (Build) ->
      /Users/Johannes/SteamBot-master/.nuget/NuGet.targets (RestorePackages
      target) ->

        /Users/Johannes/SteamBot-master/.nuget/NuGet.targets: error : Command
      'bash "/Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh"
      mono --runtime=v4.0.30319
      /Users/Johannes/SteamBot-master/.nuget/NuGet.exe install
      "packages.config" -source ""  -RequireConsent -solutionDir
      "/Users/Johannes/SteamBot-master/"' exited with code: 127.

         0 Warning(s)
         1 Error(s)

      Time Elapsed 00:00:00.1292110
/Users/Johannes/SteamBot-master/.nuget/NuGet.targets : error: Command 'bash "/Users/Johannes/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /Users/Johannes/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source ""  -RequireConsent -solutionDir "/Users/Johannes/SteamBot-master/"' exited with code: 127.
2

There are 2 best solutions below

1
On BEST ANSWER

I am assuming you are using the SteamBot source code from GitHub:

https://github.com/Jessecar96/SteamBot

The .ci/exec-with-retry.sh file is missing since this is part of the continuous integration build and it is not on GitHub.

Probably the simplest workaround is to edit the .nuget/NuGet.targets file and change the following line:

<RestoreCommand Condition=" '$(OS)' != 'Windows_NT' ">bash "$(NuGetToolsPath)\..\.ci\exec-with-retry.sh" $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(RequireConsentSwitch) -solutionDir "$(SolutionDirParsed)"</RestoreCommand>

To:

<RestoreCommand Condition=" '$(OS)' != 'Windows_NT' ">$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)"  $(RequireConsentSwitch) -solutionDir "$(SolutionDirParsed)"</RestoreCommand>

This just removes the reference to the file and to bash.

3
On

The problem is that you have effectively double-escaped the space. Either enclose a command with spaces in it inside double quotes, or put a backslash in front of each space, but not both!

Use either of these:

/Applications/"Xamarin Studio.app"/Contents/MacOS/mdtool ...

or

/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool ...