3

Any idea how I can find the cause of this issue? Mac terminal just responds with "command not found" trying to run an ASP.NET core app published using self-contained deployment.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
Ossan Dust
  • 125
  • 2
  • 5
  • Which command triggered that error and what is `ls` output in the same folder? You don't reveal your steps with enough information. – Lex Li Feb 22 '17 at 23:30
  • The test application is called "VueTest" so the OSX deploy contains a file "VueTest" which I try to run : "VueTest" or "sudo VueTest" return "command not found". The folder contains about 200 files, the whole .NET core runtime (around 50MB, as opposed to around 10MB when I use framework-dependent deployment instead of self-contained). – Ossan Dust Feb 23 '17 at 07:46
  • I have uploaded the full OSX deploy here : http://www.tinybox.rocks/vuetest_osx_10_12_x64.zip The working Win10 deploy is here : http://www.tinybox.rocks/vuetest_win10_x64.zip Content of the 2 app folders is almost identical, except for the VueTest.exe (win) as opposed to VueTest (osx) and a few .dlls on windows (like coreclr.dll) which are .dylib files on osx (like libcoreclr.dylib) – Ossan Dust Feb 23 '17 at 07:47
  • You should run it as `./VueTest` if you have learnt have to use macOS ABCs. – Lex Li Feb 23 '17 at 12:22
  • this is embarrassing... Of course you're right, and that indeed solves the "problem". It's obvious that I'm a Mac/Linux noob. Lex Li I do appreciate that you took the time to respond to such stupid mistake. – Ossan Dust Feb 23 '17 at 17:19
  • Unfortunately I now still have the same problem on Linux. I installed a fresh Debian 8 64-bit virtual machine and copied the self-contained debian deploy to it (built for runtime "debian.8-x64"). Files are also here : http://www.tinybox.rocks/vuetest_debian_8_x64.zip Again "command not found" when I do "sudo ./VueTest". Not sure which are the prerequisites to run a self-contained ASP.Net Core app, I followed the screenshot at https://www.microsoft.com/net/core#linuxdebian and installed curl, libunwind8 and gettext. I hope I'm making another stupid mistake... – Ossan Dust Feb 23 '17 at 17:27
  • I don't have access to your machine, so can only guess you don't run `chmod a+x VueTest`. It is not embarrassing at all, as we were all noobs the first day. Find a good enough Linux/macOS beginner book and you will soon know much better where to go. – Lex Li Feb 23 '17 at 17:50
  • And you were spot on again... I ran through the many posts of people struggling with .NET Core, while I overlooked the very basic errors like this one - again. Anyway, I have the dummy app running on Win10, Debian and OSX now, without .NET Core install. Still many challenges ahead but for now I'm a happy man - now I'd better learn some basic stuff first. Thanks again Lex Li! – Ossan Dust Feb 23 '17 at 21:00

1 Answers1

16

OK. So to summarize. Microsoft does make .NET Core apps cross platform, but the Windows developers must learn carefully some macOS and Linux ABCs before diving to another operating system.

Common issues are,

  1. You need to run the program at terminal by calling ./executable_name, and this is a convention.
  2. You need to grant the executable the rights to execute, by calling chmod a+x executable_name (most Linux distributions require this).
Lex Li
  • 60,503
  • 9
  • 116
  • 147