Add CommandDotNet and update logging configuration

- Included `CommandDotNet.Execution` namespace in `Program.cs`.
- Adjusted logging setup to clear providers and use NLog only in non-development environments.
- Added `AddHttpContextAccessor` to the service collection.
- Introduced a new `ConnectionStrings` section in `appsettings.Development.json` with a database connection string.
This commit is contained in:
Developer 02 2025-05-10 02:39:32 +02:00
parent 00fedc7c4c
commit b01f13fb5f
2 changed files with 12 additions and 3 deletions

View File

@ -24,9 +24,13 @@ try
{
var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
builder.Host.UseNLog();
if (!builder.Environment.IsDevelopment())
{
builder.Logging.ClearProviders();
builder.Host.UseNLog();
}
var config = builder.Configuration;
@ -51,6 +55,8 @@ try
// Add higher order services
builder.Services.AddScoped<EnvelopeOldService>();
builder.Services.AddHttpContextAccessor();
builder.ConfigureBySection<TFARegParams>();
// Add controllers and razor views

View File

@ -7,5 +7,8 @@
}
},
"AdminPassword": "dd",
"UseCSPInDev": false
"UseCSPInDev": false,
"ConnectionStrings": {
"Default": "Server=sDD-VMP04-SQL19\\CURSORAG;Database=DD_ECM;User Id=sa;Password=dd;Encrypt=false;TrustServerCertificate=True;"
}
}