sideloaded wpf app shut down unexpectedly...

%3CLINGO-SUB%20id%3D%22lingo-sub-2674458%22%20slang%3D%22en-US%22%3Esideloaded%20wpf%20app%20shut%20down%20unexpectedly...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2674458%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI%20integrated%20help%20file%20(xps%20file)%20int%20wpf%20app%20and%20sideloaded%20it%20(WarProjTempate1).%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222021-08-23.png%22%20style%3D%22width%3A%20647px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F304990i8F0015DEA7F7025C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222021-08-23.png%22%20alt%3D%222021-08-23.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Eafter%20starting%20the%20app%2C%20main%20view%20is%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22ice_screenshot_20210823-161505.png%22%20style%3D%22width%3A%20433px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F304991i6057BF2219EE3143%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22ice_screenshot_20210823-161505.png%22%20alt%3D%22ice_screenshot_20210823-161505.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3Ewhen%20I%20click%20%22Help%22%20button%2C%20the%20app%20shutdown.%3C%2FP%3E%3CP%3Eif%20there's%20anybody%20experienced%20like%20this%2C%20please%20let%20me%20know%20how%20to%20fix%20it.%3C%2FP%3E%3CP%3Ethanks%2C%3C%2FP%3E%3CP%3Ec00012%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2679880%22%20slang%3D%22en-US%22%3ERe%3A%20sideloaded%20wpf%20app%20shut%20down%20unexpectedly...%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2679880%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F361003%22%20target%3D%22_blank%22%3E%40c00012%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20next%20step%20would%20be%20to%20use%20Process%20Monitor%20to%20see%20what%20is%20happening.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20haven't%20integrated%20a%20display%20of%20an%20xps%20file%2C%20so%20I'm%20only%20guessing%20here.%20But%20assuming%20that%20your%20help%20button%20uses%20an%20os%20supplied%20exe%20to%20display%20the%20file%2C%20it%20is%20likely%20that%20there%20is%20an%20issue%20with%20that%20exe%20finding%20the%20file%20(resulting%20in%20path%20or%20file%20not%20found%20result%20code).%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou'll%20need%20to%20look%20into%20what%20your%20code%20does.%26nbsp%3B%20If%20it%20is%20unpacking%20an%20embedded%20resource%20to%20a%20temp%20file%20for%20this%20purpose%2C%20you%20might%20need%20to%20adjust%20where%20that%20unpacking%20goes.%26nbsp%3B%20If%20not%20and%20it%20is%20just%20a%20file%20next%20to%20your%20program%2C%20you%20might%20need%20to%20adjust%20the%20path%20used%20in%20the%20external%20exe%20call.%26nbsp%3B%20For%20example%2C%20if%20you%20depended%20on%20the%20working%20directory%20being%20the%20folder%20your%20program%20is%20in%20--%20the%20CWD%20is%20now%20the%20System32%20folder%20and%20you%20should%20extract%20the%20executing%20directory%20from%20the%20assembly%20object%20instead.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

Hello,

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

2021-08-23.png

after starting the app, main view is:

ice_screenshot_20210823-161505.png

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

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

thanks,

c00012

1 Reply

@c00012 

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...