Mac OSX Build上的ASP.NET失败(您是否缺少程序集引用?)

时间:2015-05-20 22:12:18

标签: c# asp.net macos mono

好的人,我正在为学校做一些应该用ASP.NET完成的项目,但我有一个mac。所以我研究了如何运行asp.net web应用程序并遵循本教程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网络时:

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恢复时:

  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 

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

2 个答案:

答案 0 :(得分:2)

管理运行Web应用程序。 以下是我必须做的事情:

  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现在应该工作,干杯......

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

答案 1 :(得分:0)

如果您没有太多时间,只需注册AWS并启动Windows服务器即可。如果正在运行,4GB的盒子每小时的成本应低于10美分。

然后从Mac App Store安装免费的Microsoft远程桌面。

这是在Mac上安装Windows的最少侵入性方法。如果您需要10个小时才能完成作业,那么您应该花费不到1美元。