使用.NET Core 2.0创建简单控制台应用程序

时间:2018-10-05 14:35:07

标签: microsoft-graph

我下载了此sample MSGraph console app并使其运行。它使用.NET 4.6.1。我正在尝试将其转换为.NET Core 2.0。我无法使用此NuGet软件包安装MSGraph: 安装软件包Microsoft.Graph -Version 1.11.0

它出现以下错误:

Installing Microsoft.Graph 1.11.0.
Install-Package : NU1605: Detected package downgrade: Microsoft.Graph.Core from 1.11.0 to 1.10.0. Reference the     package directly from the project to select a different version.
 ConsoleMSGraph -> Microsoft.Graph 1.11.0 -> Microsoft.Graph.Core (>= 1.11.0)
 ConsoleMSGraph -> Microsoft.Graph.Core (>= 1.10.0)
At line:1 char:1
+ Install-Package Microsoft.Graph -Version 1.11.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId :     NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Install-Package : Package restore failed. Rolling back package changes for 'ConsoleMSGraph'.
At line:1 char:1
+ Install-Package Microsoft.Graph -Version 1.11.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId :     NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Time Elapsed: 00:00:14.1377482
PM>

是否存在与.NET Core 2.0兼容的MSGraph软件包?

1 个答案:

答案 0 :(得分:0)

您缺少一些复制步骤。该样本目标客户为1.7.0。是的,该软件包将与Net Core 2一起使用。它针对NetStandard 1.1。这是一个Net Core 2示例: https://github.com/MIchaelMainer/GraphNetCore2