Question

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 query ldap. That portion of code is in a try block and an exception is caught and the error message displays, but the form never shows up. On my dev machine when there was an error I would get the message but the form would display afterward.

I have verified that all the dll's I'm calling are installed on the WinPE, has anyone done any .NET development for WinPE yet? This is WinPE 4.0 and I have installed .NET 4.0 and other software using the dism tool that comes with the Windows 8 ADK. Nothing much on the net yet since .NET support in WinPE is fairly new.

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top