* Remove net451 as a compilation target
* Upgrade to netcoreapp2.0
This commit is contained in:
Pranav K 2017-03-22 07:39:30 -07:00
Родитель 8c6c0624c8
Коммит 2587e08098
17 изменённых файлов: 32 добавлений и 41 удалений

1
.gitignore поставляемый
Просмотреть файл

@ -33,3 +33,4 @@ nuget.exe
*launchSettings.json
**/Resources/*.Designer.cs
.vscode/
global.json

Просмотреть файл

@ -5,6 +5,7 @@
<CoreFxVersion>4.3.0</CoreFxVersion>
<MoqVersion>4.7.1</MoqVersion>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<RuntimeFrameworkVersion>2.0.0-*</RuntimeFrameworkVersion>
<TestSdkVersion>15.0.0</TestSdkVersion>
<XunitVersion>2.2.0</XunitVersion>
</PropertyGroup>

Просмотреть файл

@ -3,7 +3,7 @@
<Import Project="..\..\build\dependencies.props" />
<PropertyGroup>
<TargetFrameworks>net452;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>net46;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -34,8 +34,11 @@ namespace LocalizationSample
new CultureInfo("zh"),
new CultureInfo("zh-CN")
};
#if !NETCOREAPP1_1
#if NET46
supportedCultures.Add(new CultureInfo("zh-CHT"));
#elif NETCOREAPP2_0
#else
#error target frameworks need to be updated.
#endif
var options = new RequestLocalizationOptions
{
@ -146,8 +149,11 @@ $@"<!doctype html>
await context.Response.WriteAsync($" <option value=\"{new CultureInfo("ja-JP").Name}\">{new CultureInfo("ja-JP").DisplayName}</option>");
await context.Response.WriteAsync($" <option value=\"{new CultureInfo("zh").Name}\">{new CultureInfo("zh").DisplayName}</option>");
await context.Response.WriteAsync($" <option value=\"{new CultureInfo("zh-CN").Name}\">{new CultureInfo("zh-CN").DisplayName}</option>");
#if NET451
#if NET46
await context.Response.WriteAsync($" <option value=\"{new CultureInfo("zh-CHT").Name}\">{new CultureInfo("zh-CHT").DisplayName}</option>");
#elif NETCOREAPP2_0
#else
#error target frameworks need to be updated.
#endif
await context.Response.WriteAsync($" <option value=\"en-NOTREAL\">English (Not a real locale)</option>");
await context.Response.WriteAsync($" <option value=\"pp-NOTREAL\">Made-up (Not a real anything)</option>");

Просмотреть файл

@ -5,7 +5,7 @@
<PropertyGroup>
<Product>Microsoft ASP.NET Core</Product>
<Description>Provides a request culture provider which gets culture and ui-culture from request's route data.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;localization</PackageTags>

Просмотреть файл

@ -5,7 +5,7 @@
<PropertyGroup>
<Product>Microsoft ASP.NET Core</Product>
<Description>ASP.NET Core middleware for automatically applying culture information to HTTP requests. Culture information can be specified in the HTTP header, query string, cookie, or custom source.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;localization</PackageTags>

Просмотреть файл

@ -126,13 +126,8 @@ namespace Microsoft.AspNetCore.Localization
private static void SetCurrentThreadCulture(RequestCulture requestCulture)
{
#if NET451
Thread.CurrentThread.CurrentCulture = requestCulture.Culture;
Thread.CurrentThread.CurrentUICulture = requestCulture.UICulture;
#else
CultureInfo.CurrentCulture = requestCulture.Culture;
CultureInfo.CurrentUICulture = requestCulture.UICulture;
#endif
}
private static CultureInfo GetCultureInfo(

Просмотреть файл

@ -5,7 +5,7 @@
<PropertyGroup>
<Product>Microsoft .NET Extensions</Product>
<Description>Application localization services and default implementation based on ResourceManager to load localized assembly resources.</Description>
<TargetFrameworks>net451;netstandard1.3</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>localization</PackageTags>

Просмотреть файл

@ -3,8 +3,8 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -3,7 +3,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -59,7 +59,7 @@ namespace Microsoft.AspNetCore.Localization.FunctionalTests
{
ApplicationBaseUriHint = applicationBaseUrl,
EnvironmentName = environmentName,
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net452" : "netcoreapp1.1"
TargetFramework = runtimeFlavor == RuntimeFlavor.Clr ? "net46" : "netcoreapp2.0"
};
using (var deployer = ApplicationDeployerFactory.Create(deploymentParameters, logger))

Просмотреть файл

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -3,8 +3,10 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -37,13 +37,9 @@ namespace Microsoft.AspNetCore.Localization.Tests
{
// Arrange
var explicitCulture = new CultureInfo("fr-FR");
#if NET452
Thread.CurrentThread.CurrentCulture = explicitCulture;
Thread.CurrentThread.CurrentUICulture = explicitCulture;
#else
CultureInfo.CurrentCulture = explicitCulture;
CultureInfo.CurrentUICulture = explicitCulture;
#endif
// Act
var options = new RequestLocalizationOptions();
@ -78,13 +74,8 @@ namespace Microsoft.AspNetCore.Localization.Tests
{
// Arrange
var explicitCulture = new CultureInfo("fr-FR");
#if NET452
Thread.CurrentThread.CurrentCulture = explicitCulture;
Thread.CurrentThread.CurrentUICulture = explicitCulture;
#else
CultureInfo.CurrentCulture = explicitCulture;
CultureInfo.CurrentUICulture = explicitCulture;
#endif
// Act
var options = new RequestLocalizationOptions();
@ -96,13 +87,8 @@ namespace Microsoft.AspNetCore.Localization.Tests
public void Dispose()
{
#if NET452
Thread.CurrentThread.CurrentCulture = _initialCulture;
Thread.CurrentThread.CurrentUICulture = _initialUICulture;
#else
CultureInfo.CurrentCulture = _initialCulture;
CultureInfo.CurrentUICulture = _initialUICulture;
#endif
}
}
}

Просмотреть файл

@ -3,8 +3,8 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.1;net452</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
@ -21,7 +21,7 @@
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp1.1' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">
<PackageReference Include="System.Resources.Writer" Version="$(CoreFxVersion)" />
</ItemGroup>

Просмотреть файл

@ -3,8 +3,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.6</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.6</TargetFrameworks>
<TargetFramework>netstandard1.0</TargetFramework>
</PropertyGroup>
</Project>

Просмотреть файл

@ -3,8 +3,7 @@
<Import Project="..\..\build\common.props" />
<PropertyGroup>
<TargetFrameworks>net452;netstandard1.6</TargetFrameworks>
<TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netstandard1.6</TargetFrameworks>
<TargetFramework>netstandard1.3</TargetFramework>
</PropertyGroup>
<ItemGroup>