Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

VB.Net, Winforms, Windows 10

Don't know if anyone has come across this before, but what I'm trying to do is run one EXE from another using Diagnostics.Process.Start and then delete the original if it needs updating, whilst the second one is still running. That first EXE then closes after it has run the second, no problem.

When I try to update the first one that spawned the second, I get the 'Cannot access the file as it is use' etc. exception.

The two programs exist in 2 completely separate folders.
I can see in Task Manager that the first EXE has completely disappeared, and I can come back days later and the second EXE still has a hold somehow on the first.

If I end the second EXE I can update/delete etc. the first no problem.

Does anyone have any ideas why this might be happening? Or come across it before.
I'm going to see if I can find a tool that will tell me more about the second running assembly and what connections it might have to any other processes on the computer.

Hope that makes sense.

Julian

What I have tried:

Google searches (difficult to word my problem succinctly!)
Different Diagnostics.Process.StartInfo parameters. All to no avail.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900