I completely frustrated with this issue and dot know how to solve it. I guess it happened after some windows update because it was working well before. My OS is WINDOWS 11 Pro 22H2 OS Build #22621.674 So the issue is then when you try to access any environment registered folder like %<FOLDER>% the C# code returns path in application root folder. Example
new DirectoryInfo("%TEMP%") //=>result: "<AppRootPath>\%TEMP%"
or
Path.GetFullPath("%USERPROFILE%") //=>result: "<AppRootPath>\%USERPROFILE%"
In my solution I have few settings pointed on the %temp% folder for dev environment and it is really annoing now to delete all these new %TEMP% folders in my solution directory after debugging.
What I found else it is when I try to execute 'cd %TEMP%' in command line it works like a sharm, but if only I do the same in powershel it returns me the folder not found error, at the same time 'cd $env:temp' works as expected.
I want to emphasize once again that it worked well before.
Hope some one of you can help me with this weird issue. Thank you in advance.