Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eccf3b2

Browse files
committed
Update ASP.NET Core 2.0
1 parent 93ddbec commit eccf3b2

File tree

7 files changed

+36
-32
lines changed

7 files changed

+36
-32
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.4</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>NetCoreBBS</RootNamespace>
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.2" />
9+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
1010
</ItemGroup>
1111

1212
</Project>

‎src/ApplicationCore/Entities/User.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Linq;
44
using System.Threading.Tasks;
5-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
5+
using Microsoft.AspNetCore.Identity;
66

77
namespace NetCoreBBS.Entities
88
{
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard1.4</TargetFramework>
4+
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>NetCoreBBS.Infrastructure</RootNamespace>
66
</PropertyGroup>
77

@@ -10,8 +10,8 @@
1010
</ItemGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.0.0" />
14-
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
14+
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
1515
</ItemGroup>
1616

1717
</Project>

‎src/NetCoreBBS/NetCoreBBS.csproj‎

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
<DebugType>portable</DebugType>
66
<PreserveCompilationContext>true</PreserveCompilationContext>
77
<AssemblyName>NetCoreBBS</AssemblyName>
88
<OutputType>Exe</OutputType>
99
<PackageId>NetCoreBBS</PackageId>
1010
<RuntimeIdentifiers>ubuntu.14.04-x64</RuntimeIdentifiers>
11-
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
12-
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8</PackageTargetFallback>
1311
</PropertyGroup>
1412

1513
<ItemGroup>
@@ -19,21 +17,21 @@
1917
</ItemGroup>
2018

2119
<ItemGroup>
22-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.2" />
23-
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.3" />
24-
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.2" />
25-
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.3" />
26-
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.2" />
27-
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
28-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.0.2" />
29-
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" />
30-
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.0.2" />
31-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="1.1.1" />
32-
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-rtm-alpha5" />
33-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.2" />
34-
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="1.0.2" />
35-
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="1.1.1" />
36-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.0.0" />
20+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.0.0" />
21+
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.0.0" />
22+
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.0.0" />
23+
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.0.0" />
24+
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.0.0" />
25+
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />
26+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
27+
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
28+
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
29+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.0" />
30+
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-rtm-beta5" />
31+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="2.0.0" />
32+
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.0" />
33+
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.0.0" />
34+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.0.0" />
3735
</ItemGroup>
3836

3937
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
@@ -45,8 +43,8 @@
4543
</Target>
4644

4745
<ItemGroup>
48-
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" />
49-
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
46+
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.4.337" />
47+
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
5048
</ItemGroup>
5149

5250
<ItemGroup>
@@ -58,4 +56,10 @@
5856
<Folder Include="wwwroot\images\avatar\" />
5957
</ItemGroup>
6058

59+
<ItemGroup>
60+
<Content Update="nlog.config">
61+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
62+
</Content>
63+
</ItemGroup>
64+
6165
</Project>

‎src/NetCoreBBS/Startup.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void ConfigureServices(IServiceCollection services)
7373
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
7474
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
7575
{
76-
env.ConfigureNLog("nlog.config");
76+
loggerFactory.ConfigureNLog("nlog.config");
7777
loggerFactory.AddNLog();
7878

7979
app.UseRequestIPMiddleware();
@@ -82,7 +82,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
8282
app.UseDeveloperExceptionPage();
8383

8484
app.UseStaticFiles();
85-
app.UseIdentity();
85+
app.UseAuthentication();
8686
app.UseStatusCodePages();
8787

8888
app.UseMvc(routes =>

‎src/NetCoreBBS/Views/Account/_ExternalLoginsListPartial.cshtml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h4>用其他平台的帐号登录</h4>
33
<hr />
44
@{
5-
var loginProviders = SignInManager.GetExternalAuthenticationSchemes();
5+
var loginProviders = awaitSignInManager.GetExternalAuthenticationSchemesAsync();
66
if (!loginProviders.Any())
77
{
88
<div>
@@ -18,7 +18,7 @@
1818
<p>
1919
@foreach (var p in loginProviders)
2020
{
21-
<button type="submit" class="btn btn-default" id="@p.AuthenticationScheme" name="provider" value="@p.AuthenticationScheme" title="用 @p.DisplayName 登录">@p.AuthenticationScheme</button>
21+
<button type="submit" class="btn btn-default" id="@p.Name" name="provider" value="@p.Name" title="用 @p.DisplayName 登录">@p.Name</button>
2222
}
2323
</p>
2424
</div>

‎tests/UnitTests/UnitTests.csproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp1.1</TargetFramework>
4+
<TargetFramework>netcoreapp2.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
99
<PackageReference Include="xunit" Version="2.2.0" />
1010
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
1111
</ItemGroup>

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /