UWP: record the pitfalls you have stepped on over the past few days.

Source: Internet
Author: User

UWP: record the pitfalls you have stepped on over the past few days.

Recently, I was playing Microsoft's Desktop Bridge Project and encountered the following pitfalls:

1. The document provides the magic modification method for the js project. In fact, the C # project can also be added to the UWP part. The difference is:

  • <AppxGeneratePrisForPortableLibrariesEnabled> false </AppxGeneratePrisForPortableLibrariesEnabled>
  • Only Release is supported. If Debug is used, an error is reported.

2. After the win32 project references the UWP class library, note that some methods are UWP and CoreWindow is required. For example, when using C # wpf for desktop bridge, the program will report an error when calling the UWP method to obtain the resolution, but the namespace is also very similar because it uses C, pay more attention to it.

3. Copy all content to the win32 part of the uwp project. Otherwise, the win32 project must not be completely put into the root directory. It is best to create a folder and put all win32 resources.

4. If some win32 projects, especially the dll referenced by the wpf project, are put into the uwp project, an error will be reported during compilation, and I have not found a way to distinguish these problematic dll. My solution is to delete them one by one, test them, find several dependencies, and use other methods to implement them.

5. shenkeng. Nuget package, Microsoft. NETCore. UniversalWindowsPlatform. Version 5.4.X corresponds to. net native1.7, 6.0.X corresponds to. net native2.0.

Previously I used the 5.4.X, upload in the generated store package, which can be directly installed and debugged. After the store package 6.0.X is decompressed and installed, the first screen is stuck and then flashed back.

The plug-in debugger prompts that KERNELBASE. dll has an error. The Event Viewer is

Incorrect application name: TestSapmple.exe, version: 1.0.0.0, timestamp: 0x5aaa0663
Error Module name: KERNELBASE. dll, version: 10.0.17115.1, timestamp: 0xe1aad729
Exception Code: 0xe0434352
Error offset: 0x0000000000017e98
Error process ID: 0x48d8
Error application startup time: 0x01d3bc2054d14484
Incorrect application path: C: \ Program Files \ WindowsApps \ XXX \ TestSapmple.exe
Error Module path: C: \ WINDOWS \ System32 \ KERNELBASE. dll
Report ID: b98bd41a-5bf5-4ed8-8753-b5812a261580
Error package full name: XXX
Relative Application ID of the error package: App

Application: TestSapmple.exe
Framework Version: v4.0.30319
Note: The process is terminated due to an unhandled exception.
Exception information: the error code is e06d7363 and the exception address is 20177ffa9e357e98.
STACK:

 

When I reinstalled VS several times or even wanted to reinstall the system, I suddenly asked another guy and found that this was the case for everyone. Microsoft's document says that the appx package under the Test folder generated by the Test does not mention how the appload file works. So I will record this trap here, hoping that the next person who encounters this trap will be able to see it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.