Merge branch 'Desarrollo' into DEV-LT
This commit is contained in:
commit
fb266caa62
4 changed files with 33 additions and 4 deletions
|
@ -14,6 +14,16 @@ namespace Integracion_DGA
|
||||||
{
|
{
|
||||||
static async Task Main(string[] args)
|
static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
|
IConfiguration configuration;
|
||||||
|
|
||||||
|
configuration = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
|
.AddEnvironmentVariables()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
FileLoggerHelper.ConfigureLogger(configuration);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.Write("Obteniendo variables de entorno...");
|
Console.Write("Obteniendo variables de entorno...");
|
||||||
|
@ -35,9 +45,7 @@ namespace Integracion_DGA
|
||||||
using IHost host = Host.CreateDefaultBuilder(args)
|
using IHost host = Host.CreateDefaultBuilder(args)
|
||||||
.ConfigureServices((context, services) =>
|
.ConfigureServices((context, services) =>
|
||||||
{
|
{
|
||||||
IConfiguration configuration = context.Configuration;
|
|
||||||
services.AddSingleton<IConfiguration>(configuration);
|
services.AddSingleton<IConfiguration>(configuration);
|
||||||
|
|
||||||
services.AddScoped<MedicionScadaRepository>();
|
services.AddScoped<MedicionScadaRepository>();
|
||||||
services.AddScoped<EnvioDGA>();
|
services.AddScoped<EnvioDGA>();
|
||||||
services.AddHttpClient<RegistrarMedicion>();
|
services.AddHttpClient<RegistrarMedicion>();
|
||||||
|
|
|
@ -14,6 +14,16 @@ namespace Recuperacion_DGA
|
||||||
{
|
{
|
||||||
static async Task Main(string[] args)
|
static async Task Main(string[] args)
|
||||||
{
|
{
|
||||||
|
IConfiguration configuration;
|
||||||
|
|
||||||
|
configuration = new ConfigurationBuilder()
|
||||||
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
|
.AddEnvironmentVariables()
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
FileLoggerHelper.ConfigureLogger(configuration);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Console.WriteLine("Obteniendo variables de entorno...");
|
Console.WriteLine("Obteniendo variables de entorno...");
|
||||||
|
@ -35,9 +45,7 @@ namespace Recuperacion_DGA
|
||||||
using IHost host = Host.CreateDefaultBuilder(args)
|
using IHost host = Host.CreateDefaultBuilder(args)
|
||||||
.ConfigureServices((context, services) =>
|
.ConfigureServices((context, services) =>
|
||||||
{
|
{
|
||||||
IConfiguration configuration = context.Configuration;
|
|
||||||
services.AddSingleton<IConfiguration>(configuration);
|
services.AddSingleton<IConfiguration>(configuration);
|
||||||
|
|
||||||
services.AddScoped<MedicionScadaRepository>();
|
services.AddScoped<MedicionScadaRepository>();
|
||||||
services.AddScoped<EnvioDGA>();
|
services.AddScoped<EnvioDGA>();
|
||||||
services.AddHttpClient<RegistrarMedicion>();
|
services.AddHttpClient<RegistrarMedicion>();
|
||||||
|
|
|
@ -20,4 +20,10 @@
|
||||||
<ProjectReference Include="..\SHARED\Shared.csproj" />
|
<ProjectReference Include="..\SHARED\Shared.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="appsettings.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
7
Recuperacion_DGA/appsettings.json
Normal file
7
Recuperacion_DGA/appsettings.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogFile": {
|
||||||
|
"Path": "logs/log.txt"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue