ASP.NET Mac OSX 构建失败(是否缺少程序集引用?)

ASP.NET on Mac OSX Build Failed (are you missing an assembly reference?)

好的,我正在为学校做一些项目,应该用 ASP.NET 完成,但我有一个 mac。所以我研究了如何 运行 asp.net 网络应用程序并遵循了本教程 https://www.youtube.com/watch?v=1g2I9SJZ5XI

在这期间我 运行发现了单声道的一些错误 https://github.com/aspnet/Home/issues/498 通过 github

构建 mono 4.1.0 设法解决了这个问题

所以毕竟,我尝试构建,这是输出:

http://pastebin.com/mtzVj9S7

当我尝试使用 运行 K 命令k web:

System.InvalidOperationException: Unable to load application or execute command 'Microsoft.AspNet.Hosting'. Available commands: web, kestrel, gen, ef.
  at Microsoft.Framework.ApplicationHost.Program.ThrowEntryPointNotfoundException (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.Exception innerException) <0x35aa2b8 + 0x0014f> in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) <0x347f3d0 + 0x00157> in <filename unknown>:0 
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) <0x2987d50 + 0x00353> in <filename unknown>:0 

当我尝试使用 运行 K 命令kpm restore:

  System.ComponentModel.Win32Exception: ApplicationName='bower', CommandLine='install', CurrentDirectory='/Users/djordjevanjek/Sites/ZdravaHrana', Native error= Cannot find the specified file
  at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x36a2cd8 + 0x00e03> in <filename unknown>:0 
  at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) <0x36a2b48 + 0x000a7> in <filename unknown>:0 
  at System.Diagnostics.Process.Start (System.Diagnostics.ProcessStartInfo startInfo) <0x36a27f8 + 0x0004f> in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.ScriptExecutor.Execute (Microsoft.Framework.Runtime.Project project, System.String scriptName, System.Func`2 getVariable) <0x30d7f68 + 0x0046f> in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<RestoreForProject>d__62.MoveNext () <0x30a4af8 + 0x01207> in <filename unknown>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x18897b0 + 0x00035> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x1887170 + 0x000b7> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x18870e0 + 0x00084> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x1887090 + 0x0003f> in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () <0x1b7d1b0 + 0x0001f> 24246 in <filename unknown>:0 
  at Microsoft.Framework.PackageManager.RestoreCommand+<ExecuteCommand>d__61.MoveNext () <0x301fbd8 + 0x00643> in <filename unknown>:0 

希望这足以帮助我解决这个问题。

如果您没有太多时间,只需注册 AWS 并启动 Windows 服务器。如果 运行.

,一个 4GB 的盒子每小时的成本应该低于 10 美分

然后从 Mac App Store 安装免费的 Microsoft Remote Desktop。

这是在您的 Mac 上获得 Windows 的最不干扰的方式。如果你需要 10 个小时来完成你的家庭作业,它应该少于一美元。

设法 运行 一个网络应用程序。 这是我必须做的:

  1. 打开终端,cd 到您的网络应用程序目录。
  2. 类型dnu restore

    2a。如果你得到这样的结果 -bash: dnu: command not found

    键入 source dnvm.sh,然后返回 运行 dnu restore

    2b。如果它开始恢复但最后你会得到类似的东西:http://pastebin.com/MLES7QPn

    运行 这些 sudo npm install -g bowersudo npm install -g grunt-cli 然后再返回 运行 dnu restore

  3. 在你没有错误地恢复后,输入dnx . kestrel

    3a。如果你抬头看 http://localhost:5001 并得到这样的东西

    kqueue() FileSystemWatcher has reached the maximum nunmber of files to watch.

    运行 终端中的这个命令(这是一个单声道错误)export MONO_MANAGED_WATCHER=false

  4. http://localhost:5001 现在应该工作了,干杯...

希望我能帮到别人,这里是我找到答案的来源:http://andreizubov.blogspot.ru/2015/04/getting-started-with-net-on-os-x-and.html http://www.cnblogs.com/haogj/p/4493240.html