Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application-internal exception in Windows.UI.Xaml.dll

Tags:

c#

.net

xaml

uwp

I'm working on a Windows 10 Store Windows Universal app using Visual Studio 2015 Community, c#, and XAML. It is decompressing a compressed file and displaying images found therein.

The build provides 0 warnings.

The debug version runs fine regardless of input file size.

The release version runs fine with typical input file sizes.

For large input file sizes (~100 1 megapixel images), the release build crashes consistently with 'Unhandled exception at 0x55E9A305 (Windows.UI.Xaml.dll) in appname.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x127DC468, 0x00000005).'

The crash occurs when the user tries to display the second image. All decompression is complete and all the bitmaps have been created by this time.

I've fiddled with the Build settings and narrowed down the difference to the option 'Compile with .NET Native Tool chain'. If that option is checked, the application crashes. If that option is unchecked, the application runs fine.

All told, the application is using about 400 MB of heap so although not small it isn't near the capacity of the machine.

"So uncheck the option!", I hear you cry. Unchecking the box leads to the certification failure shown below:

 FAILED 
 Supported APIs


• Error Found: The supported APIs test detected the following errors: 
 -API OpenSemaphore in api-ms-win-core-synch-l1-1-0.dll is not supported for this application type. System.Threading.dll calls this API.
 -API CreateSemaphore in api-ms-win-core-kernel32-legacy-l1-1-0.dll is not supported for this application type. System.Threading.dll calls this API.
 -API ExecuteAssembly in uwphost.dll is not supported for this application type. StupidTest.exe calls this API.
 -API DllGetActivationFactory in uwphost.dll is not supported for this application type. StupidTest.exe has an export that forwards to this API.

An empty project suffers the same failure if Compile .Net Native tool chain is not selected.

So my questions:

Must Universal Apps use Compile .Net Native tool chain?

Is there any documentation on the meanings of the parameters in the internal exception or somewhere else I can turn to troubleshoot?

In short, any advice on getting out the "It doesn't work if selected, but you must select it to get certified" dilemma I find myself in?

like image 353
sillyrobot Avatar asked Oct 13 '15 15:10

sillyrobot


1 Answers

I struggled with this issue also for the past few days, and I've found the answer!

So if you haven't updated Visual Studio 2015 to Update 1, do it. Because this error is a bug in the compiler and after the update you will be able to build the project with the Compile .Net Native tool chain option selected.

And yes, those four errors that the WACK tool picks up, is because of compiling your project without checking the .Net Native tool chain option in the Build menu of the Package.appxmanifest file.

like image 75
instanceof Avatar answered Nov 16 '22 12:11

instanceof