Ubuntu ASP.NET Core App for Raspberry PI

I installed Ubuntu Core 16.04 on Raspberry PI 3 and was able to run the .NET Core console application on it using the instructions here and using the .NET Core version 1.2.0-beta-001291-00, which is compatible with ARM chips.

When I do the same with the ASP.NET Core base application, I get the following error:

Unhandled exception: System.IO.FileLoadException: Failed to load file or assembly "System.Component.Primitives, Version = 4.2.0.0, Cultire = Neutral, PublicKeyToken = b03f5f7f11d50a3a '. The assembly manifest definition located does not match the assembly reference. (Exception from HRESULT: 0x80131040) in Microsoft.Extensions.FileProviders.PhysicalFileError.CreateFileWatcher (String root) in Microsoft.AspNetCore.Hosting.Internal.HostingEnvironmentExtensions.Initialize> Parameters WebMostPrint.Options.nostationpost.post.process.ostationpost.post.post .WebHostBuilder.BuildHostingServices () in Microsoft.AspNetCore.Hosting.WebHostBuilder.Build () in Program.Main (String [] args) in /home/freek/aspnetcore/program.cs: line 12 Canceled

Here is the contents of program.cs:

using System; using System.IO; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; public class Program { public static void Main(string[] args) { Console.WriteLine("Hello World API!"); var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true) .Build(); var host = new WebHostBuilder() .UseKestrel() .UseConfiguration(builder) .UseContentRoot(Directory.GetCurrentDirectory()) .UseStartup<Startup>() .Build(); host.Run(); } } 

The code works fine on a table with Ubuntu running on .NET Core 1.1, but gives an error on PI running on .NET Core 1.2.0-beta-001291-00.

+5
source share
1 answer

Microsoft corresponded with its version numbers for all of its major projects. Most package developers follow suit. So .net core version 1.1.0 most packages compatible with this version are also version 1.1.0

You also need to update the project dependencies on your beta versions. If you look at your .json project and look at all the dependencies, look at them at nuget.org and get their latest beta version (1.2.0-beta-something) and update the project.json version number to the one you find on nuget .org this might work. This is a beta version.

My recommendation would be to install .net core 1.1.0 on the Raspberry Pi, and then it should work fine. However, if you can not do what the above should work.

+2
source

Source: https://habr.com/ru/post/1263511/


All Articles