Asp.net core 使用VS2017从windows 10上的github构建aspnet核心源

Asp.net core 使用VS2017从windows 10上的github构建aspnet核心源,asp.net-core,asp.net-core-security,Asp.net Core,Asp.net Core Security,我想深入研究托管在gihub上的asp.net核心源代码 因此,以asp.net核心安全性为例,可以在这里找到- 我已经下载并安装了GitHub桌面。我已经在我的机器上本地克隆了回购协议。我正在查看开发分支: 我已经下载并安装了SDK,我认为项目的目标是SDK(我可能错了),但下面是authentication.csproj: <Project Sdk="Microsoft.NET.Sdk"> <Import Project="..\..\build\common.pr

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

因此,以
asp.net核心安全性
为例,可以在这里找到-

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

我已经下载并安装了SDK,我认为项目的目标是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>

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

说明:

在以下情况下,我收到了一堆类似的错误消息:

-被告知某个特定的开发项目已更新为.NET Core 2.0

-下载和安装.NET Core 2.0

-合并更新的分支

-干净利落

解决方案:

我检查了项目属性,发现.NETCore2.0安装没有出现在“目标框架”下拉列表中


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

的确如此。这是我在15.3可用时做的第一件事。它只是在VS2017更新3中构建的,我也必须更新。VS2017只是一堆废话
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)