【问题标题】:How to build a .sln file using mdtool on OS X如何在 OS X 上使用 mdtool 构建 .sln 文件
【发布时间】:2015-08-30 12:09:12
【问题描述】:

我正在尝试在 /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.

【问题讨论】:

    标签: macos xamarin monodevelop steambot mdtool


    【解决方案1】:

    我假设您使用的是来自 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 的引用。

    【讨论】:

    • 非常感谢您的帮助和时间,现在可以使用了!我已经以为我永远不会让它工作,但多亏了你,它现在可以工作了。非常感谢!
    【解决方案2】:

    问题在于您有效地双重转义了空间。将带有空格的命令用双引号括起来,或者在每个空格前面加上反斜杠,但不能同时使用!

    使用以下任何一种:

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

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

    【讨论】:

    • 我都试过了,但一直收到这个错误:"/&lt;Path&gt;//SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /&lt;path&gt;/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/Users/Johannes/SteamBot-master/" bash: /.../SteamBot-master/.nuget/../.ci/exec-with-retry.sh: No such file or directory /.../SteamBot-master/.nuget/NuGet.targets: error : Command 'bash "/.../SteamBot-master/.nuget/../.ci/exec-with-retry.sh" /.../exited with code: 127. 文件似乎丢失了
    • 哎呀!请点击原始问题下方的edit 并将所有额外信息粘贴到其中,以便每个人都能看到正确的格式并轻松阅读。
    • 完成!很抱歉给您带来不便。
    猜你喜欢
    • 2017-02-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-16
    • 2017-02-11
    • 1970-01-01
    • 2015-05-22
    相关资源
    最近更新 更多