Skip to content
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

IXamlMetadataProvider generation should be based on the "public" metadata, not the internal metadata #68

Merged
merged 1 commit into from Dec 11, 2018

Conversation

jevansaks
Copy link
Member

Fix #22

The problem is that our IXMP generated code answers for "private" types, which causes problems where the parser starts asking about types like XamlAmbientLight which it finds squirreled away in the UIElement tree. It asks about these types because "private" DependencyProperties refer to those types and our IXMP implementation returns a XamlType instance corresponding to it. That then causes the .NET runtime to try to turn the TypeName into a real type and it crashes because there's no metadata in the app's WinMDs of that typename. The parser folks recommended that we just return null for "private" types so in this change I switched the XamlMetadataProvider codegen to use the winmd file that's included in the nuget package instead of the "private" one. This way our IXMP is in sync with what's in the nuget package.

Verified that the nuget package with this fix allows XamlControlsGallery to launch again.

Tests passed: https://microsoft.visualstudio.com/WinUI/_build/results?buildId=13332466&_a=summary

@jevansaks jevansaks requested a review from a team December 11, 2018 21:42
@jevansaks jevansaks merged commit 8a6f70b into master Dec 11, 2018
@jevansaks jevansaks deleted the user/jevansaks/privatetypescodegen branch February 1, 2019 18:48
StephenLPeters pushed a commit that referenced this pull request Feb 9, 2019
…ernal metadat. (#68)

Fix #22 

The problem is that our IXMP generated code answers for "private" types, which causes problems where the parser starts asking about types like XamlAmbientLight which it finds squirreled away in the UIElement tree. It asks about these types because "private" DependencyProperties refer to those types and our IXMP implementation returns a XamlType instance corresponding to it. That then causes the .NET runtime to try to turn the TypeName into a real type and it crashes because there's no metadata in the app's WinMDs of that typename. The parser folks recommended that we just return null for "private" types so in this change I switched the XamlMetadataProvider codegen to use the winmd file that's included in the nuget package instead of the "private" one. This way our IXMP is in sync with what's in the nuget package.

Verified that the nuget package with this fix allows XamlControlsGallery to launch again.

Tests passed: https://microsoft.visualstudio.com/WinUI/_build/results?buildId=13332466&_a=summary
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XamlControlsGallery crashes when using latest WinUI nupkg failing to find XamlAmbientLight metadata
2 participants