Relative Content

Tag Archive for c#apirestasp.net-web-api

Web api Minimal Read Windows environment variable as authentication token .net 8

I should read an environment variable that I stored at the Windows operating system level, which contains an authentication token that my middleware class uses to authenticate me with my minimal web api with .net 8. With environment.getvariable I always get an empty string, how can I solve it? I also tried with the process, user, machine targets but I notice that these only work in debug from Visual Studio, but they don’t work as soon as I publish the app in IIS.