Quick Tip: Windows PowerShell execution policy handling for x64 and x86 processes

Windows PowerShell’s execution policy is well known feature that helps prevent users from accidentally running malicious scripts. I hit an interesting situation recently where Get-ExecutionPolicy showed that I was allowed to run scripts, but in practice I still couldn’t execute scripts from a .NET application’s hosted runspace. What was the problem? The execution policy settings differed across x64 and x86 processes. Since this problem isn’t covered in the official documentation I figured it deserved a quick write-up.

Continue reading

How to capture and debug .NET application crash dumps in Windows

It is important for software engineers to understand how to analyze process dumps so that they can determine why their application is crashing or behaving unexpectedly. However, it can be hard to know where to start with the process. This post aims to be a starting point for a very common situation: debugging a crash dump for a .NET application running on Windows. A crashing application is easily detected in the Windows Event Log when the .NET Framework logs the error, “The process was terminated due to an unhandled exception.”
Continue reading