| Severity | Warning |
| Reported by | PostSharp |
| Message | Intermittent runtime failure (<Host>). PostSharp restarts the compiler and tries again: <Exception> |
Cause
When PostSharp runs in a .NET Framework process, it queries the .NET Framework runtime through its COM hosting API. On some machines, this query intermittently fails with the error code 0x80070018 (ERROR_BAD_LENGTH), a failure that only a new process clears. PostSharp then reports PS0199, records a crash report, and the compiler process exits with a dedicated exit code. The PostSharp task of MSBuild recognizes this exit code, logs the warning "Encountered intermittent runtime failure... attempting to restart.", and starts the compiler again, up to three attempts in all.
<Host> identifies the PostSharp process and the runtime that runs it. <Exception> is the full text of the exception, with its stack trace.
PS0199 is a warning: when a later attempt succeeds, the build succeeds. On the last attempt, PostSharp no longer allows a restart, so the same failure is reported as the error PS0099.
This message depends on a transient failure of the .NET Framework runtime of the machine, so no example can show it.
Resolution
- When the warning appears once in a while and the build succeeds, no action is needed.
- When the build fails with PS0099 after the warnings, rebuild. If the failure persists, restart the machine, which clears the state of the runtime, and check that the latest updates of the .NET Framework are installed.
- When the failure recurs on a machine, report it to the PostSharp support team, at https://www.postsharp.net/support, with the full text of the message and the build log. To trace what the compiler does, set the
PostSharpTraceMSBuild property, as Well-Known MSBuild Properties describes.
See Also
Other Resources
Well-Known MSBuild Properties
Well-Known Environment Variables