Skip to content

DataGrid for Xaml Islands - cont'd #3216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
virzak opened this issue Apr 1, 2020 · 14 comments
Closed

DataGrid for Xaml Islands - cont'd #3216

virzak opened this issue Apr 1, 2020 · 14 comments
Labels
Completed 🔥 DataGrid 🔠 Issues on DataGrid control question ❔ Issues or PR require more information XamlIslands 🏝️
Milestone

Comments

@virzak
Copy link

virzak commented Apr 1, 2020

This is a follow-up to a previous DataGrid for Xaml Islands issue

Been hoping to see a DataGrid example, but one doesn't exist.

So I added a DataGrid in my test project which works fine without the data grid and breaks as soon as datagrid is uncommented.

The output is not very helpful:

'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Windows\system32\WinMetadata\Windows.Storage.winmd'. Module was built without symbols.
Exception thrown: 'System.AggregateException' in System.Private.CoreLib.dll
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.3\System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.3\System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'WpfApp1.exe' (CoreCLR: clrhost): Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\3.1.3\System.Diagnostics.Tools.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
The program '[25344] WpfApp1.exe' has exited with code -1073741189 (0xc000027b).

Can someone suggest what's wrong here?
Thanks

cc: @marb2000

@virzak virzak added the question ❔ Issues or PR require more information label Apr 1, 2020
@ghost ghost added the needs triage 🔍 label Apr 1, 2020
@ghost
Copy link

ghost commented Apr 1, 2020

Hello virzak, thank you for your interest in Windows Community Toolkit!

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 answer the question and provide feedback 🙌

@michael-hawker
Copy link
Member

@azchohfi are these part of the new test cases you're working on for #3206?

@azchohfi
Copy link
Contributor

azchohfi commented Apr 3, 2020

Yes they are. I've fixed some of them already. I'll make sure I add some data grid tests.

@michael-hawker
Copy link
Member

@azchohfi does it make sense to split that PR up a bit since some of it was already reviewed?

@azchohfi
Copy link
Contributor

azchohfi commented Apr 4, 2020

I don't think so. Its almost ready to review. I'm just improving the tests now.

@virzak
Copy link
Author

virzak commented Apr 21, 2020

Getting exact same problem when using controls from Microsoft.Toolkit.Uwp.UI.Controls so looks like it is not DataGrid specific issue. Noticed that none of the official samples use that library.

<controls:MarkdownTextBlock Text="**This is *Markdown*!** 😍❤💋🌹🎉😎�🐱‍👤" Margin="6" />

@azchohfi
Copy link
Contributor

Can you try using the preview of 7.0.0? It has a bunch of XAML islands fixes.

@virzak
Copy link
Author

virzak commented Apr 21, 2020

@azchohfi

Thanks for looking into this.

Upgraded

Microsoft.Toolkit.Uwp.UI.Controls -> 7.0.0-preview1
Microsoft.Toolkit.Uwp.UI.Controls.DataGrid -> 7.0.0-preview1

Microsoft.Toolkit.Wpf.UI.XamlHost -> 6.0.1
Microsoft.VCRTForwarders.140 -> 1.0.6

But still doesn't work.

Could you please give it a try? I would think that not being able to use Microsoft.Toolkit.Uwp.UI.Controls would be a showstopper for many people. It looks good in design time, BTW.

@azchohfi
Copy link
Contributor

azchohfi commented Apr 21, 2020

I ran your demo.
Your debug builds are using the reflection based Microsoft.UI.Xaml.Markup.ReflectionXamlMetadataProvider, which will not work on an unpackaged app. You can easily fix that by adding:

<EnableTypeInfoReflection>false</EnableTypeInfoReflection>
<EnableXBindDiagnostics>false</EnableXBindDiagnostics>

In your App1.csproj file and in your ClassLibrary1.csproj. Those are off by default on Release mode already.
After this change, it executed fine. To be able actually see the MarkdownTextBlock, I just increased the element's height.

@azchohfi
Copy link
Contributor

image

@virzak
Copy link
Author

virzak commented Apr 21, 2020

It does indeed works in Release mode! But still not in debug mode, unfortunately.

My demo always had those lines in the class library as per the walk-through (which only required them to be added to Class Library). Adding them to App1.csproj did not make a difference as I was still getting the System.AggregateException in Visual Studio output as in the initial comment. Removing them from ClassLibrary1.csproj produced a totally different error: "Cannot create control of type ClassLibrary1.MyUserControl1"

Throughout the testing I was deleting bin/obj folders.

Are you sure you were able to run that demo in debug mode?

@azchohfi
Copy link
Contributor

Yes, I'm sure. I didn't switch to Release at any moment, and it was failing before I made the changes. Make sure to rebuild everything. I added it to both the class library and the app's csproj. I added them at the beginning of the file, not the end, but I don't think it would make a different. I usually add them at the end of the very first PropertyGroup.

@virzak
Copy link
Author

virzak commented Apr 21, 2020

Actually moving them to the beginning of the file was what did the trick!!! Now it works in debug mode as well. Thanks!

@Kyaa-dost
Copy link
Contributor

#3352 fixed this issue 🚀

@ghost ghost locked as resolved and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Completed 🔥 DataGrid 🔠 Issues on DataGrid control question ❔ Issues or PR require more information XamlIslands 🏝️
Projects
None yet
Development

No branches or pull requests

4 participants