使用VS2017 {10}在Windows 10上使用github构建aspnet核心源代码

时间:2017-05-31 23:08:14

标签: asp.net-core asp.net-core-security

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

所以请点击asp.net core securityhttps://github.com/aspnet/Security

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

Git dev

我已经从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)               

1 个答案:

答案 0 :(得分:2)

问题现在有点过时了。我写这篇文章时考虑到了后代。

说明

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

-Being通知某个特定开发项目已更新到.NET Core 2.0

- 下载并安装.NET Core 2.0

- 更新更新的分支

- 做一个干净的构建

<强>解决方案:

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

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