"Exec format error" on Linux ARM
Steps to reproduce
Downloaded https://dotnetcli.blob.core.windows.net/dotnet/master/Binaries/Latest/dotnet-linux-arm.latest.tar.gz (currently version 2.0.0-preview2-25311-01) Running dotnet will give you "Exec format error" where as builds for preview1 did work perfectly
Actual behavior

Environment data
Ubuntu 16.04 ARM
What does lscpu say? What does file /usr/bin/dotnet say?
lscpu results in:

/usr/bin/dotnet is a directory containing dotnet
I extract it like this:
wget https://dotnetcli.blob.core.windows.net/dotnet/master/Binaries/Latest/dotnet-linux-arm.latest.tar.gz
sudo tar -xvf dotnet-linux-arm.latest.tar.gz -C /usr/bin/dotnet/
Today I upgraded from the latest (working) preview1 build to this one (preview2) after the builds were unavailable for a week or so because of changes in the build system see: https://github.com/dotnet/core-setup/commit/3bc2694a81d2ba931f473e84854c8ca216fac542#commitcomment-22043270
Is there any more to the lscpu output? Can you also include the output of cat /proc/cpuinfo?
Can you run file /usr/bin/dotnet/dotnet ?
I can confirm this problem.
According to readelf, the dotnet executable is for x64 machines:
Looks like a dupe of https://github.com/dotnet/core-setup/issues/2280.
This issue was fixed in the latest build.
I can confirm dotnet --info does work now, it seems to be compiled correctly, however I have another issue (I might need to open up another issue I presume?)

Build using CLI: 2.0.0-preview2-006062 Targetted runtime: 2.0.0-preview2-25311-10 ubuntu.16.04-arm
@Venex; worked for me. Did you do "dotnet restore" + "dotnet publish" or "dotnet restore -r linux-arm" + "dotnet publish -r linux-arm". I got different results depending on this, as described in dotnet/runtime#2757, but maybe it is my csproj-authoring or erronoeous expectations.
dotnet restore + dotnet publish as I always used to
The file is compiled to 64 bit (ELFCLASS64) and should be 32 as discussed in dotnet/runtime#2757
Try to force the project to use the latest "Microsoft.NETCore.DotNetHostPolicy" version, which is "2.0.0-preview2-25311-10", the previous versions have the format issue.
I added the following in the .csproj and it worked.
<PackageReference Include="Microsoft.NETCore.DotNetHostPolicy" Version="2.0.0-preview2-25311-10" />
Restore did output both
Installing Microsoft.NETCore.DotNetHostPolicy 2.0.0-preview2-25311-10.
Installing runtime.linux-arm.Microsoft.NETCore.DotNetHostPolicy 2.0.0-preview2-25311-10.
I'll try with next build, maybe better luck
@Venex; I am not sure if you use the -r flag on restore and publish, otherwise you might end upp as in dotnet/runtime#2757 unless dotnet/core-setup#2377 gets resolved, but maybe you have another issue.
I only did the -r flag on publish, I applied it to restore too and can confirm this step works! With preview1 builds, the flag was not required
@Venex , is this issue ready to be closed? Everything works again for me. Also dotnet/core-setup#2377.
For me this is working
i download dotnet-linux-arm.latest.tar.gz on 12/10 and im getting a robot@ev3dev:~/dotnetlinux$ ./dotnet -bash: ./dotnet: No such file or directory
i installed it in a local directory as well as robot@ev3dev:~$ /usr/bin/dotnet/dotnet -bash: /usr/bin/dotnet/dotnet: No such file or directory
is there some preinstallation i need to install? i did a sudo apt-get upgrade before trying.
here are some diagnostics from my linux system cat /etc/os-release PRETTY_NAME="Debian GNU/Linux 8 (jessie)" NAME="Debian GNU/Linux" VERSION_ID="8" VERSION="8 (jessie)" ID=ev3dev ID_LIKE=debian HOME_URL="http://www.ev3dev.org/" SUPPORT_URL="http://www.ev3dev.org/support" BUG_REPORT_URL="https://github.com/ev3dev/ev3dev/issues" robot@ev3dev:~$ cat /etc/debian_version 8.5 robot@ev3dev:~$
robot@ev3dev:~$ lscpu Architecture: armv5tejl Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 Model name: ARM926EJ-S rev 5 (v5l)
i tried hacking around by opening the dotnet executable and saw a path in there. so i copied one of the sym links in the lib directory so it could match that path and something changed.
now i get a segmentation fault.
the path was in the first few lines of the dotnet exe its: /lib/ld-linux-armhf.so.3 when i put everything back the way it was i get the original
-bash: ./dotnet: No such file or directory silent crash.
any ideas?
Just in case you hadn't seen it, there are RPi instructions that should work for most arm32 based distros. https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
Segfaults can often mean you dont have all the dependency packages installed.
You can also try publishing for generic linux which is what is most tested. dotnet publish -r linux-arm rather than trying o specify Ubuntu.
One thing to note is that .NET Core requires an ARM32 chip that supports ARMv7 instruction sets or higher. Many things like Raspberry Pi Zero and other devices don't have ARM chips with that level of instruction set support.
If you map the model name from sudo lscpu to this table: https://en.wikipedia.org/wiki/List_of_ARM_microarchitectures
You can see which "ARM Architecture" that chip has.