dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.21k stars 9.95k forks source link

Running on Linux/ARM with Mono finally stopped working with the RTM/preview2 bits #1610

Closed Tragetaschen closed 6 years ago

Tragetaschen commented 8 years ago

I have been following ASP.NET vNext since alpha3 and I was able to use each and every release since then on my Linux/ARM platform with Mono. Now with the introduction of 1.0.0 RTM, this finally stopped working. As of late, my application targets net452.

The problem is the System.Runtime.InteropServices.RuntimeInformation nupkg. None of the included dlls is fit for running on Linux/ARM, most notably the IsOSPlatform API doesn't work.

Is there any way to get my ASP.NET Core back on Linux/ARM? Can I drop in a purely managed version of the IsOSPlatform API?

behzadha commented 8 years ago

I have tried ASP.NET RC1 on my Linux Arm platform with mono and it is still working, you are saying this feature is no longer supported ? I have a small app on my Raspberry Pi machine and its working, i have planed to upgrade it when the final version of asp released. One of the main features of Asp.Net vNext was being really multi platform supported, it is such a shame for microsoft if what i heard today, is true.

On Wed, Jun 29, 2016 at 3:29 PM, Kai Ruhnau notifications@github.com wrote:

I have been following ASP.NET vNext since alpha3 and I was able to use each and every release since then on my Linux/ARM platform with Mono. Now with the introduction of 1.0.0 RTM, this finally stopped working. As of late, my application targets net452.

The problem is the System.Runtime.InteropServices.RuntimeInformation nupkg. None of the included dlls is fit for running on Linux/ARM, most notably the IsOSPlatform API doesn't work.

Is there any way to get my ASP.NET Core back on Linux/ARM? Can I drop in a purely managed version of the IsOSPlatform API?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aspnet/Home/issues/1610, or mute the thread https://github.com/notifications/unsubscribe/AQWdUcX1rgH7NsBbB-bKVkehopI16nLPks5qQlAUgaJpZM4JBA1I .

~Behzad

BrennanConroy commented 8 years ago

See https://github.com/aspnet/KestrelHttpServer/issues/942

Tragetaschen commented 8 years ago

I know, but the "solution" there doesn't work for ARM

Tragetaschen commented 8 years ago

For reference: dotnet/corefx#9012 is tracking finding an actual solution

borgdylan commented 8 years ago

You will need to compile System.Native.so for ARM and put it in the library path. I have got stuff to run on x86 and x64 using that technique. Unfortunately I do not have ARM binaries to give you.

Tragetaschen commented 8 years ago

For now, I have hacked together a rather quick solution:

Instead of building corefx' System.Native with all the required bells and whistles (llvm cross compiler with cmake, etc), I have created a new project that implements just what's required—and it's not much.

The repostory is here: Tragetaschen/libSystem.Native and the entire source code for that native library is here. Yes, that's a function returning a constant string.

I have cross-compiled that for my ARM platform and extended Mono's /etc/mono/config with

<dllmap dll="System.Native" target="libsystem-native.so.0" />

and that's all.

For those interested, this is all included in my Yocto layer

techcap commented 8 years ago

@Tragetaschen I compiled System.Native from your github source code, so I could pass DllNotFoundException: System.Native. After that, Now it says "Can not find reference assembly '.NET Framework/v4.5.1/Microsoft.CSharp.dll' file for package Microsoft.CSharp at Microsoft.ExtensionsDependencyModel.Resolution.ReferenceAssemblyPathResolver.TryResolveAssemblyPaths".

On RC2, I used the method https://github.com/dotnet/cli/issues/3197, and worked. But now it doesn't work. I used default Asp.net core template.

Tragetaschen commented 8 years ago

I don't do Razor stuff on my ARM device (but angular 2 SPA + API calls) so I don't need to do any compilation. Sorry.

techcap commented 8 years ago

I finally found how to run on arm device. https://github.com/aspnet/Mvc/issues/5088 Thank you very much!!! @Tragetaschen 👍

Eilon commented 8 years ago

@DamianEdwards assigning this to you because it relates to the Mono story.

techcap commented 8 years ago

Now MVC dynamic compilation works well. https://github.com/aspnet/Mvc/issues/5088

smuellener commented 8 years ago

Techcap: You are now running Asp.Net Core on Linux Arm/32? If so, could you briefly describe the steps required to achieve this? Thank you

techcap commented 8 years ago

@smuellener Did you refer to https://github.com/aspnet/Mvc/issues/5088 ?