From 2555e5851591b16a016ef5d1cdc3206165e5c7ac Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 29 Nov 2020 19:47:10 +0000 Subject: [PATCH] --- .vscode/launch.json | 2 +- Program.cs | 9 +-------- Startup.cs | 17 +++-------------- contact.csproj | 4 ++-- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index baca5d9..388c3f8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/contact.dll", + "program": "${workspaceFolder}/bin/Debug/net5.0/contact.dll", "args": [], "cwd": "${workspaceFolder}", "stopAtEntry": false, diff --git a/Program.cs b/Program.cs index f052b59..a6518bb 100644 --- a/Program.cs +++ b/Program.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Logging; namespace contact { diff --git a/Startup.cs b/Startup.cs index b5be05e..ef2b38d 100644 --- a/Startup.cs +++ b/Startup.cs @@ -1,11 +1,9 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; - namespace contact { public class Startup @@ -21,16 +19,7 @@ namespace contact public void ConfigureServices(IServiceCollection services) { services.AddControllers().AddNewtonsoftJson(); -services.AddRazorPages(); - // services.Configure(options => - // { - // // This lambda determines whether user consent for non-essential cookies is needed for a given request. - // options.CheckConsentNeeded = context => true; - // options.MinimumSameSitePolicy = SameSiteMode.None; - // }); - - - // services.AddMvc();//.SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + services.AddRazorPages(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -48,13 +37,13 @@ services.AddRazorPages(); // app.UseHttpsRedirection(); app.UseStaticFiles(); - // app.UseCookiePolicy(); + // app.UseCookiePolicy(); app.UseRouting(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); endpoints.MapRazorPages(); - + }); // app.UseMvc(); diff --git a/contact.csproj b/contact.csproj index 1d75cce..5a4fdd6 100644 --- a/contact.csproj +++ b/contact.csproj @@ -1,11 +1,11 @@ - netcoreapp3.1 + net5.0 - +