I have created a utility in C#, something basic. I have it running during an SCCM task sequence deployment. One of the first things it does (during the form load event) is q
It appears that the System.Windows.Forms assembly wasn't loaded. I found this out by trying to create a form with powershell, and powershell gave an error that said it couldn't find the type. After googling, I came across a fix that said to use [System.Reflection.Assembly]::LoadWithPartialName method to load the assembly, and I loaded the System.Windows.Forms assembly. After that, I created a form in powershell and it displayed without a problem, and after I ran my app again it displayed the gui fine.
UPDATE
Looks like I've found my answer: The task sequence runs in session 0, i.e., no gui! http://blogs.technet.com/b/cameronk/archive/2010/04/27/creating-a-user-interactive-task-sequence-experience.aspx
Update 20130219
I wound up using psexec and calling my executable from it, using
psexec.exe -accepteula -s -i -h C:\_SMSTaskSequence\Packages\STE000AAA\myapp.exe