Browse Source

Updating to 2.1RC1

main
Steve Smith 8 years ago
parent
commit
80604062d9
  1. 5
      src/Infrastructure/Infrastructure.csproj
  2. 8
      src/Web/Program.cs
  3. 8
      src/Web/Properties/launchSettings.json
  4. 5
      src/Web/Startup.cs
  5. 8
      src/Web/Web.csproj
  6. 2
      src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml
  7. 2
      src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs
  8. 8
      src/WebRazorPages/Program.cs
  9. 4
      src/WebRazorPages/Properties/launchSettings.json
  10. 3
      src/WebRazorPages/Startup.cs
  11. 5
      src/WebRazorPages/WebRazorPages.csproj
  12. 1
      tests/UnitTests/UnitTests.csproj

5
src/Infrastructure/Infrastructure.csproj

@ -13,11 +13,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" /> <ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.2" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.2" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Data\Migrations\" /> <Folder Include="Data\Migrations\" />
</ItemGroup> </ItemGroup>

8
src/Web/Program.cs

@ -13,7 +13,8 @@ namespace Microsoft.eShopWeb
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = BuildWebHost(args); var host = CreateWebHostBuilder(args)
.Build();
using (var scope = host.Services.CreateScope()) using (var scope = host.Services.CreateScope())
{ {
@ -38,10 +39,9 @@ namespace Microsoft.eShopWeb
host.Run(); host.Run();
} }
public static IWebHost BuildWebHost(string[] args) => public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args) WebHost.CreateDefaultBuilder(args)
.UseUrls("http://0.0.0.0:5106") .UseUrls("http://0.0.0.0:5106")
.UseStartup<Startup>() .UseStartup<Startup>();
.Build();
} }
} }

8
src/Web/Properties/launchSettings.json

@ -1,10 +1,10 @@
{ {
"iisSettings": { "iisSettings": {
"windowsAuthentication": false, "windowsAuthentication": false,
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:5106/", "applicationUrl": "http://localhost:5106/",
"sslPort": 0 "sslPort": 44316
} }
}, },
"profiles": { "profiles": {
@ -16,7 +16,7 @@
} }
}, },
"eShopWeb": { "eShopWeb": {
"commandName": "Project", "commandName": "IISExpress",
"launchBrowser": true, "launchBrowser": true,
"environmentVariables": { "environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development" "ASPNETCORE_ENVIRONMENT": "Development"
@ -24,4 +24,4 @@
"applicationUrl": "http://localhost:5106" "applicationUrl": "http://localhost:5106"
} }
} }
} }

5
src/Web/Startup.cs

@ -106,7 +106,8 @@ namespace Microsoft.eShopWeb
// Add memory cache services // Add memory cache services
services.AddMemoryCache(); services.AddMemoryCache();
services.AddMvc(); services.AddMvc()
.SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1);
_services = services; _services = services;
} }
@ -125,8 +126,10 @@ namespace Microsoft.eShopWeb
else else
{ {
app.UseExceptionHandler("/Catalog/Error"); app.UseExceptionHandler("/Catalog/Error");
app.UseHsts();
} }
app.UseHttpsRedirection();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseAuthentication(); app.UseAuthentication();

8
src/Web/Web.csproj

@ -6,7 +6,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Dapper" Version="1.50.5" /> <PackageReference Include="Dapper" Version="1.50.5" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" /> <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0-rc1-final" PrivateAssets="All" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.1.0-rc1-final" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0-rc1-final" PrivateAssets="All" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0-rc1-final" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
@ -18,12 +18,6 @@
<ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" /> <ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" />
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj" /> <ProjectReference Include="..\Infrastructure\Infrastructure.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="2.0.0" />
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="wwwroot\images\products\1.png" /> <None Include="wwwroot\images\products\1.png" />
<None Include="wwwroot\images\products\10.png" /> <None Include="wwwroot\images\products\10.png" />

2
src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml

@ -1,5 +1,5 @@
@page @page
@model LoginWithRecoveryCodeModel @model LoginWithRecoveryCodeModel
@{ @{
ViewData["Title"] = "Recovery code verification"; ViewData["Title"] = "Recovery code verification";
} }

2
src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs

@ -7,7 +7,7 @@ using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.eShopWeb.RazorPages.Pages.Account.Manage namespace Microsoft.eShopWeb.RazorPages.Pages.Account
{ {
public class LoginWithRecoveryCodeModel : PageModel public class LoginWithRecoveryCodeModel : PageModel
{ {

8
src/WebRazorPages/Program.cs

@ -13,7 +13,8 @@ namespace Microsoft.eShopWeb.RazorPages
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = BuildWebHost(args); var host = CreateWebHostBuilder(args)
.Build();
using (var scope = host.Services.CreateScope()) using (var scope = host.Services.CreateScope())
{ {
@ -38,10 +39,9 @@ namespace Microsoft.eShopWeb.RazorPages
host.Run(); host.Run();
} }
public static IWebHost BuildWebHost(string[] args) => public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args) WebHost.CreateDefaultBuilder(args)
.UseUrls("http://0.0.0.0:5106") .UseUrls("http://0.0.0.0:5106")
.UseStartup<Startup>() .UseStartup<Startup>();
.Build();
} }
} }

4
src/WebRazorPages/Properties/launchSettings.json

@ -4,7 +4,7 @@
"anonymousAuthentication": true, "anonymousAuthentication": true,
"iisExpress": { "iisExpress": {
"applicationUrl": "http://localhost:28655/", "applicationUrl": "http://localhost:28655/",
"sslPort": 0 "sslPort": 44305
} }
}, },
"profiles": { "profiles": {
@ -24,4 +24,4 @@
"applicationUrl": "http://localhost:28656/" "applicationUrl": "http://localhost:28656/"
} }
} }
} }

3
src/WebRazorPages/Startup.cs

@ -107,6 +107,7 @@ namespace Microsoft.eShopWeb.RazorPages
services.AddMemoryCache(); services.AddMemoryCache();
services.AddMvc() services.AddMvc()
.SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
.AddRazorPagesOptions(options => .AddRazorPagesOptions(options =>
{ {
options.Conventions.AuthorizeFolder("/Order"); options.Conventions.AuthorizeFolder("/Order");
@ -130,8 +131,10 @@ namespace Microsoft.eShopWeb.RazorPages
else else
{ {
app.UseExceptionHandler("/Catalog/Error"); app.UseExceptionHandler("/Catalog/Error");
app.UseHsts();
} }
app.UseHttpsRedirection();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseAuthentication(); app.UseAuthentication();

5
src/WebRazorPages/WebRazorPages.csproj

@ -5,10 +5,7 @@
<AssemblyName>Microsoft.eShopWeb.RazorPages</AssemblyName> <AssemblyName>Microsoft.eShopWeb.RazorPages</AssemblyName>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0-rc1-final" /> <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0-rc1-final" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" /> <ProjectReference Include="..\ApplicationCore\ApplicationCore.csproj" />

1
tests/UnitTests/UnitTests.csproj

@ -6,7 +6,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0-rc1-final" /> <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.0-rc1-final" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0-preview-20180510-03" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0-preview-20180510-03" />
<PackageReference Include="Moq" Version="4.8.2" /> <PackageReference Include="Moq" Version="4.8.2" />
<PackageReference Include="xunit" Version="2.4.0-beta.1.build3958" /> <PackageReference Include="xunit" Version="2.4.0-beta.1.build3958" />

Loading…
Cancel
Save