diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj
index 9e43241..8081b93 100644
--- a/src/Infrastructure/Infrastructure.csproj
+++ b/src/Infrastructure/Infrastructure.csproj
@@ -13,11 +13,6 @@
-
-
-
-
-
diff --git a/src/Web/Program.cs b/src/Web/Program.cs
index beabb52..cd6c478 100644
--- a/src/Web/Program.cs
+++ b/src/Web/Program.cs
@@ -13,7 +13,8 @@ namespace Microsoft.eShopWeb
{
public static void Main(string[] args)
{
- var host = BuildWebHost(args);
+ var host = CreateWebHostBuilder(args)
+ .Build();
using (var scope = host.Services.CreateScope())
{
@@ -38,10 +39,9 @@ namespace Microsoft.eShopWeb
host.Run();
}
- public static IWebHost BuildWebHost(string[] args) =>
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://0.0.0.0:5106")
- .UseStartup()
- .Build();
+ .UseStartup();
}
}
diff --git a/src/Web/Properties/launchSettings.json b/src/Web/Properties/launchSettings.json
index d83765d..39a19ed 100644
--- a/src/Web/Properties/launchSettings.json
+++ b/src/Web/Properties/launchSettings.json
@@ -1,10 +1,10 @@
-{
+{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:5106/",
- "sslPort": 0
+ "sslPort": 44316
}
},
"profiles": {
@@ -16,7 +16,7 @@
}
},
"eShopWeb": {
- "commandName": "Project",
+ "commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
@@ -24,4 +24,4 @@
"applicationUrl": "http://localhost:5106"
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Web/Startup.cs b/src/Web/Startup.cs
index 6a513dd..b4f1b02 100644
--- a/src/Web/Startup.cs
+++ b/src/Web/Startup.cs
@@ -106,7 +106,8 @@ namespace Microsoft.eShopWeb
// Add memory cache services
services.AddMemoryCache();
- services.AddMvc();
+ services.AddMvc()
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1);
_services = services;
}
@@ -125,8 +126,10 @@ namespace Microsoft.eShopWeb
else
{
app.UseExceptionHandler("/Catalog/Error");
+ app.UseHsts();
}
+ app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAuthentication();
diff --git a/src/Web/Web.csproj b/src/Web/Web.csproj
index 2517d19..c21c79e 100644
--- a/src/Web/Web.csproj
+++ b/src/Web/Web.csproj
@@ -6,7 +6,7 @@
-
+
@@ -18,12 +18,6 @@
-
-
-
-
-
-
diff --git a/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml b/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml
index 4b32c1d..23e1a3a 100644
--- a/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml
+++ b/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml
@@ -1,5 +1,5 @@
@page
-@model LoginWithRecoveryCodeModel
+@model LoginWithRecoveryCodeModel
@{
ViewData["Title"] = "Recovery code verification";
}
diff --git a/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs b/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs
index 10456b4..4dc66f1 100644
--- a/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs
+++ b/src/WebRazorPages/Pages/Account/LoginWithRecoveryCode.cshtml.cs
@@ -7,7 +7,7 @@ using System;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
-namespace Microsoft.eShopWeb.RazorPages.Pages.Account.Manage
+namespace Microsoft.eShopWeb.RazorPages.Pages.Account
{
public class LoginWithRecoveryCodeModel : PageModel
{
diff --git a/src/WebRazorPages/Program.cs b/src/WebRazorPages/Program.cs
index 0231615..e66d201 100644
--- a/src/WebRazorPages/Program.cs
+++ b/src/WebRazorPages/Program.cs
@@ -13,7 +13,8 @@ namespace Microsoft.eShopWeb.RazorPages
{
public static void Main(string[] args)
{
- var host = BuildWebHost(args);
+ var host = CreateWebHostBuilder(args)
+ .Build();
using (var scope = host.Services.CreateScope())
{
@@ -38,10 +39,9 @@ namespace Microsoft.eShopWeb.RazorPages
host.Run();
}
- public static IWebHost BuildWebHost(string[] args) =>
+ public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseUrls("http://0.0.0.0:5106")
- .UseStartup()
- .Build();
+ .UseStartup();
}
}
diff --git a/src/WebRazorPages/Properties/launchSettings.json b/src/WebRazorPages/Properties/launchSettings.json
index 82033f4..1c92721 100644
--- a/src/WebRazorPages/Properties/launchSettings.json
+++ b/src/WebRazorPages/Properties/launchSettings.json
@@ -4,7 +4,7 @@
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:28655/",
- "sslPort": 0
+ "sslPort": 44305
}
},
"profiles": {
@@ -24,4 +24,4 @@
"applicationUrl": "http://localhost:28656/"
}
}
-}
+}
\ No newline at end of file
diff --git a/src/WebRazorPages/Startup.cs b/src/WebRazorPages/Startup.cs
index 41570f8..892cafd 100644
--- a/src/WebRazorPages/Startup.cs
+++ b/src/WebRazorPages/Startup.cs
@@ -107,6 +107,7 @@ namespace Microsoft.eShopWeb.RazorPages
services.AddMemoryCache();
services.AddMvc()
+ .SetCompatibilityVersion(AspNetCore.Mvc.CompatibilityVersion.Version_2_1)
.AddRazorPagesOptions(options =>
{
options.Conventions.AuthorizeFolder("/Order");
@@ -130,8 +131,10 @@ namespace Microsoft.eShopWeb.RazorPages
else
{
app.UseExceptionHandler("/Catalog/Error");
+ app.UseHsts();
}
+ app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseAuthentication();
diff --git a/src/WebRazorPages/WebRazorPages.csproj b/src/WebRazorPages/WebRazorPages.csproj
index b553b5a..212f4ed 100644
--- a/src/WebRazorPages/WebRazorPages.csproj
+++ b/src/WebRazorPages/WebRazorPages.csproj
@@ -5,10 +5,7 @@
Microsoft.eShopWeb.RazorPages
-
-
-
-
+
diff --git a/tests/UnitTests/UnitTests.csproj b/tests/UnitTests/UnitTests.csproj
index 54d9bf1..2ab180e 100644
--- a/tests/UnitTests/UnitTests.csproj
+++ b/tests/UnitTests/UnitTests.csproj
@@ -6,7 +6,6 @@
-