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

Restore fallback to all loaded assemblies in FindTypeByNameCore #465

Closed
Scottj1s opened this issue Oct 8, 2020 · 2 comments · Fixed by #468
Closed

Restore fallback to all loaded assemblies in FindTypeByNameCore #465

Scottj1s opened this issue Oct 8, 2020 · 2 comments · Fixed by #468
Assignees
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release pri-0 Blocking/issue has no workaround
Milestone

Comments

@Scottj1s
Copy link
Member

Scottj1s commented Oct 8, 2020

With module initializers, projection assemblies no longer need to be registered. But projected XAML classes (e.g., MainPage) in the app still do, which requires an explicit registration in the app startup path, like:
public App()
{
WinRT.ComWrappersSupport.RegisterProjectionAssembly(typeof(App).Assembly);
}

Failure to do this results in hard to debug TypeLoadExceptions. The preference for projectionAssemblies in TypeNameSupport.FindTypeByNameCore should be preserved (so that projection types take precedence over app types - a previously reported issue), with a fallback for loaded assemblies so that apps don't have to explicitly register.

@Scottj1s Scottj1s added this to the NET5 GA milestone Oct 8, 2020
@Scottj1s Scottj1s added pri-0 Blocking/issue has no workaround bug Something isn't working labels Oct 8, 2020
@j0shuams
Copy link
Contributor

j0shuams commented Oct 8, 2020

to get XCG app working I also needed to add

WinRT.ComWrappersSupport.RegisterProjectionAssembly(typeof(Enum).Assembly);

@Scottj1s
Copy link
Member Author

Scottj1s commented Oct 8, 2020

@j0shuams right, that requirement will go away with this fix

@j0shuams j0shuams linked a pull request Oct 8, 2020 that will close this issue
@angelazhangmsft angelazhangmsft added the fixed Issue has been fixed in an upcoming or existing release label May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Issue has been fixed in an upcoming or existing release pri-0 Blocking/issue has no workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants