Compare commits

..

2 Commits

Author SHA1 Message Date
81308c2f79 Ajustes de VSCode Confirmacion 2025-01-28 18:56:36 -03:00
6624459bb0 Ajustes para VSCode 2025-01-28 18:55:03 -03:00
7 changed files with 57 additions and 9 deletions

1
.gitignore vendored
View File

@ -416,3 +416,4 @@ FodyWeavers.xsd
/Services/obj/Debug/net8.0/Services.assets.cache /Services/obj/Debug/net8.0/Services.assets.cache
/Services/obj/Debug/net8.0/Services.csproj.FileListAbsolute.txt /Services/obj/Debug/net8.0/Services.csproj.FileListAbsolute.txt
/Transversal/obj/Debug/net8.0/Transversal.csproj.FileListAbsolute.txt /Transversal/obj/Debug/net8.0/Transversal.csproj.FileListAbsolute.txt
/phronCare.Test/bin/Debug/net8.0/nunit_random_seed.tmp

28
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,28 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch phronCare API",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/phronCare.API/bin/Debug/net8.0/phronCare.API.dll",
"args": [],
"cwd": "${workspaceFolder}/phronCare.API",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)",
"uriFormat": "%s/swagger/index.html"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_CONFIGURATION": "appsettings.json"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}
]
}

16
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/phronCare/phronCare.API/phronCare.API.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View File

@ -16,6 +16,9 @@ using Services.Interfaces;
using System.Text; using System.Text;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
// Asegúrate de que el archivo appsettings.json se cargue correctamente
builder.Configuration.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true);
#region DbContext Identity Configuration #region DbContext Identity Configuration
var configuration = builder.Configuration; var configuration = builder.Configuration;
@ -69,6 +72,10 @@ builder.Services.AddAuthentication(options =>
#region Email Configuration #region Email Configuration
var emailConfig = configuration.GetSection("EmailConfiguration").Get<EmailConfiguration>(); var emailConfig = configuration.GetSection("EmailConfiguration").Get<EmailConfiguration>();
if (emailConfig == null)
{
throw new InvalidOperationException("La configuración del correo electrónico no se encontró o es inválida.");
}
builder.Services.AddSingleton(emailConfig); builder.Services.AddSingleton(emailConfig);
builder.Services.AddScoped<IEmailService, EmailService>(); builder.Services.AddScoped<IEmailService, EmailService>();
#endregion #endregion

View File

@ -1,8 +0,0 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}

View File

@ -43,5 +43,10 @@
<ProjectReference Include="..\Domain\Domain.csproj" /> <ProjectReference Include="..\Domain\Domain.csproj" />
<ProjectReference Include="..\Services\Services.csproj" /> <ProjectReference Include="..\Services\Services.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -1 +0,0 @@
328406426