PdfSharpCore icon indicating copy to clipboard operation
PdfSharpCore copied to clipboard

UWP app crashes when compiling with .NET Native tool chain enabled

Open ktdev1 opened this issue 3 years ago • 2 comments

Application crashes on startup with the following error message displayed in a popup window:

An Issue in the projectname.UWP.exe process has caused it to fail to activate. This process exited with a native exception. To debug the issue, open project properties, and configure the project to run under a native debugger. More information can be found in the Debug pane of the Output Window (Debug->Windows->Output).

The application Output Window shows the following errors:

The program '[13004] projectname.UWP.exe' has exited with code -1073741515 (0xc0000135) 'A dependent dll was not found'. Activation of the Windows Store app 'projectname_gqzyd64fk25xj!App' failed with error 'The target process aborted before activation completed. More information may be available in the Debug pane of the Output window (Debug->Windows->Output)'. Activation of the Windows Store app 'projectname_gqzyd64fk25xj!App' failed with error 'The app didn't start'.

This issue can be replicated by doing the following:

  1. Create a new Blank Xamarin.Forms project for UWP only. (Uncheck iOS and Android.)
  2. Install the PdfSharpCore (v1.3.32) NuGet package into the common project.
  3. Run the application from Visual Studio (currently using the 2019 version) in Release mode.

If you disable "Compile with .NET Native tool chain" option in the UWP Build window under Properties, then this error goes away. However, our project requires us to have this enabled in order to fully remove debug dependencies from the installer. Are there any workarounds for using this package with .NET Native tool chain enabled?

ktdev1 avatar Jul 14 '22 18:07 ktdev1

There is a breaking change for UWP compiled with .NET Toolchain somewhere between 1.3.7 - now (No idea where exactly). Consider switching to 1.3.7 so that you can compile the app with the .NET Toolchain.

DilanBoskan avatar Oct 16 '22 13:10 DilanBoskan

I have the exact same issue listed. Downgrading the nuget to 1.3.7 working for me. Thank you.

Kbmobi avatar Apr 18 '23 18:04 Kbmobi