Under .net core application of cross-platform -ubuntu core configuration .net core runtime

introduction

        In early studies for a while .net core cross-platform applications, he has published several articles applied research. Due to work, busy with projects on line, did not come for a while writing a blog park. Recent basic project closeout, taking the time turned down his blog, very few articles, really ashamed.

       The past six months, the implementation of the project is based entirely on the .net core to develop, deploy embedded Linux system running on the ARM Cortx-A7 chip, the direct application deployment native, is a typical cross-platform application development. Implementation of the project, has accumulated a lot of experience of cross-platform applications, to be evacuated and some business projects unrelated to organize content sharing, in order to use the .net core platform of friends you can have some help.

Environment Introduction

       The author of the project implementation, is a protocol gateway type of project applications.

       Hardware using ARM Cortx-A7,512MB memory, 8GB eMMC storage, 10 / 100Mbps Ethernet, UART having a plurality of communication interfaces and a number of GPIO.

       System environment based on ubuntu core (16.04) Linux4.14, the system is compatible with Ubuntu software source, integrated QT (I did not use), ideally suited to business users as a base OS products.

      

Cross-platform application

       The author of the project, involving a number of communication interfaces and certain hardware operations, the application of a number of open-source class library:

       flyfire.CustomSerialPort I own package of open-source cross-platform libraries

       NModbus.SerialPortStream cross-platform support Modbus libraries

       MQTTnet a support .net core open source library MQTT

       NodaTime a processing zone UTC for the open source library

       ………

       More libraries, can (linux4.14) platform running on windows and ubuntu core system used by the author.

When .dotnet core operational deployment

       Long-winded for a long time, nothing but introduces some background about the author of cross-platform applications, or return to the subject matter hereof, tell us about how to deploy .dotnet core environment for running programs in ubuntu core (non-ubuntu desktop environment) environment.

Update software source

sudo apt-get update

Installation library dependencies

sudo apt-get install libcurl3

sudo apt-get install libunwind8

According to Microsoft's official document describes the need to install its dependencies, actual use, not installed seemingly no effect Oh. ^ _ ^

Download or copy the compressed package runs

Download, some systems may need to perform the following installation

sudo apt-get install curl

Download the 32-bit version

curl -sSL https://download.visualstudio.microsoft.com/download/pr/428aaa32-f66c-4847-b845-aa21f90504e4/1cf033db866414997140c2672bd75069/dotnet-runtime-2.2.6-linux-arm.tar.gz  -o dotnet-runtime-2.2.6-linux-arm.tar.gz

 Download the 64-bit version

curl -sSL https://download.visualstudio.microsoft.com/download/pr/f5e04830-50fc-435c-8bb5-fcd4629da944/8aa7cce5c3fcb6a7db180b923d3574ef/dotnet-runtime-2.2.6-linux-arm64.tar.gz -o dotnet-runtime-2.2.6-linux-arm64.tar.gz

 

If necessary, download the corresponding version. I use when running 2.2.6.

Extracting installer

Extracting dotnet core runtime mounted to the specified directory (/ ~ cli / dotnet)

Average user at runtime where the archive directory, run the following command:

sudo mkdir -p /~cli/dotnet && sudo tar zxf dotnet-runtime-2.2.6-linux-arm.tar.gz -C /~cli/dotnet

 

root users to run the following command:

mkdir -p /~cli/dotnet && sudo tar zxf dotnet-runtime-2.2.6-linux-arm.tar.gz -C /~cli/dotnet

 

Note: custom directory as needed, there is no specific requirements.

Create a program shortcut

ln -s /~cli/dotnet/dotnet /usr/local/bin

In the previous step, to complete the installation of the system deployed on ubuntu .net core runtime

Input: dotnet -info command to view runtime information, the normal, the result as shown below

 

 As shown, dotcore runtime has been successfully deployed to the ubuntu core system.

Publisher

Will be deployed released dotnet core program, the author uses its own open source HelloArm serial test procedure demonstrate

        

 

 

 

       

 

 

 

        Configure Publishing deployment model used here is dependent manner framework to publish, for the development process, often need to modify the project to update, released on the independent deployment mode, the author of " .Net Core cross-platform application research -HelloArm (serial articles ) "in some reports, the friends who are interested can look yourself.

 

        

 

 

 

       Finally, click Publish, the next generation will be packaged bin \ Release \ netcoreapp2.2 \ publish \ directory.

       The release of the program directory is copied to the target platform

      

 

 

        Given the target executable permissions (dotnet core framework instrument executable file for the dll Oh)

      

 

 

 

Run the test program

        

 

 

        Kick call it a day.

 

 

 

Guess you like

Origin www.cnblogs.com/flyfire-cn/p/11774744.html