sideloaded wpf app shut down unexpectedly...

Copper Contributor


I integrated help file (xps file) int wpf app and sideloaded it (WarProjTempate1). 


after starting the app, main view is:


when I click "Help" button, the app shutdown.

if there's anybody experienced like this, please let me know how to fix it.



1 Reply


The next step would be to use Process Monitor to see what is happening.


I haven't integrated a display of an xps file, so I'm only guessing here. But assuming that your help button uses an os supplied exe to display the file, it is likely that there is an issue with that exe finding the file (resulting in path or file not found result code). 


You'll need to look into what your code does.  If it is unpacking an embedded resource to a temp file for this purpose, you might need to adjust where that unpacking goes.  If not and it is just a file next to your program, you might need to adjust the path used in the external exe call.  For example, if you depended on the working directory being the folder your program is in -- the CWD is now the System32 folder and you should extract the executing directory from the assembly object instead.


Oh, and maybe put a try/catch block around the code in that help button handler to keep it from crashing...