无法加载DLL '将XML发送到Windows CE以进行配置

本文关键字:Windows CE 配置 XML DLL 加载 | 更新日期: 2023-09-27 18:12:43

我正在准备msi文件从计算机自动安装我的windows ce应用程序,我想卸载应用程序,如果已经安装。我的代码:

      Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software''microsoft''windows''currentversion''app paths''ceappmgr.exe");string appPath = key.GetValue(null).ToString();
            ProcessStartInfo info = new ProcessStartInfo();
            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

            doc.LoadXml("<wap-provisioningdoc>" +
        "<characteristic type='"UnInstall'">" +
                  "<characteristic type='"AppName'">" +
                    "<parm name='"uninstall'" value='"1'"/>" +
                  "</characteristic>" +
                "</characteristic>" +
            "</wap-provisioningdoc>");
Microsoft.WindowsMobile.Configuration.ConfigurationManager.ProcessConfiguration(doc, false);
            info.Arguments = "Arguments here";
            info.FileName = appPath;
            process.StartInfo = info;
            process.Start();

我得到"无法加载DLL 'aygshell.dll':指定的模块无法找到。(Exception from HRESULT: 0x8007007E)" Exception
这是堆栈跟踪:

Microsoft.WindowsMobile.Configuration.ConfigurationManager.SafeNativeMethods。DMProcessConfigXml(String wapDocument, UInt32 flags, IntPtr&在Microsoft.WindowsMobile.Configuration.ConfigurationManager。MainConfigurator(xmldocumentconfigdoc, UInt32 flags)在Microsoft.WindowsMobile.Configuration.ConfigurationManager。ProcessConfiguration(XmlDocument configDoc, Boolean元数据)at setupconsoleapp1. class1 .installfile() in FileLocation'setupconsoleapp1'setupconsoleapp1'Class1.cs:line 251 at setupconsoleapp1. program。Main(String[] args) in FileLocation'Program.cs:line 13 at System.AppDomain。_nExecuteAssembly(Assembly Assembly, String[] args)在System.AppDomain。在system . runtime . hosting . manifest . executeassembly(程序集汇编,String[] args)。在System.Runtime.Hosting.ApplicationActivator. executeasassembly()上运行(Boolean checkAptModel)。创建实例(ActivationContext ActivationContext, String[] activationCustomData)在System.Runtime.Hosting.ApplicationActivator。在System.Activator上创建实例(ActivationContext)。创建实例(ActivationContext ActivationContext)在Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()在System.Threading.ThreadHelper。ThreadStart_Context(对象状态)在System.Threading.ExecutionContext。运行(ExecutionContext ExecutionContext, ContextCallback callback, Object state)在System.Threading.ThreadHelper.ThreadStart()

无法加载DLL '将XML发送到Windows CE以进行配置

你谈到了Windows Mobile和Windows CE。这些是相同核心操作系统的不同版本,虽然aygshell是任何Windows Mobile设备都可以使用的组件,但它可能不是Windows CE操作系统映像的一部分。Windows CE更具可配置性,一些oem可能会删除不需要的组件。Aygshell不包含在较便宜的操作系统核心许可证中(至少到CE 6.0),因此OEM可能会决定删除它以降低设备价格。