microsoft/poshtools

Random Failures Running ps1

crocodileGena opened this issue ยท 0 comments

Under VS, in the postbuild phase where I run a ps1 file I get the following error:
AuthorizationManager check failed.

  • CategoryInfo : SecurityError: (๐Ÿ˜ƒ [], ParentContainsErrorRecordException
  • FullyQualifiedErrorId : UnauthorizedAccess

Reading about this, most information goes to permissions etcโ€™.
But this error only appears very rarely and randomly. So 99% of the times it all builds fine. So it doesn't seem to be an issue of signing or permissions, otherwise it would fail constantly.

It happens more frequently when building a project with many dependencies, hence many calls for the ps1 (every project calls this ps1 file in its postbuild). Could it be an issue of timings? where several projects try to use the same file?

It is very hard to reproduce hence very hard to understand and isolate the problem.
What could be the reasons for such failure? is it a known issue that was solved (or not) in specific VS version?

To resolve it, I sometimes just build again, sometimes have to clean build products or re-launch VS.

Will happily supply additional information as required.
Any idea or advice would be greatly appreciated.

Tomer