Closed sbanni closed 4 years ago
Hello sbanni, thank you for opening an issue with us!
I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌
@marb2000 @ocalvo thoughts?
This still appears to be an issue using the latest version (6.0.1) of the Microsoft.Toolkit.Wpf.UI.XamlHost
package. This can be reproduced by upgrading the Microsoft.Toolkit.Wpf.UI.XamlHost
package in the sample repository above.
We see exactly the same problem in our own XAML islands application, and have also reproduced it in a minimal XAML islands to which we added a use of Microsoft.Extensions.Hosting
.
Sample Project
The issue is that 'CreateWinRTRegistration' gets run when the packaging project is collecting all the required files from the WpfCoreApplication; 'CreateWinRTRegistration' builds the UWP project and collects all the packaging outputs and puts them into Content items. These then get copied to the output directory overwriting the WpfCoreApplication dependency files.
When the sample project runs successfully it should just display a blank window, instead it is crashing with these following errors: 1.) Could not load file or assembly 'System.Runtime, Version=4.2.2.0
2.) Could not load type 'System.IAsyncDisposable' from assembly 'System.Runtime, Version=4.2.1.0
3.) Could not load type 'System.Windows.Threading.DispatcherObject' from assembly 'WindowsBase
If you change the version of the XamlHost package on the WpfCoreApplication project from 6.0.0 to 6.0.0-preview6.4 and repeat the above steps you should no longer see any of those errors when packaging and running the application.