From 8eb17986fac2384b37ec2a93412d64e771ace6bb Mon Sep 17 00:00:00 2001 From: Jose Henrique Date: Sat, 31 May 2025 11:22:04 -0300 Subject: [PATCH] fixing fotos path --- OpenCand.API/Program.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/OpenCand.API/Program.cs b/OpenCand.API/Program.cs index 9c6a3fd..76930c5 100644 --- a/OpenCand.API/Program.cs +++ b/OpenCand.API/Program.cs @@ -12,11 +12,6 @@ namespace OpenCand.API { var builder = WebApplication.CreateBuilder(args); - if (string.IsNullOrEmpty(Environment.ProcessPath)) - { - throw new InvalidOperationException("Environment.ProcessPath is not set. Ensure the application is running in a valid environment."); - } - // Add services to the container. builder.Services.AddControllers(); @@ -34,7 +29,7 @@ namespace OpenCand.API app.UseSwaggerUI(); } - var workingDir = Path.GetDirectoryName(Environment.ProcessPath); + var workingDir = Directory.GetCurrentDirectory(); app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider(Path.Combine(workingDir, "fotos_cand")),