1

我想深入研究托管在 gihub 上的 asp.net 核心资源。

因此asp.net core security,可以在这里找到 - https://github.com/aspnet/Security

我已经下载并安装了 GitHub 桌面。我已经在我的机器上本地克隆了 repo。我正在查看开发分支:

开发者

我已经从https://www.microsoft.com/net/core/preview#windowscmd下载并安装了 SDK ,我认为这是项目的目标(我可能错了),但这里是 authentication.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <Import Project="..\..\build\common.props" />

  <PropertyGroup>
    <Description>ASP.NET Core common types used by the various authentication middleware components.</Description>
    <TargetFramework>netstandard2.0</TargetFramework>
    <NoWarn>$(NoWarn);CS1591</NoWarn>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
    <PackageTags>aspnetcore;authentication;security</PackageTags>
    <EnableApiCheck>false</EnableApiCheck>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Authentication.Core" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.AspNetCore.Http" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" />
    <PackageReference Include="Microsoft.Extensions.SecurityHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
    <PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
    <PackageReference Include="Microsoft.Extensions.WebEncoders" Version="$(AspNetCoreVersion)" />
  </ItemGroup>

</Project>

有一个解决方案文件(Security.sln)和一个 build.cmd、build.ps1、build.sh。我希望加载解决方案并进行编译,但事情似乎不再那么简单了。

运行了似乎安装了一些东西的 build.ps1,然后运行了似乎执行的 build.cmd,我已经在 VS2017 中加载了解决方案。我只是无法建造任何东西。

错误窗口目前正因一组错误而变得疯狂,这些错误似乎卡在从 10 上升到 88 的循环中,然后在无限循环中回到 10。

我在任何地方都找不到有关构建这些解决方案的任何信息。谁能告诉我建造它们需要什么?已经很晚了,已经是漫长的一天,我的眼睛受伤了。

以下是错误/警告的选择:

Error       One or more projects are incompatible with .NETFramework,Version=v4.6.1 (win7-x86).             
Error       Project Microsoft.AspNetCore.Authentication.OpenIdConnect is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authentication.OpenIdConnect supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Project Microsoft.AspNetCore.Authentication.Twitter is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.Twitter supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Project Microsoft.AspNetCore.Authorization.Policy is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authorization.Policy supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Project Microsoft.AspNetCore.Authentication.Google is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.Google supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.MicrosoftAccount is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.MicrosoftAccount supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Project Microsoft.AspNetCore.Authentication.Google is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authentication.Google supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Project Microsoft.AspNetCore.CookiePolicy is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.CookiePolicy supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Testing 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Testing 2.0.0-preview2-25336 supports:
  - net46 (.NETFramework,Version=v4.6)
  - net461 (.NETFramework,Version=v4.6.1)
  - netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.JwtBearer is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authentication.JwtBearer supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.OpenIdConnect is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Project Microsoft.AspNetCore.Authentication.OpenIdConnect supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Project Microsoft.AspNetCore.Authentication.JwtBearer is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authentication.JwtBearer supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       One or more projects are incompatible with .NETCoreApp,Version=v2.0.                
Error       Project Microsoft.AspNetCore.Authorization is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authorization supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Project Microsoft.AspNetCore.Authentication.Twitter is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authentication.Twitter supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.Facebook is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authentication.Facebook supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       One or more packages are incompatible with .NETCoreApp,Version=v2.0 (win7-x86).             
Error       One or more packages are incompatible with .NETFramework,Version=v4.6.1.                
Error       Project Microsoft.AspNetCore.Authentication.Facebook is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.Facebook supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Package Microsoft.Extensions.SecretManager.Tools 2.0.0-preview2-25336 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.Extensions.SecretManager.Tools 2.0.0-preview2-25336 supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)             
Error       Project Microsoft.AspNetCore.Authentication.Google is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authentication.Google supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Project Microsoft.AspNetCore.Authorization is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authorization supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Package Microsoft.AspNetCore.Http 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Http 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.Server.Kestrel.Https 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Server.Kestrel.Https 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Project Microsoft.AspNetCore.Authorization.Policy is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authorization.Policy supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       One or more projects are incompatible with .NETFramework,Version=v4.6.1.                
Error       Package Microsoft.AspNetCore.DataProtection.Extensions 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.DataProtection.Extensions 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Project Microsoft.AspNetCore.Authentication.Facebook is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authentication.Facebook supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       One or more projects are incompatible with .NETCoreApp,Version=v2.0 (win7-x86).             
Error       Project Microsoft.AspNetCore.Authentication.JwtBearer is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.JwtBearer supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.Diagnostics 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.MicrosoftAccount is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Project Microsoft.AspNetCore.Authentication.MicrosoftAccount supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.TestHost 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.TestHost 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       One or more packages are incompatible with .NETFramework,Version=v4.6.1 (win7-x86).             
Error       Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.DataProtection 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)             
Error       Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       One or more packages are incompatible with .NETCoreApp,Version=v2.0.                
Error       One or more packages are incompatible with .NETCoreApp,Version=v1.0.                
Error       Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Project Microsoft.AspNetCore.Authentication.Cookies is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Project Microsoft.AspNetCore.Authentication.Cookies supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0). Package Microsoft.AspNetCore.Hosting 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
Error       Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.StaticFiles 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Http 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1). Package Microsoft.AspNetCore.Http 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)                
Error       Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 is not compatible with netcoreapp2.0 (.NETCoreApp,Version=v2.0) / win7-x86. Package Microsoft.AspNetCore.Server.Kestrel 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Project Microsoft.AspNetCore.Authentication.OpenIdConnect is not compatible with net461 (.NETFramework,Version=v4.6.1). Project Microsoft.AspNetCore.Authentication.OpenIdConnect supports: netstandard2.0 (.NETStandard,Version=v2.0)              
Error       Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 is not compatible with net461 (.NETFramework,Version=v4.6.1) / win7-x86. Package Microsoft.AspNetCore.Server.IISIntegration 2.0.0-preview2-25336 supports: netstandard2.0 (.NETStandard,Version=v2.0)               
4

1 回答 1

2

问题现在有点过时了。我写这篇文章是为了后代。

描述:

我最终得到了一堆类似的错误消息:

- 收到特定开发项目已更新到 .NET Core 2.0 的通知

-下载和安装 .NET Core 2.0

-合并更新的分支

- 进行干净的构建

解决方案:

我检查了项目属性,发现 .NET Core 2.0 安装没有出现在“Target Framework”下拉菜单中。

在我将 VS2017 更新到最新的可用补丁后,问题就消失了。之后 .NET Core 2.0 可用作目标框架。

于 2017-08-22T14:48:10.893 回答