These are chat archives for AvaloniaUI/Avalonia

6th
Apr 2018
Jumar Macato
@jmacato
Apr 06 2018 04:55
do we have any way to render a visual to bitmap with custom DPI?
William Humphreys
@WHumphreys
Apr 06 2018 13:06
Looks like microsoft are trying to implement some sort of Webassembly type thing. I havnt rerally read it properly but probably worth a look. https://blogs.msdn.microsoft.com/webdev/2018/03/22/get-started-building-net-web-apps-in-the-browser-with-blazor/
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 13:16
@jmacato Seems like corert compiler has pretty useful exception info during build :smile:

Error loading xaml at resm:Avalonia.Themes.Default.CheckBox.xaml?assembly=Avalonia.Themes.Default
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Uri, Uri, Object) + 0x143
   at Avalonia.Markup.Xaml.Styling.StyleInclude.get_Loaded() + 0x3b
   at Avalonia.Markup.Xaml.Styling.StyleInclude.Avalonia.Styling.ISetStyleParent.NotifyResourcesChanged(ResourcesChangedEventArgs) + 0xc
   at Avalonia.Styling.Styles.<.ctor>b__2_0(IStyle) + 0x62
   at Avalonia.Collections.AvaloniaListExtensions.<>c__DisplayClass1_0`1.<ForEachItem>g__Add|0(Int32, IList) + 0x92
   at Avalonia.Collections.AvaloniaList`1.NotifyAdd(IList, Int32) + 0x51
   at Core2D.Avalonia!<BaseAddress>+0x8a3584
   at Core2D.Avalonia!<BaseAddress>+0x1c68d0

Set value of member '{clr-namespace:Avalonia.Styling;assembly=Avalonia.Styling}Setter.Value' threw an exception
   at Portable.Xaml.XamlObjectWriterInternal.SetValue(XamlMember, Object, Object) + 0x8b
   at Portable.Xaml.XamlWriterInternalBase.WriteEndMember() + 0x1e
   at Portable.Xaml.XamlServices.Transform(XamlReader, XamlWriter, Boolean) + 0x4e
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.LoadFromReader(XamlReader, AvaloniaXamlContext) + 0x33
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Stream, Object, Uri) + 0xb7
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Uri, Uri, Object) + 0x84

False is not a valid value for Boolean.
   at System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0xcc
   at Avalonia.Markup.Xaml.Converters.SetterValueTypeConverter.ConvertSetterValue(ITypeDescriptorContext, XamlSchemaContext, CultureInfo, Setter, Object) + 0x98
   at Avalonia.Markup.Xaml.PortableXaml.PropertyXamlMember.PropertyInvoker.SetValue(Object, Object) + 0x77
   at Portable.Xaml.XamlObjectWriterInternal.SetValue(XamlMember, Object, Object) + 0x4a

String was not recognized as a valid Boolean.
   at System.Boolean.Parse(ReadOnlySpan`1) + 0x4f
   at System.Boolean.Parse(String) + 0x2c
   at System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0x4c
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 13:26
False is not a valid value for Boolean. :worried:
Matthijs ter Woord
@mterwoord
Apr 06 2018 13:32
missing typeconverters?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 13:33
This is exception from type converter
Maybe I am missing some
type
I have checked corefx source code
But can not find anything missing
Jumar Macato
@jmacato
Apr 06 2018 15:21
@wieslawsoltes it should've worked with the included typeconverters and i'm really really puzzled why avalonia cant detect them :(
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:21
Probably bug in corert
The BooleanConverter does not seems to use any reflection
Maybe some culture info issue
When using compiled version
No idea
I want to try to compile the avalonia control catalog
Jumar Macato
@jmacato
Apr 06 2018 15:24
alright, perhaps it can give us more info
i might try compiling avalonia source itself, but i'm away from my desktop right now
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:25
Not sure how to debug release version
Jumar Macato
@jmacato
Apr 06 2018 15:26
also, try setting the dotnet publish command to its maximum verbosity "-v diag"
it could give us some clues
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:26
good idea
First I need reainstall VS2017
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:31
The corert does not like my user name with special chars :fire:
Changing user name and profile folder on windows breaks .NET Core badly
@jmacato -v diag was not good, to much info
need to use d
Jumar Macato
@jmacato
Apr 06 2018 15:34
i see, hmm
i can't build until later unfortunately :(
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:36
I have asked question on corert gitter about exception, maybe we will get some help :smile:
Jumar Macato
@jmacato
Apr 06 2018 15:36
thank you! i hope they'll respond asap
can you link the issue you filed to them?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:37
I just posted message in gitter
Jumar Macato
@jmacato
Apr 06 2018 15:37
oh alright
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:37
danwalmsley
@danwalmsley
Apr 06 2018 15:41
@wieslawsoltes @jmacato are trying to use corert to get native executables?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:42
yes
It compiles
But throws exception when I try to run it
Not much to see in detailed log
Jumar Macato
@jmacato
Apr 06 2018 15:45
let me check
You need to download log
Jumar Macato
@jmacato
Apr 06 2018 15:45
@danwalmsley yes, we're attempting to compile avalonia to native code
@wieslawsoltes wow, definitely more verbose..
danwalmsley
@danwalmsley
Apr 06 2018 15:48
@wieslawsoltes Il see if I can help when I get to my pc, do you have steps needed to reproduce?
clone and run publish script
then run from console src/Core2D.Avalonia/bin/win-x64/Core2D.Avalonia.exe
to see stack trace if it fails
Jumar Macato
@jmacato
Apr 06 2018 15:53
there doesnt seem to be anything unusual in the build log
danwalmsley
@danwalmsley
Apr 06 2018 15:54
Which part tells it to use corert?
Jumar Macato
@jmacato
Apr 06 2018 15:54
@danwalmsley just run > dotnet publish -r win-x64
Jumar Macato
@jmacato
Apr 06 2018 15:55
@wieslawsoltes have you seen the monogame example yet?
they have this rd.xml that is different than that example
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 15:56
Yeah
Just Xna stuff
I have included mscorlib
Jumar Macato
@jmacato
Apr 06 2018 16:12
sorry late reply, i think we should open an issue regarding corert in our github
so that we can track it
i made it now #1476
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:26
@jmacato Added some comments
Jumar Macato
@jmacato
Apr 06 2018 16:27
alright,
i've seen the logs, and i really can't find anything unusual on it. i wish the runtime directives docs on corert is a bit more detailed...
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:36
I will try hello world sample and try to use bool converter :fire:
Jumar Macato
@jmacato
Apr 06 2018 16:41

can you also try the ff. for rd.xml

        <Assembly Name="System.ComponentModel.TypeConverter">
            <Type Name="System.ComponentModel.TypeConverter.BooleanConverter" Dynamic="Required All" />
       </Assembly>

might not work but idk

Matthijs ter Woord
@mterwoord
Apr 06 2018 16:41
just for fun, can't you try to "include everything"?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:41
I have <Assembly Name="System.ComponentModel.TypeConverter" Dynamic="Required All" />
this should include evrything?
Jumar Macato
@jmacato
Apr 06 2018 16:42
it might be skipping some classes?
let me check in referencesource
yup, it's System.ComponentModel.BooleanConverter
jp2masa
@jp2masa
Apr 06 2018 16:44
what's the target framework? netcoreapp2.0?
Jumar Macato
@jmacato
Apr 06 2018 16:44
 <Assembly Name="System.ComponentModel.TypeConverter">
            <Type Name="System.ComponentModel.BooleanConverter" Dynamic="Required All" />
       </Assembly>
@jp2masa yes
it's just a guess but i think they might not be including classes with different namespace than the assembly
although that could be wrong though...
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:46
Code_2018-04-06_18-46-36.png
Did a quick test
using System;
using System.ComponentModel;

namespace HelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            bool bVal=true;
            string strA="False";
            var typeConverter1 = TypeDescriptor.GetConverter(bVal);
            Console.WriteLine(typeConverter1.ConvertTo(bVal, typeof(string)));
            var typeConverter2 = TypeDescriptor.GetConverter(bVal);
            Console.WriteLine(typeConverter2.ConvertFrom(strA));
        }
    }
}
Output
True
False
@jmacato
EXEC : error : [TEMPORARY EXCEPTION MESSAGE] ClassLoadGeneral: System.ComponentModel.TypeConverter.BooleanConverter, System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core2D.Avalonia.csproj]
  Internal.TypeSystem.TypeSystemException+TypeLoadException: [TEMPORARY EXCEPTION MESSAGE] ClassLoadGeneral: System.ComponentModel.TypeConverter.BooleanConverter, System.ComponentModel.TypeConverter, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
     at Internal.TypeSystem.ThrowHelper.ThrowTypeLoadException(ExceptionStringID id, String typeName, String assemblyName)
     at Internal.TypeSystem.Ecma.EcmaModule.GetType(String nameSpace, String name, Boolean throwIfNotFound)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.ResolveCustomAttributeTypeDefinitionName(String name, ModuleDesc module, Boolean throwIfNotFound)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeName(ModuleDesc module, String name, Boolean throwIfNotFound, Func`4 resolver)
     at ILCompiler.RdXmlRootProvider.ProcessTypeDirective(IRootingServiceProvider rootProvider, ModuleDesc containingModule, XElement typeElement)
     at ILCompiler.RdXmlRootProvider.ProcessAssemblyDirective(IRootingServiceProvider rootProvider, XElement assemblyElement)
     at ILCompiler.RdXmlRootProvider.AddCompilationRoots(IRootingServiceProvider rootProvider)
     at ILCompiler.Compilation..ctor(DependencyAnalyzerBase`1 dependencyGraph, NodeFactory nodeFactory, IEnumerable`1 compilationRoots, DebugInformationProvider debugInformationProvider, DevirtualizationManager devirtualizationManager, Logger logger)
     at ILCompiler.ILScannerBuilder.ToILScanner()
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)
C:\Users\Wieslaw\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: Polecenie „"C:\Users\Wieslaw\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\tools\ilc" @"obj\Release\netcoreapp2.0\win-x64\native\Core2D.Avalonia.ilc.rsp"” zostało zakończone przez kod 1. [C:\DOWNLOADS\GitHub\Draw2D\src\Core2D.Avalonia\Core2D.Avalonia.csproj]
With <Type Name="System.ComponentModel.BooleanConverter" Dynamic="Required All" /> I get exception.
Jumar Macato
@jmacato
Apr 06 2018 16:50
i see, my hunch was wrong :/
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:50
Oh.. :worried:
My fault
Jumar Macato
@jmacato
Apr 06 2018 16:50
yes?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:51
I copied your first code
not second
Jumar Macato
@jmacato
Apr 06 2018 16:51
alright
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 16:52
same error :worried:
Seems like Avalonia related issue
Jumar Macato
@jmacato
Apr 06 2018 16:53
we might have some assembly conflict like what happened with System.Drawing
CoreRT's build logs are frankly lacking in relevant detail..
i'll try to investigate more when i get back tomorrow (it's midnight here now)
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 17:09
yeah
last attempt today
trying to run control catalog sample
ach
same issue with ControlCatalog.NetCore :worried:
wieslawsoltes/Avalonia@ad48d79
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 17:18
@wieslawsoltes Try adding an rd.xml rule for System.Private.CoreLib.
That might make it work.
danwalmsley
@danwalmsley
Apr 06 2018 17:31
@jkoritzinsky what do the rd.xml rules do I'm just trying this now
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 17:32
They tell ILC to keep the code or Metadata in the final executable even if it isn't being directly used (ie used only via reflection)
danwalmsley
@danwalmsley
Apr 06 2018 17:33
ok :)
thanks
this is pretty exciting, potentially will run very fast after this
so with corert there is no runtime?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 17:42
@jkoritzinsky Will try later. Thanks.
danwalmsley
@danwalmsley
Apr 06 2018 17:51
@wieslawsoltes @jkoritzinsky I added that to rd.xml with no luck
@wieslawsoltes with the test you did, showing the typeconverter working
perhaps its something to do with the code running on an embedded resource?
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 18:00
@danwalmsley There's still a runtime under corert. The main differences are that the runtime is a little slimmer, more is written in C# instead of C++, and the JIT compiler is run during compilation instead of at runtime.
danwalmsley
@danwalmsley
Apr 06 2018 18:01
I tried to run and compile the example that @wieslawsoltes tried like this:
bool bVal=true;
                string strA="False";
                var typeConverter1 = TypeDescriptor.GetConverter(bVal);
                Console.WriteLine(typeConverter1.ConvertTo(bVal, typeof(string)));
                var typeConverter2 = TypeDescriptor.GetConverter(bVal);
                Console.WriteLine(typeConverter2.ConvertFrom(strA));
when I do it I get
True
False is not a valid value for Boolean.
   at System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0xcc
   at AvalonStudio.App.Main(String[]) + 0xd2

String was not recognized as a valid Boolean.
   at System.Boolean.Parse(ReadOnlySpan`1) + 0x4f
   at System.Boolean.Parse(String) + 0x2c
   at System.ComponentModel.BooleanConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0x4c
danwalmsley
@danwalmsley
Apr 06 2018 18:08
but not with minimal repro
only with avalonia project I get that
wierd
danwalmsley
@danwalmsley
Apr 06 2018 18:14
@wieslawsoltes if I publish without release mode I get past that error
it complains about libskia now
manually copied libskiasharp and it gets passed that
just complaining about borderthickness
need to check I have a valid avalonia there
danwalmsley
@danwalmsley
Apr 06 2018 18:23
@wieslawsoltes
Could not convert object 'BorderThickness' (of type System.String) to {clr-namespace:Avalonia;assembly=Avalonia.Base}AvaloniaProperty: Could not determine the target type. Please fully qualify the property name.
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember, XamlType, Object) + 0x7da
   at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(XamlWriterInternalBase.ObjectState, XamlWriterInternalBase.MemberAndValue, Object, Object) + 0x480
   at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(Object, Object) + 0x7f
   at Portable.Xaml.XamlObjectWriterInternal.OnWriteValue(Object) + 0xb1
   at Portable.Xaml.XamlWriterInternalBase.WriteValue(Object) + 0x3b
   at Portable.Xaml.XamlObjectWriter.WriteValue(Object) + 0x6a
   at Portable.Xaml.XamlWriter.WriteNode(XamlReader) + 0xf7
   at Portable.Xaml.XamlServices.Transform(XamlReader, XamlWriter, Boolean) + 0xcf
   at Portable.Xaml.XamlServices.Transform(XamlReader, XamlWriter) + 0x24
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.LoadFromReader(XamlReader, AvaloniaXamlContext) + 0x67
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Stream, Object, Uri) + 0x123
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Uri, Uri, Object) + 0xea

Could not determine the target type. Please fully qualify the property name.
   at Avalonia.Markup.Xaml.Converters.AvaloniaPropertyTypeConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0x17e
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember, XamlType, Object) + 0x4e8
did you have this problem already?
danwalmsley
@danwalmsley
Apr 06 2018 18:37
icon property causes this...
System.String) to {clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls}WindowIcon: Method '[Avalonia.Win32]Avalonia.Win32.Gdip.GdipLoadImageFromStream(IStream,native int&)' requires non-trivial marshalling that is not yet supported by this compiler. ---> System.Exception: Method '[Avalonia.Win32]Avalonia.Win32.Gdip.GdipLoadImageFromStream(IStream,native int&)' requires non-trivial marshalling that is not yet supported by this compiler.
   at Avalonia.Win32.Gdip.GdipLoadImageFromStream(IStream, IntPtr&) + 0x3e
   at Avalonia.Win32.IconImpl..ctor(Stream) + 0xba
   at Avalonia.Win32.Win32Platform.LoadIcon(Stream) + 0x2d
ok getting closer...
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Portable.Xaml.XamlObjectWriterException: Set value of member '{clr-namespace:Avalonia.Controls;assembly=Avalonia.Controls}LayoutTransformControl.LayoutTransform' threw an exception ---> EETypeRva:0x01645310: This object cannot be invoked because it was metadata-enabled for browsing only: 'System.Action<System.Object,System.EventArgs>.Invoke(System.Object,System.EventArgs)' For more information, please visit  http://go.microsoft.com/fwlink/?LinkID=616867
   at ControlCatalog!<BaseAddress>+0xc8526
   at ControlCatalog!<BaseAddress>+0x430131
   at ControlCatalog!<BaseAddress>+0x901d02
   at ControlCatalog!<BaseAddress>+0x901d95
   at ControlCatalog!<BaseAddress>+0x40b2d1
   at ControlCatalog!<BaseAddress>+0x40c348
   at ControlCatalog!<BaseAddress>+0x40bf42
   at ControlCatalog!<BaseAddress>+0x3fdfae
   at ControlCatalog!<BaseAddress>+0x3fd03a
   at ControlCatalog!<BaseAddress>+0xbc997f
   at System.Reactive.Linq.ObservableImpl.FromEventPattern.Impl`2.GetHandler(Action`1) + 0xfa
   at System.Reactive.Linq.ObservableImpl.EventProducer`2.Session.Initialize() + 0x
so close to running now I'm sure
danwalmsley
@danwalmsley
Apr 06 2018 18:54
@jkoritzinsky looks like that last one needs something in RD.xml, any ideas System.Action<EventArgs>.Invoke or something
I added netstandard and system
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:01
Try rooting the type System.Action`1[The event args type]
danwalmsley
@danwalmsley
Apr 06 2018 19:02
what does that mean? sorry
add to RD.xml for type only?
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:02
Actually, in this case, root System.Action`2[System.Object,System.EventArgs]
Yeah, add it to the rd.xml under the assembly element.
danwalmsley
@danwalmsley
Apr 06 2018 19:03
like this?
    <Type Name="System.Action`2[System.Object,System.EventArgs]" Activate="Required All" />
    </Application>
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:04
Or you could just add the method, so you'd want to add the following elements:
<Assembly Name="System.Private.CoreLib">
    <Type Name="System.Action`2[System.Object,System.EventArgs]"> 
       <Method Name="Invoke" Dynamic="Required All" />
    </Type>
</Assembly>
The snippet above should work if I got the syntax right.
danwalmsley
@danwalmsley
Apr 06 2018 19:06
just trying now
image.png
ControlCatalog running natively!!!
loads instantly
but wont work for release mode
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:09
What's the crash in release mode?
danwalmsley
@danwalmsley
Apr 06 2018 19:12
its the typeconverter thing that @wieslawsoltes was having trouble with
I cant get avalonstudio to run because of some problem converting BorderThickness
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:14
Out of curiosity, what size is the final binary in debug mode?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 19:23
@danwalmsley Nice!
danwalmsley
@danwalmsley
Apr 06 2018 19:30
34mb
@wieslawsoltes any idea what this might be?
Could not convert object 'BorderThickness' (of type System.String) to {clr-namespace:Avalonia;assembly=Avalonia.Base}AvaloniaProperty: Could not determine the target type. Please fully qualify the property name.
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember, XamlType, Object) + 0x7da
   at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(XamlWriterInternalBase.ObjectState, XamlWriterInternalBase.MemberAndValue, Object, Object) + 0x480
   at Portable.Xaml.XamlObjectWriterInternal.StoreAppropriatelyTypedValue(Object, Object) + 0x7f
   at Portable.Xaml.XamlObjectWriterInternal.OnWriteValue(Object) + 0xb1
   at Portable.Xaml.XamlWriterInternalBase.WriteValue(Object) + 0x3b
   at Portable.Xaml.XamlObjectWriter.WriteValue(Object) + 0x6a
   at Portable.Xaml.XamlWriter.WriteNode(XamlReader) + 0xf7
   at Portable.Xaml.XamlServices.Transform(XamlReader, XamlWriter, Boolean) + 0xcf
   at Portable.Xaml.XamlServices.Transform(XamlReader, XamlWriter) + 0x24
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.LoadFromReader(XamlReader, AvaloniaXamlContext) + 0x67
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Stream, Object, Uri) + 0x123
   at Avalonia.Markup.Xaml.AvaloniaXamlLoaderPortableXaml.Load(Uri, Uri, Object) + 0xea

Could not determine the target type. Please fully qualify the property name.
   at Avalonia.Markup.Xaml.Converters.AvaloniaPropertyTypeConverter.ConvertFrom(ITypeDescriptorContext, CultureInfo, Object) + 0x17e
   at Portable.Xaml.XamlObjectWriterInternal.GetCorrectlyTypedValue(XamlMember, XamlType, Object) + 0x4e8
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 19:34
No
danwalmsley
@danwalmsley
Apr 06 2018 19:37
I wonder if core2d will run now
only changes necessary seem to be to publish -c Debug
and
<Assembly Name="System.Private.CoreLib">
            <Type Name="System.Action`2[System.Object,System.EventArgs]`"> 
            <Method Name="Invoke" Dynamic="Required All" />
            </Type>
        </Assembly>
in rd.xml
danwalmsley
@danwalmsley
Apr 06 2018 19:46
here is a working control catalog for win-x64
is there anyway to get it to keep metadata for all references @jkoritzinsky ?
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 19:50
I don't believe so. I think you have to specify them in the Rd.xml files.
danwalmsley
@danwalmsley
Apr 06 2018 19:51
will this stop MEF composition working, or will it still be able to use .net assemblies that havnt been natively compiled?
from the corert compiled part?
danwalmsley
@danwalmsley
Apr 06 2018 19:59
AvalonStudio is almost running!
Window Icons don't work "requires non-trivial marshalling"
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 20:00
This will break MEF Composition. Corert cannot dynamically load assemblies.
danwalmsley
@danwalmsley
Apr 06 2018 20:01
is that something likely to be fixed in future?
Jeremy Koritzinsky
@jkoritzinsky
Apr 06 2018 20:01
Future: possibly. Near future : no
Window icons on win32 probably fail because the code uses SafeHandle marshaling, which isn't implemented in corert.
danwalmsley
@danwalmsley
Apr 06 2018 20:10
Exception has been thrown by the target of an invocation.
   at AvalonStudio!<BaseAddress>+0x129f54a
   at AvalonStudio!<BaseAddress>+0x1331123
   at AvalonStudio.App.Main(String[]) + 0x22f

Object reference not set to an instance of an object.
   at AvalonStudio.MainWindow..ctor() + 0x74
   at AvalonStudio!<BaseAddress>+0xbb3346
   at AvalonStudio!<BaseAddress>+0x129f474
@jkoritzinsky what happens when you don't get any decent error message
danwalmsley
@danwalmsley
Apr 06 2018 20:29
@jkoritzinsky what would the rd.xml entry for this be?
'System.Linq.Expressions.ExpressionCreator<System.Func<System.Object,System.Object>>' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:29
EXEC : error : Code generation failed [C:\projects\draw2d\src\Core2D.Avalonia\Core2D.Avalonia.csproj]
  ILCompiler.CodeGenerationFailedException: Code generation failed ---> System.NotImplementedException: canGetCookieForPInvokeCalliSig
     at Internal.JitInterface.CorInfoImpl.canGetCookieForPInvokeCalliSig(CORINFO_SIG_INFO* szMetaSig)
     at Internal.JitInterface.CorInfoImpl._canGetCookieForPInvokeCalliSig(IntPtr thisHandle, IntPtr* ppException, CORINFO_SIG_INFO* szMetaSig)
     --- End of inner exception stack trace ---
     at Internal.JitInterface.CorInfoImpl.CompileMethod(IMethodCodeNode methodCodeNodeNeedingCode, MethodIL methodIL)
     at ILCompiler.RyuJitCompilation.ComputeDependencyNodeDependencies(List`1 obj)
     at ILCompiler.DependencyAnalysisFramework.DependencyAnalyzer`2.ComputeMarkedNodes()
     at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile, ObjectDumper dumper)
     at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile, ObjectDumper dumper)
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)
C:\Users\appveyor\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: The command ""C:\Users\appveyor\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\tools\ilc" @"obj\Debug\netcoreapp2.0\win-x64\native\Core2D.Avalonia.ilc.rsp"" exited with code 1. [C:\projects\draw2d\src\Core2D.Avalonia\Core2D.Avalonia.csproj]
@danwalmsley Did get this error?
danwalmsley
@danwalmsley
Apr 06 2018 20:30
no, not seen that one
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:31
Only during Debug publish
jp2masa
@jp2masa
Apr 06 2018 20:31
maybe this?
System.Linq.Expressions.ExpressionCreator`1[System.Func`2[System.Object,System.Object]]
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:31
The Release publish works
danwalmsley
@danwalmsley
Apr 06 2018 20:35
@wieslawsoltes do you have some pinvoke stuff in Core2d?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:35
No
danwalmsley
@danwalmsley
Apr 06 2018 20:40
@jp2masa
        <Assembly Name="System.Linq.Expressions">
            <Type Name="System.Linq.Expressions.ExpressionCreator`1[System.Func`2[System.Object,System.Object]`]`" Dynamic="Required All" />
        </Assembly>
does that look right?
jp2masa
@jp2masa
Apr 06 2018 20:41
the last 2 backticks shouldn't be there
danwalmsley
@danwalmsley
Apr 06 2018 20:41
it doesn't work with or without them
ClassLoadGeneral: System.Func`2, System.Linq.Expressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a [C:\Users\dan\dev\repos\AvalonStudio\AvalonStudio\AvalonStudio\AvalonStudio.csproj]
  Internal.TypeSystem.TypeSystemException+TypeLoadException: [TEMPORARY EXCEPTION MESSAGE] ClassLoadGeneral: System.Func`2, System.Linq.Expressions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
     at Internal.TypeSystem.ThrowHelper.ThrowTypeLoadException(ExceptionStringID id, String typeName, String assemblyName)
     at Internal.TypeSystem.Ecma.EcmaModule.GetType(String nameSpace, String name, Boolean throwIfNotFound)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.ResolveCustomAttributeTypeDefinitionName(String name, ModuleDesc module, Boolean throwIfNotFound)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeName(ModuleDesc module, String name, Boolean throwIfNotFound, Func`4 resolver)
     at Internal.TypeSystem.CustomAttributeTypeNameParser.GetTypeByCustomAttributeTypeName(ModuleDesc module, String name, Boolean throwIfNotFound, Func`4 resolver)
     at ILCompiler.RdXmlRootProvider.ProcessTypeDirective(IRootingServiceProvider rootProvider, ModuleDesc containingModule, XElement typeElement)
     at ILCompiler.RdXmlRootProvider.ProcessAssemblyDirective(IRootingServiceProvider rootProvider, XElement assemblyElement)
     at ILCompiler.RdXmlRootProvider.AddCompilationRoots(IRootingServiceProvider rootProvider)
     at ILCompiler.Compilation..ctor(DependencyAnalyzerBase`1 dependencyGraph, NodeFactory nodeFactory, IEnumerable`1 compilationRoots, DebugInformationProvider debugInformationProvider, DevirtualizationManager devirtualizationManager, Logger logger)
     at ILCompiler.RyuJitCompilationBuilder.ToCompilation()
     at ILCompiler.Program.Run(String[] args)
     at ILCompiler.Program.Main(String[] args)
C:\Users\dan\.nuget\packages\microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\build\Microsoft.NETCore.Native.targets(171,5): error MSB3073: The command ""C:\Users\dan\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\1.0.0-alpha-26406-02\tools\ilc" @"obj\Debug\netcoreapp2.0\win-x64\native\AvalonStudio.ilc.rsp"" exited with code 1. [C:\Users\dan\dev\repos\AvalonStudio\AvalonStudio\AvalonStudio\AvalonStudio.csproj]
I'm not sure if I have the correct assembly
System.Linq.Expressions
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:52
@danwalmsley Its probably some pinvoke stuff from Avalonia
or json serializer
System.Action<System.Double,System.Double,System.Double,System.Double>' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859
Will try with this:
<Assembly Name="System.Private.CoreLib" Dynamic="Required All" />
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 20:58
Ok this was some other dependency missing from rd.xml
danwalmsley
@danwalmsley
Apr 06 2018 21:10
which one?
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 21:10
My own pan and zoom control for avalonia
danwalmsley
@danwalmsley
Apr 06 2018 21:10
ah
no idea how to solve this one
'System.Linq.Expressions.ExpressionCreator<System.Func<System.Object,System.Object>>' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 21:10
'PanAndZoom.StretchMode[]' is missing metadata. For more information, please visit http://go.microsoft.com/fwlink/?LinkID=392859
danwalmsley
@danwalmsley
Apr 06 2018 21:14
thanks
just trying now
danwalmsley
@danwalmsley
Apr 06 2018 21:27
it got me further
but still having issues wth json
Error getting value from 'Root' on 'AvalonStudio.GlobalSettings.Settings'.
   at Newtonsoft.Json.Serialization.ExpressionValueProvider.GetValue(Object) + 0x151
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CalculatePropertyDetails(JsonProperty, JsonConverter&, JsonContainerContract, JsonProperty, JsonReader, Object, Boolean&, Object&, JsonContract&, Boolean&) + 0x1a8
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty, JsonConverter, JsonContainerContract, JsonProperty, JsonReader, Object) + 0x8b
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object, JsonReader, JsonObjectContract, JsonProperty, String) + 0xbbf
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x4a5
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader, Type, JsonContract, JsonProperty, JsonContainerContract, JsonProperty, Object) + 0x104
   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader, Type, Boolean) + 0x3cb
   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader, Type) + 0x1a9
   at Newtonsoft.Json.JsonSerializer.Deserialize(JsonReader, Type) + 0x3a
   at Newtonsoft.Json.JsonConvert.DeserializeObject(String, Type, JsonSerializerSettings) + 0xcc
   at AvalonStudio!<BaseAddress>+0x13448f1
   at AvalonStudio!<BaseAddress>+0x1344408
   at AvalonStudio!<BaseAddress>+0x134a09e
   at AvalonStudio.GlobalSettings.Settings.Load() + 0x61
   at AvalonStudio!<BaseAddress>+0x6ab8d9
   at AvalonStudio!<BaseAddress>+0x13de92f
   at AvalonStudio!<BaseAddress>+0xc55245

Value cannot be null.
Parameter name: method
   at AvalonStudio!<BaseAddress>+0xa11305
   at System.Linq.Expressions.Expression.Call(MethodInfo, Expression) + 0x36
Wiesław Šoltés
@wieslawsoltes
Apr 06 2018 21:37
Core2D.Avalonia_2018-04-06_23-37-11.png
Finally managed to get corert working, using debug publish
:fire: