English 中文(简体)
我如何从指挥中发射一名WPF的信号。 I m 带上“FontCache”错误
原标题:How do I launch a WPF app from command.com. I m getting a FontCache error

我知道这并非理想,但我的制约因素是,我在剪辑中撰写了一份遗产申请。

我想从申请中(为了便于过渡)启动一项新的WinForms/WPF申请。 这一遗产申请在克莱尔发射时使用:

SwpRunCmd("C:MyAppMyBat.bat",0)

The batch file contained some such as this Direction:

C:PROGRA~1INTERN~1iexplore "http://QASVR/MyApp/AppWin/MyCompany.MyApp.AppWin.application#MyCompany.MyApp.AppWin.application"

它正在发射温Forms/WPF,这是我们通过ClickOnce部署的。 直到我们把妇女论坛引入到申请中,一切都进展顺利。 我们很容易从遗产应用中启动。

然而,自从我们提出妇女论坛以来,我们有以下行为。 如果我们首先通过剪辑申请启动,我们在申请启动时就有一个例外。 错误案文是:

The type initializer for  System.Windows.FrameworkElement  threw an exception.
   at System.Windows.FrameworkElement..ctor()
   at System.Windows.Controls.Panel..ctor()
   at System.Windows.Controls.DockPanel..ctor()
   at System.Windows.Forms.Integration.AvalonAdapter..ctor(ElementHost hostControl)
   at System.Windows.Forms.Integration.ElementHost..ctor()
   at MyCompany.MyApp.AppWin.Main.InitializeComponent()
   at MyCompany.MyApp.AppWin.Main..ctor(String[] args)
   at MyCompany.MyApp.AppWin.Program.Main(String[] args)

The type initializer for  System.Windows.Documents.TextElement  threw an exception.
   at System.Windows.FrameworkElement..cctor()

The type initializer for  System.Windows.Media.FontFamily  threw an exception.
   at System.Windows.Media.FontFamily..ctor(String familyName)
   at System.Windows.SystemFonts.get_MessageFontFamily()
   at System.Windows.Documents.TextElement..cctor()

The type initializer for  MS.Internal.FontCache.Util  threw an exception.
   at MS.Internal.FontCache.Util.get_WindowsFontsUriObject()
   at System.Windows.Media.FontFamily.PreCreateDefaultFamilyCollection()
   at System.Windows.Media.FontFamily..cctor()

Invalid URI: The format of the URI could not be determined.
   at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
   at System.Uri..ctor(String uriString, UriKind uriKind)
   at MS.Internal.FontCache.Util..cctor()

如果我们通过URL(In IE)或首先通过icon在桌面上启动申请,我们就得不到预期的例外和申请发射。

重要的是,无论我们首先发射的是谁,这是否真的会发射。 因此,如果我们首先拿着遗产,它就会消失,即使我们用另外的成功的URL或icon发起,我们也不能获得运行。 为了让它发挥作用,我们必须从《URL》或“icon”上退下来,并从中开始。

如果我们首先使用URL或icon,我们就没有从这一前点的遗产应用中产生问题(直到我们离去,回到后)。

另一项信息是,我们能够以下述方式对问题进行模拟。 如果我们迅速使用“cmd.exe”进行指挥,并且执行从URL发射的声明,我们就取得了成功。 然而,如果我们迅速采用“共同点”来指挥,并且我们执行同样的声明,我们就会经历这种破碎的行为。

我们的假设是,克莱尔的遗产申请使用了相等的指挥手段。 我们曾尝试过一些 ha子,如指挥。

我们有一些工作的想法(例如,在启动时进行发射,这样我们就把成功发射的铀浓缩铀,使随后的所有发射都取得成功),但尽管我们对我们的工作站拥有大量控制权,但这些想法都是不乐观的。

为了减少与许可有关的机会,我们赋予了启动账户的行政权利(以及在有分歧的情况下的非行政权利)。

任何想法都会得到高度赞赏。 和我一样,我们有一些工作要做,但我很想避免。

感谢!

问题回答

It sounds like the Presentation Font Cache service has trouble starting when the app is launched in this way. If you have control over the client environment, you could try setting the Windows Presentation Font Cache startup to automatic instead of manual.

这是用不完整信息在黑暗中发射的子弹:

指挥.com和cmd.exe大不相同。 AFAIK,tor.com,用于遗产兼容性,因此,从中操作的应用程序将不同。 我可以试过任何事情来完成我的职位,因为我认为,指挥.com以16个轨道方式运行,而64个视窗(根据这一模式,I m的运行)则不支持这一模式,对我来说,这种方式更是没有指挥。

尽管如此,在尝试管理32项申请(包括管理申请)时,不应有任何区别。

我不知道你环境的局限性,但你可能尝试的一些事情是:

  • Rename you .bat into .cmd to make sure it starts with cmd.exe rather than command.com
  • Make your .bat start the program using the start console command
  • Have a non-WPF program to invoke your WPF one with a more sane environment

问题是,在使用<代码>command.com时,没有设定“环境变量”<代码>。

因此,就你而言,在批次档案开始之前添加“条码”栏目:Windows <>/code>,以解决这个问题(假设你在<条码>C:Windows/code>上安装了Windows 。

还有一个问题是,东道申请是以兼容方式运行<代码>command.com。 最好在运行<代码>cmd.exe后列出所有环境变量(使用<代码>>>的指令),并将之与<代码><>>>>/代码>的产出相比较。 页: 1





相关问题
WPF convert 2d mouse click into 3d space

I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25). When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)... How can I achieve ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF: writing smoke tests using ViewModels

I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签