ASP.. NET在Mac OSX上构建失败(您是否缺少程序集参考?)

本文关键字:是否 程序集 参考 Mac NET OSX 失败 构建 ASP | 更新日期: 2023-09-27 17:50:20

大家好,我正在为学校做一些项目,应该用ASP来完成。所以我做了一个关于如何运行asp.net web应用程序的研究,并遵循这个教程https://www.youtube.com/watch?v=1g2I9SJZ5XI

在我运行到一些错误与mono 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恢复:

  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 

ASP.. NET在Mac OSX上构建失败(您是否缺少程序集参考?)

成功运行web应用程序。下面是我要做的:

  1. 打开终端cd到你的web app目录。
  2. dnu restore类型

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

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

    2 b。如果它开始恢复但是最后你会看到这样的内容:http://pastebin.com/MLES7QPn

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

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

    3。如果你查看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

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

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

这是在Mac上安装Windows的最省力的方式。如果你需要10个小时来完成作业,你应该花不到一美元。

相关文章: