Closed tharris9d closed 2 years ago
@matkoch I thought this was fixed in 6.0.1 or is it queued up for upcoming 6.0.2 ?
What does EnvironmentInfo.SpecialFolder(SpecialFolders.ProgramFiles)
return?
For me (I am not experiencing the reported issue), it returns C:\Program Files
@tharris9d I did this test by adding this to any target and putting a breakpoint to look at the output at that stage:
Serilog.Log.Information(EnvironmentInfo.SpecialFolder(SpecialFolders.ProgramFiles));
Let us know if you get something odd on your side with this...
As soon as I get back to my computer I will check it out.
I get "C:\Program Files". I have VS Community 2022 installed on D:\Program Files. Could that be the issue?
That's definitely the issue. You could rely on VSWhere instead which takes a different approach on resolving the installation directory. Nothing pre-existing though.
Yeah, this is a bit of an edge case here as I believe there is no nice way in Windows to have software installed at multiple Program Files locations and the %PROGRAMFILES% environment variable is probably not setup to know about the d: location.
I tried to use VsWhere a bit to try and implement a solution that would cover this use case, but after about an hour I was not able to figure out how it's supposed to be used. I'll close this issue but if some idea come up to make this work in another way than to hardcode the path, please do submit a PR and I'll be glad to make it part of the template.
No errors until hitting the target compile... I will hard code the path again for now. Same issue with Target UnitTests and Target IntegrationTests Added: .SetProcessToolPath(@"D:\Program Files\Microsoft Visual Studio\2022\Community\MSbuild\Current\Bin\msbuild.exe") to all three. It is all working with the change.