我在Visual Studio中创建了项目vNext控制台应用程序.我将这些文件复制到linux机器上.并尝试运行它们ubuntu@ubuntu-Virtual-Machine:~/ConsoleApp2/src/ConsoleApp2$dnvm listActive Version Runtime Ar...
我在Visual Studio中创建了项目vNext控制台应用程序.我将这些文件复制到linux机器上.并尝试运行它们
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$
我的应用程序没有运行.但是,如果我将dnvm切换为单声道,它可以正常工作.
我的文件内容是
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"
}
}
}
}
为什么dnx命令在切换到coreclr时什么都不写?
解决方法:
绝对肯定你错过了其中一个先决条件.它们被列为here:
sudo apt-get install libunwind8 gettext libssl-dev libcurl4-openssl-dev zlib1g libicu-dev uuid-dev
沃梦达教程
本文标题为:c# – 在Linux上运行.NET Core – 什么都不写
基础教程推荐
猜你喜欢
- ZooKeeper的安装及部署教程 2023-01-22
- C# 调用WebService的方法 2023-03-09
- unity实现动态排行榜 2023-04-27
- C#类和结构详解 2023-05-30
- C#控制台实现飞行棋小游戏 2023-04-22
- C# List实现行转列的通用方案 2022-11-02
- 一个读写csv文件的C#类 2022-11-06
- C# windows语音识别与朗读实例 2023-04-27
- linux – 如何在Debian Jessie中安装dotnet core sdk 2023-09-26
- winform把Office转成PDF文件 2023-06-14