xamarin - 构建 Xamarin.iOS 项目时 NuGet 包恢复失败,错误代码为 127

标签 xamarin xamarin.ios nuget xamarin-studio nuget-package-restore

我正在尝试在 Xamarin Studio 中构建 Xamarin.iOS 项目。 Nuget 包恢复已启用,但在任何构建过程中我都会收到以下错误:

/.nuget/NuGet.targets: Error: Command 'mono --runtime=v4.0.30319 "/.nuget/NuGet.exe" install "/ProjectName/packages.config" -source "" -RequireConsent -solutionDir "/" exited with code: 127. (ProjectName)

从终端运行相同的命令不会出现任何问题,并且使用以下输出消息绝对可以正常工作:

Restoring NuGet packages... To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.

.nuget/NuGet.exe 和 .nuget/NuGet.targets 是最新的。在项目中禁用 nuget 恢复的情况下,.csproj 文件编译工作得很好。

请指教。

最佳答案

退出代码:127 =“找不到命令”

base解决方案目录运行以下cmd真的有效吗?

mono --runtime=v4.0.30319 "/.nuget/NuGet.exe" install "/ProjectName/packages.config" -source "" -RequireConsent -solutionDir "/"
  • Mono 无法找到 CIL exe 将导致退出代码为 2,但我假设它没有正确找到 mono...

如果您输入哪个单声道,它会在/usr/local/bin/usr/bin中找到吗?

尝试:

sudo ln /Library/Frameworks/Mono.framework/Commands/mono /usr/bin

然后从 Xamarin Studio 重试。

引用号:https://forums.xamarin.com/discussion/43192/os-x-10-11-el-capitan-beta-and-xamarin-compiler-error-127

关于xamarin - 构建 Xamarin.iOS 项目时 NuGet 包恢复失败,错误代码为 127,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32929244/

相关文章:

c# - 从 CSV 文件中提取数据(融合表和 kml 解决方法)

c# - 如何隐藏数字键盘,我使用的是 Xamarin iOS (C#)

linux - 如何在 Ubuntu 18.04 WSL 中安装最新版本的 NuGet.exe CLI?

visual-studio - 何时使用 NuGet 与添加项目引用

c# - 使用 Xamarin 和 Microsoft 语音服务 API 执行实时连续语音识别

ios - 尝试与 Azure 移动服务同步时出现 IMobileServiceClient.PullAsync 死锁

android - "Activity has been destroyed"在设备旋转后使用带 fragment 的 map

c# - 如何在自定义渲染器中更改 Timepicker 的标题和本地化

c# - 将实现 NSFastEnumeration 协议(protocol)的 Obj-C 类型绑定(bind)到 MonoTouch

c# - 自动将 PackageReferences 添加到 NuGet 包