简体   繁体   中英

Windows Universal - crashes when calling C# runtime component in C++ project

Solution contains two projects, one is main project using c++, another project is an runtime component using C#, which is called in main project.

It works ok on Windows 10 Phone if loading on the device by VS Express for Windows10.

But the package for uploading to Windows Store crashes when running on the phone.

The following steps will reproduce the crash: (1) created an .appxupload package and unzip it to extract .appx package in it; (2) put this .appx package on the phone; (3) click .appx file to install app on the phone; (4) run the app - it runs ok until instantiate the C# class - app crashes;

Anything I need to do specifically to avoid it? or it's a bug of Microsoft?

Thanks.

I've got the answer.

I think from the beginning I shouldn't directly install .appxupload package on the phone.

I submitted the .appxupload package (without any change) to Windows Store and then install the app from Store, the app doesn't crash at all. Apparently, .appxupload package is for submitting to Store only - I think Windows Store would do some further process on package after submission?

If you'd like to have a test for your app, always install the .appx package in XXX_Test folder instead of .appxupload.

What about the paths? While in visual studio, the component paths are working properly, but while loading it from the appx, the paths might not be getting set properly. So the app is unable to find the necessary components...

Try going through the various directory and file paths in your project dependencies (for both the c++ and c# projects) to list out all the components and their references. Then verify if those references could be found in those paths when running on the phone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM