2016-08-22 98 views
2

我想为我的Xamarin项目安装Cake build。它在Windows上完美工作,但在OS X(El Captain)上失败。 build.sh is here,build.cake is here在OS X上编译失败的蛋糕,找不到msbuild.exe

,生成失败与NuGetRestore此消息:

MSBuild auto-detection: using msbuild version '4.0' from '/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5'. 
MsBuild.exe does not exist at '/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5/msbuild.exe'. 
An error occured when executing task 'Restore-NuGet-Packages'. 
Error: NuGet: Process returned an error (exit code 1). 

运行./build.sh -v “诊断” 给出:

Executing: /Users/artur/sources/xamarin-range-slider/tools/NuGet.exe restore "/Users/artur/sources/xamarin-range-slider/Xamarin.RangeSlider.sln" -Verbosity detailed -NonInteractive 
MSBuild auto-detection: using msbuild version '4.0' from '/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5'. Use option -MSBuildVersion to force nuget to use a specific version of MSBuild. 
MSBuild P2P timeout [ms]: 120000 
System.AggregateException: One or more errors occurred. ---> NuGet.CommandLineException: MsBuild.exe does not exist at '/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5/msbuild.exe'. 
    at NuGet.CommandLine.MsBuildUtility.GetProjectReferences (System.String msbuildDirectory, System.String[] projectPaths, Int32 timeOut) <0x34e8ed0 + 0x00677> in <filename unknown>:0 
    at NuGet.CommandLine.RestoreCommand.DetermineRestoreInputs() <0x3452690 + 0x002af> in <filename unknown>:0 
    at NuGet.CommandLine.RestoreCommand+<ExecuteCommandAsync>d__23.MoveNext() <0x3451688 + 0x0028b> in <filename unknown>:0 
    --- End of inner exception stack trace --- 
    at System.Threading.Tasks.Task.ThrowIfExceptional (Boolean includeTaskCanceledExceptions) <0x1d1d960 + 0x00049> in <filename unknown>:0 
    at System.Threading.Tasks.Task.Wait (Int32 millisecondsTimeout, CancellationToken cancellationToken) <0x1d1f150 + 0x000c8> in <filename unknown>:0 
    at System.Threading.Tasks.Task.Wait() <0x1d1ef70 + 0x00033> in <filename unknown>:0 
    at NuGet.CommandLine.Command.Execute() <0x343a298 + 0x00213> in <filename unknown>:0 
    at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) <0x718cc0 + 0x005e0> in <filename unknown>:0 
---> (Inner Exception #0) NuGet.CommandLineException: MsBuild.exe does not exist at '/Library/Frameworks/Mono.framework/Versions/4.4.2/lib/mono/4.5/msbuild.exe'. 
    at NuGet.CommandLine.MsBuildUtility.GetProjectReferences (System.String msbuildDirectory, System.String[] projectPaths, Int32 timeOut) <0x34e8ed0 + 0x00677> in <filename unknown>:0 
    at NuGet.CommandLine.RestoreCommand.DetermineRestoreInputs() <0x3452690 + 0x002af> in <filename unknown>:0 
    at NuGet.CommandLine.RestoreCommand+<ExecuteCommandAsync>d__23.MoveNext() <0x3451688 + 0x0028b> in <filename unknown>:0 <--- 

An error occured when executing task 'Restore-NuGet-Packages'. 
Error: Cake.Core.CakeException: NuGet: Process returned an error (exit code 1). 
    at Cake.Core.Tooling.Tool`1[TSettings].ProcessExitCode (Int32 exitCode) <0x3a8b208 + 0x000fb> in <filename unknown>:0 
    at Cake.Core.Tooling.Tool`1[TSettings].Run (Cake.Core.Tooling.TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings, System.Action`1 postAction) <0x3a34a88 + 0x00177> in <filename unknown>:0 
    at Cake.Core.Tooling.Tool`1[TSettings].Run (Cake.Core.Tooling.TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments) <0x3a34a48 + 0x0002f> in <filename unknown>:0 
    at Cake.Common.Tools.NuGet.Restore.NuGetRestorer.Restore (Cake.Core.IO.FilePath targetFilePath, Cake.Common.Tools.NuGet.Restore.NuGetRestoreSettings settings) <0x3a34328 + 0x0004b> in <filename unknown>:0 
    at Cake.Common.Tools.NuGet.NuGetAliases.NuGetRestore (ICakeContext context, Cake.Core.IO.FilePath targetFilePath, Cake.Common.Tools.NuGet.Restore.NuGetRestoreSettings settings) <0x3a33f18 + 0x0012f> in <filename unknown>:0 
    at CakeBuildScriptImpl.NuGetRestore (Cake.Core.IO.FilePath targetFilePath, Cake.Common.Tools.NuGet.Restore.NuGetRestoreSettings settings) <0x3a33ed8 + 0x0002b> in <filename unknown>:0 
    at CakeBuildScriptImpl+<Execute>c__AnonStorey0.<>m__0() <0x3a33e40 + 0x00087> in <filename unknown>:0 
    at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass4.<Does>b__3 (ICakeContext context) <0x3a33e20 + 0x00014> in <filename unknown>:0 
    at Cake.Core.ActionTask.Execute (ICakeContext context) <0x3a33d68 + 0x00059> in <filename unknown>:0 
    at Cake.Core.DefaultExecutionStrategy.Execute (Cake.Core.CakeTask task, ICakeContext context) <0x3a33b18 + 0x00162> in <filename unknown>:0 
    at Cake.Core.CakeEngine.ExecuteTask (ICakeContext context, IExecutionStrategy strategy, System.Diagnostics.Stopwatch stopWatch, Cake.Core.CakeTask task, Cake.Core.CakeReport report) <0x3a33538 + 0x00099> in <filename unknown>:0 
+1

没有在github对此的悬而未决的问题并不十分有益的,但现在敬请期待。https://github.com/NuGet/Home/issues/3085 – jzeferino

+0

@jzeferino谢谢! –

回答

1

这可能是因为在路径上NuGet.exe的版本那不知道单声道。

通过运行build.sh -v "Diagnostic",您将得到如何为恢复操作调用NuGet命令行的详细日志。

还有用于NuGetRestore(FilePath, ​NuGetRestoreSettings)​过载的NuGetRestoreSettings可以将Verbosity属性设置为Detailed从的NuGet命令行获取更多详细的日志记录。

如果它不是项目工具文件夹中的nuget.exe,则可以更改引导程序以首先在路径中添加工具文件夹。 (你也可以在NuGetRestoreSettings上设置ToolsPath属性

如果它正在运行NuGet.exe的路径,通过运行nuget而不带参数(mono ./tools/nuget.exe)来检查你的nuget版本。

以供参考,这似乎是一个已知问题的NuGet控制台,参考GitHub的问题NuGet/Home#3085

+0

NuGet版本:3.4.4.1321 –

+0

更新后的帖子,广告代理诊断输出。 –

+0

将此添加到您的nuget恢复:'NuGetRestore(solutionFile,new NuGetRestoreSettings {Verbosity = NuGetVerbosity.Detailed});'。我测试过你的源代码,并且遇到同样的问题。我在这里有一个工作代码,用我的代码恢复nuget。我想这不是nuget版本相关的。 – jzeferino