我正在尝试在 /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/Tom/SteamBot-master/.nuget/NuGet.targets: Error: Command 'bash "/Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /Users/Tom/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/Users/Tom/SteamBot-master/"' exited with code: 127. (SteamTrade)
如果有人可以帮助我解决这个问题,以便我可以使用该应用程序,我将非常感激。预先非常感谢您,对于我缺乏编程知识,我深表歉意。
编辑:新错误消息
tom-mac-pro:~ Tom$ /Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool -v build SteamBot-master/SteamBot.sln
Xamarin Studio Build Tool
Building SteamTrade (Debug)
Build started 30.08.2015 14:59:16.
__________________________________________________
Project "/Users/Tom/SteamBot-master/SteamTrade/SteamTrade.csproj"
(Build target(s)):
Target RestorePackages:
Executing: bash
"/Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono
--runtime=v4.0.30319 /Users/Tom/SteamBot-master/.nuget/NuGet.exe
install "packages.config" -source "" -RequireConsent -solutionDir
"/Users/Tom/SteamBot-master/"
bash: /Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh:
No such file or directory
/Users/Tom/SteamBot-master/.nuget/NuGet.targets: error : Command
'bash "/Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh"
mono --runtime=v4.0.30319
/Users/Tom/SteamBot-master/.nuget/NuGet.exe install
"packages.config" -source "" -RequireConsent -solutionDir
"/Users/Tom/SteamBot-master/"' exited with code: 127.
Task "Exec" execution -- FAILED
Done building target "RestorePackages" in project
"/Users/Tom/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED
Done building project
"/Users/Tom/SteamBot-master/SteamTrade/SteamTrade.csproj".-- FAILED
Build FAILED.
Errors:
/Users/Tom/SteamBot-master/SteamTrade/SteamTrade.csproj (Build) ->
/Users/Tom/SteamBot-master/.nuget/NuGet.targets (RestorePackages
target) ->
/Users/Tom/SteamBot-master/.nuget/NuGet.targets: error : Command
'bash "/Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh"
mono --runtime=v4.0.30319
/Users/Tom/SteamBot-master/.nuget/NuGet.exe install
"packages.config" -source "" -RequireConsent -solutionDir
"/Users/Tom/SteamBot-master/"' exited with code: 127.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.1292110
/Users/Tom/SteamBot-master/.nuget/NuGet.targets : error: Command 'bash "/Users/Tom/SteamBot-master/.nuget/../.ci/exec-with-retry.sh" mono --runtime=v4.0.30319 /Users/Tom/SteamBot-master/.nuget/NuGet.exe install "packages.config" -source "" -RequireConsent -solutionDir "/Users/Tom/SteamBot-master/"' exited with code: 127.
我假设您正在使用 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 的引用。
问题在于你已经有效地双重逃逸了该空间。要么将包含空格的命令括在双引号内,要么在每个空格前面添加反斜杠,但不能同时使用两者!
使用以下任一方法:
/Applications/"Xamarin Studio.app"/Contents/MacOS/mdtool ...
或
/Applications/Xamarin\ Studio.app/Contents/MacOS/mdtool ...