.NET界面不显示在WinPE的 [英] .NET GUI Not Displaying in WinPE

查看:228
本文介绍了.NET界面不显示在WinPE的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经建立在C#中,一些基本的工具。我有一个在SCCM任务序列部署运行它。其中一个它(的形式加载事件期间)的第一件事就是查询LDAP。的code这部分是在一个try块和异常被捕获和消息显示错误,但形式永远不会出现了。在我的开发机时出现错误,我会得到的消息,但形式会后显示。

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.

我已经验证所有的dll的我打电话安装在WinPE的,有没有人做过任何.NET开发WinPE的了吗?这是WinPE的4.0,我已经安装了.NET 4.0和其他软件使用DISM工具自带的Windows 8 ADK。但因为在WinPE的.NET支持,没有什么太多的净是相当新的。

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.

推荐答案

看来,是不加载System.Windows.Forms的组件。我发现了这一点,试图通过创建PowerShell的一种形式,和PowerShell给了一个错误,表示无法找到的类型。谷歌搜索后,我遇到了一个补丁,建议把使用 [System.Reflection.Assembly] :: LoadWithPartialName 方法加载程序集,我装了System.Windows.Forms的部件。在那之后,我创建了PowerShell中的形式,它显示没有问题,之后我又跑到我的应用程序也显示图形用户界面的罚款。

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.

更新

看起来像我发现我的回答是:任务序列在会话0运行,也就是说,没有图形用户界面! <一href="http://blogs.technet.com/b/cameronk/archive/2010/04/27/creating-a-user-interactive-task-sequence-experience.aspx" rel="nofollow">http://blogs.technet.com/b/cameronk/archive/2010/04/27/creating-a-user-interactive-task-sequence-experience.aspx

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

更新20130219

我结束了使用PSEXEC并从中调用我的可执行文件,使用

I wound up using psexec and calling my executable from it, using

psexec.exe -accepteula -s -i -h C:\_SMSTaskSequence\Packages\STE000AAA\myapp.exe

这篇关于.NET界面不显示在WinPE的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆