On various windows 10 machines we are experiencing a very strange behaviour. We have installed a custom dotnet tool, let's call it Foo
.
Then we perform a series of commands to this tool from within one powershell script, e.g.
# do_job.ps1
Foo job1
Foo job2
Now sometimes there is a very strange behaviour of this execution, where the first call Foo job1
results in No .NET SDKs were found.
. Then the script immediately proceeds to call the next Foo
which then works.
Repeating the script then works for both calls, eventually hours or days later another machine experience this transient fault, which cannot be reproduced on this machine.
I can't explain and only guess what is happening there. We are not installing any sdks in this script but this behaviour looks like the dotnet runtime being lazy loaded into the powershell session and sometimes be slower then the next executed statement in the script itself. (Which is a wild guess because I haven't found any hint on what actually is happening there) Since it is so flaky I cannot properly observe the system to actually identify any pattern.
Any hint is appreciated!