From ed7157086f11aabb25da4c5d439cd997cad86ddc Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 04:35:52 +0000 Subject: [PATCH] NET-15: Create .NET Core 6 Web Application Project foundation - Created SampleWebApp.Core project with SDK-style .csproj targeting net6.0 - Enabled nullable reference types and implicit usings - Created folder structure: Controllers/, Views/, Models/, wwwroot/ - Created Program.cs using minimal hosting model - Created appsettings.json and environment-specific variants (Development, Staging, Production) - Created Properties/launchSettings.json with profiles for all environments - Added project to SampleWebApp.sln - Verified project builds successfully with dotnet build Co-Authored-By: ben.lehrburger@windsurf.com --- SampleWebApp.Core/Program.cs | 22 +++++++++ .../Properties/launchSettings.json | 46 +++++++++++++++++++ SampleWebApp.Core/SampleWebApp.Core.csproj | 7 +++ .../appsettings.Development.json | 8 ++++ SampleWebApp.Core/appsettings.Production.json | 8 ++++ SampleWebApp.Core/appsettings.Staging.json | 8 ++++ SampleWebApp.Core/appsettings.json | 12 +++++ SampleWebApp.sln | 10 ++++ 8 files changed, 121 insertions(+) create mode 100644 SampleWebApp.Core/Program.cs create mode 100644 SampleWebApp.Core/Properties/launchSettings.json create mode 100644 SampleWebApp.Core/SampleWebApp.Core.csproj create mode 100644 SampleWebApp.Core/appsettings.Development.json create mode 100644 SampleWebApp.Core/appsettings.Production.json create mode 100644 SampleWebApp.Core/appsettings.Staging.json create mode 100644 SampleWebApp.Core/appsettings.json diff --git a/SampleWebApp.Core/Program.cs b/SampleWebApp.Core/Program.cs new file mode 100644 index 0000000..7531cb3 --- /dev/null +++ b/SampleWebApp.Core/Program.cs @@ -0,0 +1,22 @@ +var builder = WebApplication.CreateBuilder(args); + +builder.Services.AddControllersWithViews(); + +var app = builder.Build(); + +if (!app.Environment.IsDevelopment()) +{ + app.UseExceptionHandler("/Home/Error"); + app.UseHsts(); +} + +app.UseHttpsRedirection(); +app.UseStaticFiles(); +app.UseRouting(); +app.UseAuthorization(); + +app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + +app.Run(); diff --git a/SampleWebApp.Core/Properties/launchSettings.json b/SampleWebApp.Core/Properties/launchSettings.json new file mode 100644 index 0000000..6d44efb --- /dev/null +++ b/SampleWebApp.Core/Properties/launchSettings.json @@ -0,0 +1,46 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:5050", + "sslPort": 44357 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "SampleWebApp.Core (Development)": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "SampleWebApp.Core (Staging)": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Staging" + } + }, + "SampleWebApp.Core (Production)": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:7001;http://localhost:5000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Production" + } + } + } +} diff --git a/SampleWebApp.Core/SampleWebApp.Core.csproj b/SampleWebApp.Core/SampleWebApp.Core.csproj new file mode 100644 index 0000000..cfcdb42 --- /dev/null +++ b/SampleWebApp.Core/SampleWebApp.Core.csproj @@ -0,0 +1,7 @@ + + + net6.0 + enable + enable + + diff --git a/SampleWebApp.Core/appsettings.Development.json b/SampleWebApp.Core/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/SampleWebApp.Core/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/SampleWebApp.Core/appsettings.Production.json b/SampleWebApp.Core/appsettings.Production.json new file mode 100644 index 0000000..8d00523 --- /dev/null +++ b/SampleWebApp.Core/appsettings.Production.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Error", + "Microsoft.AspNetCore": "Error" + } + } +} diff --git a/SampleWebApp.Core/appsettings.Staging.json b/SampleWebApp.Core/appsettings.Staging.json new file mode 100644 index 0000000..bcdd3fc --- /dev/null +++ b/SampleWebApp.Core/appsettings.Staging.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Warning", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/SampleWebApp.Core/appsettings.json b/SampleWebApp.Core/appsettings.json new file mode 100644 index 0000000..b3a7b16 --- /dev/null +++ b/SampleWebApp.Core/appsettings.json @@ -0,0 +1,12 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*", + "ConnectionStrings": { + "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=SampleWebApp;Trusted_Connection=True;MultipleActiveResultSets=true" + } +} diff --git a/SampleWebApp.sln b/SampleWebApp.sln index b474189..44c3474 100644 --- a/SampleWebApp.sln +++ b/SampleWebApp.sln @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution README.md = README.md EndProjectSection EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWebApp.Core", "SampleWebApp.Core\SampleWebApp.Core.csproj", "{BE24DD31-E9DE-46C9-84B0-9E296D813972}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution AzureRelease|Any CPU = AzureRelease|Any CPU @@ -56,6 +58,14 @@ Global {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.Release|Any CPU.ActiveCfg = Release|Any CPU {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.Release|Any CPU.Build.0 = Release|Any CPU {6D9E7904-B2AC-49E3-83A7-6B48876F46B9}.WebWizRelease|Any CPU.ActiveCfg = WebWizRelease|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.AzureRelease|Any CPU.ActiveCfg = Debug|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.AzureRelease|Any CPU.Build.0 = Debug|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.Release|Any CPU.Build.0 = Release|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.WebWizRelease|Any CPU.ActiveCfg = Debug|Any CPU + {BE24DD31-E9DE-46C9-84B0-9E296D813972}.WebWizRelease|Any CPU.Build.0 = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE