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

Investigate: WinRT authoring for AnyCPU #1093

Closed
j0shuams opened this issue Jan 28, 2022 · 3 comments
Closed

Investigate: WinRT authoring for AnyCPU #1093

j0shuams opened this issue Jan 28, 2022 · 3 comments
Assignees
Labels
authoring Related to authoring feature work bug Something isn't working documentation Improvements or additions to documentation
Milestone

Comments

@j0shuams
Copy link
Contributor

j0shuams commented Jan 28, 2022

C#/WinRT components should target AnyCPU, however consumption from native C++ apps only works when the app targets x86. Apps targeting arm64 or x64 will get a runtime error when trying to load WinRT.Host.

@j0shuams j0shuams added the bug Something isn't working label Jan 28, 2022
@j0shuams j0shuams self-assigned this Jan 28, 2022
@j0shuams
Copy link
Contributor Author

@manodasanW When the component builds for AnyCPU, and the native app is set to build for x86 then things work fine. If we have the component build for AnyCPU and the native app for x64, then we get a runtime error that "%1 is not a valid Win32 application." I believe this to be referring to WinRT.Host, and the theory is that when the component is set to AnyCPU, it puts the x86 version of WinRT.Host in the output. We should see about some MSBuild targets work that pulls in the x64 version instead.

@j0shuams j0shuams added the authoring Related to authoring feature work label Feb 23, 2022
@j0shuams
Copy link
Contributor Author

Discussed with @angelazhangmsft and we now will advise to only build cswinrt components for AnyCPU

Per a discussion between Angela and @evelynwu-msft , we might advise that library authors need to handle placing native binaries (winrt.host) themselves for these scenarios (C++ app --> project reference --> C#/WinRT Component)

@angelazhangmsft angelazhangmsft added this to the Release 1.6.3 milestone Apr 1, 2022
@manodasanW manodasanW added the documentation Improvements or additions to documentation label Sep 1, 2022
@j0shuams
Copy link
Contributor Author

#1273

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authoring Related to authoring feature work bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants