Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions SampleWebApp.Core/Program.cs
Original file line number Diff line number Diff line change
@@ -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();
46 changes: 46 additions & 0 deletions SampleWebApp.Core/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
7 changes: 7 additions & 0 deletions SampleWebApp.Core/SampleWebApp.Core.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions SampleWebApp.Core/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
8 changes: 8 additions & 0 deletions SampleWebApp.Core/appsettings.Production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Error",
"Microsoft.AspNetCore": "Error"
}
}
}
8 changes: 8 additions & 0 deletions SampleWebApp.Core/appsettings.Staging.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"Microsoft.AspNetCore": "Warning"
}
}
}
12 changes: 12 additions & 0 deletions SampleWebApp.Core/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=SampleWebApp;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
10 changes: 10 additions & 0 deletions SampleWebApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down