XamlIslands
XamlIslands copied to clipboard
Feedback and errors
I'm trying to build a similar app to the Winforms on netcore3.0 example.
Unfortunately I can't get it to work following the steps in https://github.com/marb2000/XamlIslands/blob/master/1903_Samples/WnForms_and_WPF_Readme.md, even though this seems to be the most exhaustive explanation I can find.
Setup:
- Visual Studio 16.3 Preview 1
- .net core 3.0 preview 7
What am I trying:
- Winforms project written in .net core that sits in Systray
- UWP class library containing user controls, theme resources and assets
- user control class library references the
Microsoft.Toolkit.Uwp.UI.Animationsnuget package
- user control class library references the
What did I miss from the explanation:
- Platforms + RuntimeIdentifiers need to be set to x86/x64 (VS also gives a warning about the VCForwarders if you do not do that). VS template for Winforms on netcore3.0 does not set them by default and then VS thinks you want to use AnyCpu.
<Platforms>x64;x86</Platforms>
<RuntimeIdentifiers>win-x64;win-x86</RuntimeIdentifiers>
If I do not add this, I get a warning:
Because your app is being built as AnyCPU no Microsoft.VCRTForwarders.140 DLLs were copied to your ouput folder. Microsoft.VCRTForwarders.140 only supports x86 or x64 applications due to a C++ Runtime dependency. Please change your app project architecture to x86 or x64 in the Configuration Manager.
After adding this, the app does not start anymore on x86:
The target process exited without raising a CoreCLR started event. Ensure that the target process is configured to use .NET Core. This may be expected if the target process did not run on .NET Core.
On x64, the app raises an exception:
System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Toolkit.Uwp.UI.Animations, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null'.
Are the Microsoft.Toolkit.Uwp.UI.Animations supported in xaml islands? Should I include them in a special way?
x64:
- I reported the issue with
Microsoft.Toolkit.Uwp.UI.Animationsas https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/issues/159. It might be related to https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/issues/65. - on x64 it works if I remove the reference to
Microsoft.Toolkit.Uwp.UI.Animationsbut that breaks my animation UX
x86:
- The issue on x86 is not solved by removing
Microsoft.Toolkit.Uwp.UI.Animations