Eto: أدى استخراج التبعيات إلى كسر تحميل XAML على الأنظمة الأساسية التي لا تعمل بنظام Windows

تم إنشاؤها على ٢٤ أكتوبر ٢٠٢٠  ·  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) بإنشاء ملف تنفيذي واحد فقط لجميع الأنظمة الأساسية والمراجع Eto.Wpf.dll بالإضافة إلى Eto.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 ،

شكرا للإبلاغ عن هذه المسألة! قد نضطر إلى إصلاح هذا على جانب Portable.Xaml عن طريق وضع المحاولة / الالتقاط عند فحص التجميعات بحثًا عن السمات.

نعم ، يجب أن يمنع ذلك ...: +1:

Portable.Xaml 0.26.0 _should_ إصلاح هذه المشكلة. يرجى محاولة إعطائها!

لقد نجح بالفعل في إصلاح المشكلة :-) إنه يبث فقط تحذيرات أحادية ( Can't find custom attr constructor image: ... ) ، لكن لا يمكن تعطيلها بواسطة رمز المستخدم (على حد علمي)

شكرا!

هل كانت هذه الصفحة مفيدة؟
0 / 5 - 0 التقييمات

القضايا ذات الصلة

rothomp3 picture rothomp3  ·  15تعليقات

voronoipotato picture voronoipotato  ·  16تعليقات

LaraSQP picture LaraSQP  ·  7تعليقات

canton7 picture canton7  ·  22تعليقات

azunyuuuuuuu picture azunyuuuuuuu  ·  23تعليقات