Run .NET Core on Linux - don't write anything

I created a vNext Console Application project in Visual Studio. I copied these files to a Linux machine. And try to run them

ubuntu@ubuntu-Virtual-Machine:~/ConsoleApp2/src/ConsoleApp2$ dnvm list

Active Version              Runtime Architecture OperatingSystem Alias
------ -------              ------- ------------ --------------- -----
  *    1.0.0-rc1-final      coreclr x64          linux           
       1.0.0-rc1-final      mono                 linux/osx       default

ubuntu@ubuntu-Virtual-Machine:~/ConsoleApp2/src/ConsoleApp2$ dnu restore
ubuntu@ubuntu-Virtual-Machine:~/ConsoleApp2/src/ConsoleApp2$ dnx run
ubuntu@ubuntu-Virtual-Machine:~/ConsoleApp2/src/ConsoleApp2$

My application is not working. However, if I switch dnvm to mono, it works fine. The contents of my files

Program.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    public class Program
    {
        public void Main(string[] args)
        {
            Console.WriteLine("Hello world!!!!");
            Console.Read();
        }
    }
}

project.json

{
  "version": "1.0.0-*",
  "description": "ConsoleApp2 Console Application",
  "authors": [ "Anton" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {

  },

  "frameworks": {
    "dnx451": {},
    "dnxcore50": {
      "dependencies": {

        "System.Console": "4.0.0-beta-23019",
        "System.Linq": "4.0.0-beta-23019",
        "System.Threading": "4.0.10-beta-23019",
        "Microsoft.CSharp": "4.0.0-beta-23019"
      }
    }
  }
}

Why doesn't the dnx command write anything when switching to coreclr?

+4
source share
1 answer

Basically I am sure that you are missing one of the prerequisites. They are listed here :

sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev
0
source

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


All Articles