Eto: 依存関係を抽出すると、Windows以外のプラットフォームでのXAMLの読み込みが中断されました

作成日 2020年10月24日  ·  4コメント  ·  ソース: picoe/Eto

コードを何も変更せずに、最新の「ナイトリー」ビルドに更新した後、次の例外を除いて、アプリがLinuxでクラッシュします。

System.IO.FileNotFoundException: Could not load file or assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
File name: 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
  at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal(System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00013] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System/MonoCustomAttrs.cs:128 
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System/MonoCustomAttrs.cs:163 
  at System.Reflection.RuntimeAssembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System.Reflection/RuntimeAssembly.cs:520 
  at System.Attribute.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType, System.Boolean inherit) [0x0005c] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/attribute.cs:866 
  at System.Attribute.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/attribute.cs:851 
  at System.Reflection.CustomAttributeExtensions.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/reflection/CustomAttributeExtensions.cs:92 
  at Portable.Xaml.XamlSchemaContext.FillCompatibilities (System.Reflection.Assembly ass) [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlSchemaContext.TryGetCompatibleXamlNamespace (System.String xamlNamespace, System.String& compatibleNamespace) [0x00036] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.GetMapped (System.String ns) [0x00012] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.get_NamespaceURI () [0x0000c] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.ProcessStartElement () [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.Read () [0x0002f] in <16c90363778e4b50b411e4917b044d09>:0 
  at System.Xml.XmlReader.MoveToContent () [0x0003a] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs:728 
  at Portable.Xaml.XamlXmlParser+<Parse>d__13.MoveNext () [0x0002e] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlXmlReader.Read () [0x00031] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlServices.Transform (Portable.Xaml.XamlReader xamlReader, Portable.Xaml.XamlWriter xamlWriter, System.Boolean closeWriter) [0x00024] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlServices.Transform (Portable.Xaml.XamlReader xamlReader, Portable.Xaml.XamlWriter xamlWriter) [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (Portable.Xaml.XamlXmlReader reader, T instance) [0x0003c] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (System.IO.Stream stream, T instance) [0x0002e] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (T instance) [0x00029] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at FPLedit.MainForm..ctor (FPLedit.LastFileHandler lfh, FPLedit.CrashReporting.CrashReporter crashReporter, FPLedit.Bootstrapper bootstrapper) [0x00008] in fpledit-src/FPLedit/MainForm.xeto.cs:57 
  at FPLedit.Program.Main (System.String[] args) [0x0017f] in fpledit-src/FPLedit/Program.cs:76 
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
File name: 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
  at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal(System.Reflection.ICustomAttributeProvider,System.Type,bool)
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00013] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System/MonoCustomAttrs.cs:128 
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inherit) [0x00037] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System/MonoCustomAttrs.cs:163 
  at System.Reflection.RuntimeAssembly.GetCustomAttributes (System.Type attributeType, System.Boolean inherit) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/corlib/System.Reflection/RuntimeAssembly.cs:520 
  at System.Attribute.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType, System.Boolean inherit) [0x0005c] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/attribute.cs:866 
  at System.Attribute.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/attribute.cs:851 
  at System.Reflection.CustomAttributeExtensions.GetCustomAttributes (System.Reflection.Assembly element, System.Type attributeType) [0x00000] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/mscorlib/system/reflection/CustomAttributeExtensions.cs:92 
  at Portable.Xaml.XamlSchemaContext.FillCompatibilities (System.Reflection.Assembly ass) [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlSchemaContext.TryGetCompatibleXamlNamespace (System.String xamlNamespace, System.String& compatibleNamespace) [0x00036] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.GetMapped (System.String ns) [0x00012] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.get_NamespaceURI () [0x0000c] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.ProcessStartElement () [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.CompatibleXmlReader.Read () [0x0002f] in <16c90363778e4b50b411e4917b044d09>:0 
  at System.Xml.XmlReader.MoveToContent () [0x0003a] in /builddir/build/BUILD/mono-6.12.0.102/mcs/class/referencesource/System.Xml/System/Xml/Core/XmlReader.cs:728 
  at Portable.Xaml.XamlXmlParser+<Parse>d__13.MoveNext () [0x0002e] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlXmlReader.Read () [0x00031] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlServices.Transform (Portable.Xaml.XamlReader xamlReader, Portable.Xaml.XamlWriter xamlWriter, System.Boolean closeWriter) [0x00024] in <16c90363778e4b50b411e4917b044d09>:0 
  at Portable.Xaml.XamlServices.Transform (Portable.Xaml.XamlReader xamlReader, Portable.Xaml.XamlWriter xamlWriter) [0x00000] in <16c90363778e4b50b411e4917b044d09>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (Portable.Xaml.XamlXmlReader reader, T instance) [0x0003c] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (System.IO.Stream stream, T instance) [0x0002e] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at Eto.Serialization.Xaml.XamlReader.Load[T] (T instance) [0x00029] in <9017e3c4c6ad4d44933e97fb9cb6efcd>:0 
  at FPLedit.MainForm..ctor (FPLedit.LastFileHandler lfh, FPLedit.CrashReporting.CrashReporter crashReporter, FPLedit.Bootstrapper bootstrapper) [0x00008] in fpledit-src/FPLedit/MainForm.xeto.cs:57 
  at FPLedit.Program.Main (System.String[] args) [0x0017f] in fpledit-src/FPLedit/Program.cs:76 

バージョン2.5.7-ci-20201007.292499425作業
バージョン2.5.7-ci-20201021.320816878壊れています

問題を再現する手順

私のプロジェクト(.NET Framework)は、すべてのプラットフォームに対して1つの実行可能ファイルのみを作成し、 Eto.Wpf.dllEto.Gtk.dll両方を参照します。 カスタムプラットフォーム検出コードは使用されません。 フォームはXAMLリーダーを使用して作成されます。

考え

コミットhttps://github.com/picoe/Eto/commit/2231f4c2a49066a8381a46c6eb64a31d1e32e784がこの問題を引き起こしたと思いPortable.Xamlがアプリケーションフォルダー(?)にあるいくつかのアセンブリを読み込もうとしているようです。 https://github.com/picoe/Eto/commit/2231f4c2a49066a8381a46c6eb64a31d1e32e784の時点で、Wpfに明示的に依存しているファイルがさらに存在します(これは明らかにLinuxでは利用できず、必要ありません)。

ビルドディレクトリからすべてのファイルXceed.*.dllを削除すると、クラッシュが削除されますが、これらの依存関係はWindowsで必要になるため、これは明らかに解決策ではありません...

仕様

  • バージョン:現在のmygetバージョン2.5.7-ci-20201021.320816878
  • プラットフォーム:Gtk(Wpf依存関係が存在する場合のみ)
  • オペレーティングシステム:Fedora 32
bug

最も参考になるコメント

それは確かに問題を修正しました:-)それはモノラル警告( Can't find custom attr constructor image: ... )を吐き出すだけですが、それらはユーザーコードによって無効にすることはできません(私が知る限り)。

ありがとう!

全てのコメント4件

ねえ@ManuelHu

問題を報告していただきありがとうございます。 アセンブリで属性をスキャンするときにtry / catch inを入力して、Portable.Xaml側でこれを修正する必要がある場合があります。

はい、それはそれを防ぐはずです...:+ 1:

Portable.Xaml0.26.0はこの問題を修正する必要があります。 ぜひお試しください!

それは確かに問題を修正しました:-)それはモノラル警告( Can't find custom attr constructor image: ... )を吐き出すだけですが、それらはユーザーコードによって無効にすることはできません(私が知る限り)。

ありがとう!

このページは役に立ちましたか?
0 / 5 - 0 評価