Application identity is not set. Application.restart

hello all ,
i am getting this exception when
 Application.Restart()
           

Open in new window

any help ?

exception appear when call Application.restart
LVL 4
AhmedHindyAsked:
Who is Participating?
 
Meir RivkinFull stack Software EngineerCommented:
is it while debugging?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
indeed ... during debugging (looking at screenshot).

so, you can check out these suggestions I found:
I found that this problem exists only if you untick "Just My Code" under debug options.
in my case I just disabled the InvalidDeploymentException from Debug->Exceptions

you might look into this page for more explanation:
http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/397c38e4-4306-4791-bed6-f319384c1086
0
 
Meir RivkinFull stack Software EngineerCommented:
try this approach:

Application.Exit();

Process.Start(Application.ExecutablePath, "/restart" + Process.GetCurrentProcess().Id);

Open in new window


how-do-i-restart-my-c-sharp-winform-application
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.