Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UWP Unable to debug .NET compilation code (Release)

My UWP apps were running flawlessly on debug but instant crash on release, I've uploaded the package to app store twice and they tell me that my app doesn't work too. Unticking that .NET Native stuff helps but I'm not sure it will work on other users' pc and I have no idea what that does, I think something goes wrong.

My other projects can run Release build flawlessly, I've tried clean up everything and re-build but I get the same error.

Thank you

edit: tried running on my laptop, stuck at splashscreen then got the same error, I even tried removing anything on MainPage constructor and OnNavigatedTo.

Running flawlessly on debug but instant crash on release: Running flawlessly on debug but instant crash on release

Unticking this helps: Unticking this helps

like image 669
Lee Song Avatar asked Dec 22 '15 12:12

Lee Song


2 Answers

I found the solution, I think this is a bug where Visual Studio passes command line to compiler which I suspect they forgot to put quote "" to cover the path.

Project with spaces in path

Project with spaces in path

Project without spaces in path

Be aware that spaces must not exist neither in the path to the project file nor in the Assembly name.

Project without spaces in path

like image 88
Lee Song Avatar answered Nov 14 '22 21:11

Lee Song


Your app should be able to run on .NET Native because it will be compiled that way in the store (before users are able to install it).

Release builds do have code optimizations enabled, which will make it harder to debug. If you want to debug .NET Native, you should disable the optimizations.

enter image description here

For the full guide on debugging .NET Native, check the msdn article. I hope this helps in hunting down the actual problem (which can be plenty).

like image 35
Bart Avatar answered Nov 14 '22 23:11

Bart