了解.Net Core和Mono [英] Understanding .Net Core and Mono

查看:187
本文介绍了了解.Net Core和Mono的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. .Net Core 中开发应用程序时, .NET 依赖项和DLL是否嵌入在应用程序中?这是否意味着我不需要不需要在客户端PC上安装.Net依赖项?

  2. 如果我开发了 .Net Core >适用于Linux的控制台应用程序,是否需要在装有Linux(客户端)的PC上安装 Mono

  3. .Net核心与Android兼容的应用程序?

  1. When developing an application in .Net Core, the .NET dependencies and DLLs are embedded in the application? does this mean that I do NOT need to install the .Net dependencies on the client PC?
  2. If I develop a .Net Core console application for Linux, is it necessary to install Mono on the PC with Linux (client)?
  3. Are .Net core applications compatible with Android?


推荐答案

对您的问题:

否依赖项未嵌入应用程序中(.NET中没有静态链接)。

是的,发布时,依赖项将作为单独的文件添加(自包含) )。

如果您的应用程序是.NET-Core应用程序,则不需要不需要安装.NET-Core框架。

您可以为每个平台进行独立的部署:

No the dependencies are NOT embedded in the application (no static linking in .NET).
Yes, the dependencies are added as separate files, when you publish (self-contained).
If your application is a .NET-Core application, you do NOT need the .NET-Core framework installed. Neither do you need Mono.
You can do a self-contained deployment for each platform:

Windows-x86-32:

Windows-x86-32:

dotnet restore -r win-x86
dotnet build -r win-x86
dotnet publish -f netcoreapp2.0 -c Release -r win-x86

Windows-x86-64:

Windows-x86-64:

dotnet restore -r win-x64
dotnet build -r win-x64
dotnet publish -f netcoreapp2.0 -c Release -r win-x64

Linux-x86-32: .NET-Core不支持/ strong>

Linux-x86-32: NOT SUPPORTED BY .NET-Core

Linux-x86-64:

Linux-x86-64:

dotnet restore -r linux-x64
dotnet build -r linux-x64
dotnet publish -f netcoreapp2.0 -c Release -r linux-x64

Linux ARM(Android / ChromeOS)

Linux ARM (Android/ChromeOS)

dotnet restore -r linux-arm
dotnet build -r linux-arm
dotnet publish -f netcoreapp2.0 -c Release -r linux-arm

Linux-arm-64:否由.NET-Core支持的T

Linux-arm-64: NOT SUPPORTED BY .NET-Core

这将添加所有依赖项,包括.NET-Core运行时库。
如果使用的DLL引用一个native-dll(它作为嵌入式资源提供),但不提供必要的C-Runtime-libraries(例如,当native-dll / .so是动态链接-例如在SkiaSharp中。

This adds all dependencies, including the .NET-Core runtime libraries. You can still run into problems if a used DLL references a native-dll (that it provides as embedded resource), but does not provide the necessary C-Runtime-libraries (e.g. when the native-dll/.so is dynamically linked - such as in SkiaSharp).

此外,.NET-Core可以与共享框架一起运行,这意味着部署规模较小,但是共享-然后,必须安装framework-version。

Also, .NET-Core can be run with the shared-framework, which means deployment size is smaller, but the shared-framework-version must be installed, then.


  1. 由于Android是linux,并且您没有运行在x86-32处理器或ARM-64处理器,.NET-Core应该与Android兼容。我从未测试过这个前提。可能会带来错误。对ARM的支持是粗略的。

但是,我不清楚您要在Android上使用.NET Core做什么。
由于.NET没有实现任何Android-UI接口。
Xamarin-Forms可能支持带有.NET-Core的Android-UI-它确实对mono具有支持。但是,您可以在Android或控制台应用程序上运行Web /其他服务器。

However, it is unclear to me what you want to do with .NET Core on Android. Since .NET does not implement any Android-UI interfaces. Xamarin-Forms might support Android-UI with .NET-Core - it certainly does with mono. You could however run a web/other-server on Android, or a console application.

请参见 CoreDroid

这篇关于了解.Net Core和Mono的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆