c# - Visual Studio debugger does not exit after application was killed -


whenever run code via visual studio after second run not exit, meaning still running visually down, yet visible via taskmanager. believe has buffer being filled keys , cannot handle flow (after running code without method showed below works fine).

 _controls _movement; //creates object of class   public void mainwindow1_keydown(object sender, keyeventargs e) //eventhandler method, being called when key pressed.     {        if (_movement == null)            { //assign value object once           _movement = new _controls(characterbody, characterfeet);            }      _movement.controlling(e); //calling method whether key pressed     } 

above code method being called when key pressed call method controlling every time key press occurs.

class _controls : mainwindow {     private rotatetransform rotateall;     private image _characterbody, _characterfeet;      public _controls(image _characterbody, image _characterfeet)     {         this._characterbody = _characterbody;         this._characterfeet = _characterfeet;     }      public void controlling(keyeventargs e)     {      } } 

after second run , spamming key or keys not exit. yet works when run directly (.exe).

here output:

       'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.hostingprocess.utilities\12.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.hostingprocess.utilities.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.windows.forms\v4.0_4.0.0.0__b77a5c561934e089\system.windows.forms.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.drawing.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system\v4.0_4.0.0.0__b77a5c561934e089\system.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.hostingprocess.utilities.sync\12.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.hostingprocess.utilities.sync.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\assembly\gac_msil\microsoft.visualstudio.debugger.runtime\12.0.0.0__b03f5f7f11d50a3a\microsoft.visualstudio.debugger.runtime.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\users\unranked\documents\visual studio 2013\projects\shooter2d\shooter2d\bin\release\shooter2d.vshost.exe'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_32\system.data\v4.0_4.0.0.0__b77a5c561934e089\system.data.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.core\v4.0_4.0.0.0__b77a5c561934e089\system.core.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.xml\v4.0_4.0.0.0__b77a5c561934e089\system.xml.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\microsoft.csharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\microsoft.csharp.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.xml.linq\v4.0_4.0.0.0__b77a5c561934e089\system.xml.linq.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.data.datasetextensions\v4.0_4.0.0.0__b77a5c561934e089\system.data.datasetextensions.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.xaml\v4.0_4.0.0.0__b77a5c561934e089\system.xaml.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\windowsbase\v4.0_4.0.0.0__31bf3856ad364e35\windowsbase.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_32\presentationcore\v4.0_4.0.0.0__31bf3856ad364e35\presentationcore.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\presentationframework\v4.0_4.0.0.0__31bf3856ad364e35\presentationframework.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        thread 0x1108 has exited code 259 (0x103).        thread 0x1550 has exited code 0 (0x0).        thread 0x1730 has exited code 259 (0x103).        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\users\unranked\documents\visual studio 2013\projects\shooter2d\shooter2d\bin\release\shooter2d.exe'. symbols loaded.        step into: stepping on non-user code 'shooter2d.app..ctor'        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\system.configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\system.configuration.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        step into: stepping on non-user code 'shooter2d.app.main'        step into: stepping on non-user code 'shooter2d.app.initializecomponent'        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\presentationframework.aero\v4.0_4.0.0.0__31bf3856ad364e35\presentationframework.aero.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\presentationframework-systemxmllinq\v4.0_4.0.0.0__b77a5c561934e089\presentationframework-systemxmllinq.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\presentationframework-systemxml\v4.0_4.0.0.0__b77a5c561934e089\presentationframework-systemxml.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled.        'shooter2d.vshost.exe' (clr v4.0.30319: shooter2d.vshost.exe): loaded 'c:\windows\microsoft.net\assembly\gac_msil\uiautomationtypes\v4.0_4.0.0.0__31bf3856ad364e35\uiautomationtypes.dll'. skipped loading symbols. module optimized , debugger option 'just code' enabled. 

how possible make software exit?

you may want try setting

app.current.shutdownmode = system.windows.shutdownmode.onmainwindowclose; 

this force application shut down main window
of application has been closed.

side note: looks you're trying build game loop, wpf might not best solution that. may want monogame or unity.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -