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:
parent
00fedc7c4c
commit
b01f13fb5f
@ -24,9 +24,13 @@ try
|
|||||||
{
|
{
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
builder.Logging.ClearProviders();
|
|
||||||
builder.Logging.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
|
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;
|
var config = builder.Configuration;
|
||||||
|
|
||||||
@ -51,6 +55,8 @@ try
|
|||||||
// Add higher order services
|
// Add higher order services
|
||||||
builder.Services.AddScoped<EnvelopeOldService>();
|
builder.Services.AddScoped<EnvelopeOldService>();
|
||||||
|
|
||||||
|
builder.Services.AddHttpContextAccessor();
|
||||||
|
|
||||||
builder.ConfigureBySection<TFARegParams>();
|
builder.ConfigureBySection<TFARegParams>();
|
||||||
|
|
||||||
// Add controllers and razor views
|
// Add controllers and razor views
|
||||||
|
|||||||
@ -7,5 +7,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AdminPassword": "dd",
|
"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;"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user