Djordje Vanjek
Djordje Vanjek

Reputation: 411

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

Ok people, I'm working on some project for school which should be done with ASP.NET, but I have a mac. So I did a research on how to run asp.net web app and followed this tutorial https://www.youtube.com/watch?v=1g2I9SJZ5XI

In between I runned on to some error with mono https://github.com/aspnet/Home/issues/498 Managed to solve it with building mono 4.1.0 from github

So after all that, I tried to build and here is the output:

http://pastebin.com/mtzVj9S7

When I try to use Run K Commands and 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 

When I try to use Run K Commands and 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 

Hopefully this will be enough input to help me about this.

Upvotes: 1

Views: 1210

Answers (2)

Djordje Vanjek
Djordje Vanjek

Reputation: 411

Managed to run an web app. Here is what I had to do:

  1. Open up terminal, cd to your web app directory.
  2. Type dnu restore

    2a. If you get result like this -bash: dnu: command not found

    Type source dnvm.sh and then go back run dnu restore again.

    2b. If it starts restoring but at the end you get something like: http://pastebin.com/MLES7QPn

    Run these sudo npm install -g bower and sudo npm install -g grunt-cli and then go back run dnu restore again.

  3. After you did restoring without errors, type dnx . kestrel

    3a. If you look up at the http://localhost:5001 and get something like this

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

    run this command in your terminal (it's an mono bug) export MONO_MANAGED_WATCHER=false

  4. http://localhost:5001 Should be working now, Cheers...

Hopefully I managed to help someone, here are the sources where I found my answers: http://andreizubov.blogspot.ru/2015/04/getting-started-with-net-on-os-x-and.html http://www.cnblogs.com/haogj/p/4493240.html

Upvotes: 2

Pep
Pep

Reputation: 2027

If you do not have much time, just sign up to AWS and launch a Windows server. A 4GB box should cost less than 10 cents per hour if it is running.

Then install the free Microsoft Remote Desktop from the Mac App Store.

This is the least intrusive way to get Windows on your Mac. If you need 10 hours to complete your homework, it should you less than one dollar.

Upvotes: 0

Related Questions