File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,14 @@ class ArgsTray {
113113 /// </summary>
114114 [ STAThread ]
115115 static int Main ( string [ ] args ) {
116- // redirect console output to parent process, for command line help etc.
117- // not perfect, but probably as good as it can be: https://stackoverflow.com/a/11058118
118- AttachConsole ( ATTACH_PARENT_PROCESS ) ;
119- Console . OutputEncoding = Encoding . UTF8 ;
116+ try {
117+ // redirect console output to parent process, for command line help etc.
118+ // not perfect, but probably as good as it can be: https://stackoverflow.com/a/11058118
119+ AttachConsole ( ATTACH_PARENT_PROCESS ) ;
120+ Console . OutputEncoding = Encoding . UTF8 ;
121+ } catch {
122+ // ignored (probably non-console mode)
123+ }
120124
121125#if PORTABLE
122126 // Portable settings
You can’t perform that action at this time.
0 commit comments