Closed CobraCalle closed 6 years ago
That's because your assembly got linked during compilation. This means the linker considers this constructor is never called and get rid of it.
You can hint the linker like we did in the playground:
LinkerConfig.xml
like this: https://github.com/nventive/Uno.Playground/blob/master/src/Uno.Playground.WASM/LinkerConfig.xml and add relevant assemblies/namespaces/types. You can find the documentation here: https://github.com/mono/linker/tree/master/linker#syntax-of-xml-descriptor.csproj
like this: https://github.com/nventive/Uno.Playground/blob/master/src/Uno.Playground.WASM/Uno.Playground.WASM.csproj#L43Another way to do that would be to add a [Preserve]
attribute on your class. https://github.com/nventive/Uno/blob/master/src/Uno.Foundation/PreserveAttribute.cs
I have a class like this…
}
Now I what to create this type by reflection and try to get the constructor…
"operation" is here typeof(Add)
This works well… except in the WASM-version… there is constructor null
Any ideas?