I have a WPF application, after closing the app its process app.exe *32
is still running in the processes list in task manager.
I need this to close as when I make an edit to my code I get the following error -
Unable to copy file "obj\x86\Release\frontEndTest.exe" to "bin\Release\app.exe". The process cannot access the file 'bin\Release\app.exe' because it is being used by another process.
I am aware that this sort of question has been asked before here.
However the solution did not work for me by changing my Assembly.cs
to -
[assembly: AssemblyVersion("2.0.0")]
[assembly: AssemblyFileVersion("2.0.0")]
I thought that perhaps if I were to find the Window closed
event and puttting something like - Process.GetCurrentProcess().Kill();
in the event so that when a user closed the application from the red 'x'
button in the top right of the form this would perhaps kill the process?
BackgroundWorker
s orThread
s? If so, you will have to somehow signal them to terminate. – Crate