2

我正在尝试在 /SteamBot-master/SteamBot.sln 中编译一个 .sln 文件。经过研究,我发现我只能在 Xamarin Studio 的 mdtool 目录中使用 mdtool。所以我进入终端的内容如下:

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

这是我收到的错误消息:

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

mdtool.exec 应用程序在 MacOS 文件中,我已经检查过了。当我尝试在 Xamarin Studio 中运行应用程序时,我收到以下错误:

/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)

如果有人可以帮助我解决此问题,我将非常感激,以便我可以使用该应用程序。提前非常感谢您,对于我缺乏编程知识,我深表歉意。

编辑:新的错误信息

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.
4

2 回答 2

2

我假设您使用的是来自 GitHub 的 SteamBot 源代码:

https://github.com/Jessecar96/SteamBot

.ci/exec-with-retry.sh文件丢失,因为这是持续集成构建的一部分,并且不在 GitHub 上。

可能最简单的解决方法是编辑 .nuget/NuGet.targets 文件并更改以下行:

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

至:

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

这只是删除了对文件和 bash 的引用。

于 2015-09-03T21:11:25.607 回答
0

问题是你已经有效地双重逃逸了空间。将带有空格的命令用双引号括起来,或者在每个空格前面放一个反斜杠,但不能同时使用!

使用以下任一:

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

或者

/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool ...
于 2015-08-30T12:29:03.680 回答