Cannot Run DNX Console Applications

☆樱花仙子☆ 提交于 2019-12-04 05:37:06

You have it configured wrong. I guess what you want to have is the below one inside the project.json file:

{
    "frameworks": {
            "dnx451" : {
            }
            "dnxcore50" : {
                "dependencies": {
                    "System.Console": "4.0.0-beta-*"
                }
            }
    },

    "commands": {
        "me": "run"
    }
}

Now run:

dnu restore
dnx . me

It should work.

Latest versions of System.Console, other than beta versions, are currently incompatible with "dnxcore50" and has breaking changes.

Suggested options:

1- To target the full framework "dnx451" instead of core;

2- To use only a beta version of System.Console with "dnxcore50"; or

3- To use Debug.Print() instead of Console.WriteLine()

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!