0

アプリケーションが実行されてWindows Embedded Standard 7おり、OS の起動時に起動します。

初回ロード時に が表示されることがありますUnknown Hard Error。イベント ビューアを確認すると、次のメッセージが表示されます。

The application requested process termination through System.Environment.FailFast(string message).
Message: Unrecoverable system error.

言うまでもなく、私はもちろんこの関数を呼び出していません。これは Windows Embedded でのみ発生するようで、Windows の標準インストールで再現されるのは見たことがありません。

なぜそれが起こるのか本当にわからないので、これを診断する方法や、どの「修正」が適切かはわかりません。

編集:

イベント ビューアーのログ全体:

    Application: WinForm.exe
    Framework Version: v4.0.30319
    Description: The application requested process termination through System.Environment.FailFast(string message).
    Message: Unrecoverable system error.
    Stack:
       at System.Environment.FailFast(System.String)
       at MS.Internal.Invariant.FailFast(System.String, System.String)
       at System.IO.Packaging.Package.AddIfNoPrefixCollisionDetected(ValidatedPartUri,     
System.IO.Packaging.PackagePart) at System.IO.Packaging.Package.GetPartHelper(System.Uri)
   at System.IO.Packaging.Package.GetPart(System.Uri)
   at System.Windows.Application.GetResourceOrContentPart(System.Uri)
   at System.Windows.Application.LoadComponent(System.Object, System.Uri)
   at Pms.PmControl.InitializeComponent()
   at Pms.PmControl..ctor(Boolean)
   at Pms.PmAppControl.StartWpfThread()
   at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()
4

1 に答える 1

1

逆コンパイラでコードを見ると、

    // System.IO.Packaging.Package
private void AddIfNoPrefixCollisionDetected(PackUriHelper.ValidatedPartUri partUri, PackagePart part)
{
    this._partList.Add(partUri, part);
    int num = this._partList.IndexOfKey(partUri);
    Invariant.Assert(num >= 0, "Given uri must be present in the dictionary");**
    string normalizedPartUriString = partUri.NormalizedPartUriString;
    string text = null;
    string text2 = null;
    if (num > 0)
    {
        text = this._partList.Keys[num - 1].NormalizedPartUriString;
    }
    if (num < this._partList.Count - 1)
    {
        text2 = this._partList.Keys[num + 1].NormalizedPartUriString;
    }
    if ((text != null && normalizedPartUriString.StartsWith(text, StringComparison.Ordinal) && normalizedPartUriString.Length > text.Length && normalizedPartUriString[text.Length] == PackUriHelper.ForwardSlashChar) || (text2 != null && text2.StartsWith(normalizedPartUriString, StringComparison.Ordinal) && text2.Length > normalizedPartUriString.Length && text2[normalizedPartUriString.Length] == PackUriHelper.ForwardSlashChar))
    {
        this._partList.Remove(partUri);
        throw new InvalidOperationException(SR.Get("PartNamePrefixExists"));
    }
}

それが FailFast を呼び出す唯一のメソッドであるため、コードはアサートで失敗します

internal static void Assert(bool condition, string invariantMessage)
{
    if (!condition)
    {
        Invariant.FailFast(invariantMessage, null);
    }
}

なぜあなたのパッケージが PartList 配列で見つからなかったのかという疑問が残ります。WPF がいくつかの情報を入力します。Windows 組み込みのネットワーク サブシステムがまだ準備できていない場合、インターネット アドレスまたはネットワーク共有を介して XAML からリソースを参照している可能性がありますか?

于 2016-04-15T18:19:04.353 に答える