.NET Core StartUp.cs不起作用

时间:2017-05-04 12:44:37

标签: c# .net json frameworks core

我正在使用Windows 10 64位和Visual Studio 2015 Update 3与.NET Core SDK。我是.NET Core的新手。我正在使用.NET Standard 1.6框架。 我想知道如何使用启动类运行.NET Core应用程序。

请检查以下我开始申请的点:

首先在project.json中添加运行时

"runtimes": {
    "win10-x64": {}
  }, 

然后使用void main函数添加Program.cs。 构建此项目时控制台无法正常工作:请务必再次在参考文件中恢复包。

在project.json中添加buildOptions

"buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "debugType": "portable",
    "embed": {
      "include": [ "Resource.resx" ]
    }
}

在project.json中添加依赖项

"Microsoft.NETCore.App": {
      "type": "platform",
      "version": "1.0.1"
    }

当我调试Console应用程序时,即使我使用InitializeAsync()方法检查StartUp.cs文件但无法调试此方法,它也会自动运行并停止。

由于

0 个答案:

没有答案