-4

If I move application itself somewhere(While it's still running).

When I use

Application.Executablepath 

It still shows me old path instead of new one!

I have to restart the application to get new path.Is there any way how to get REAL CURRENT path ?

Application.Startuppath 
Application.Executablepath 

shows only path where did file started, but not the current path.

Sunny
  • 3,185
  • 8
  • 34
  • 66
user3690993
  • 89
  • 1
  • 6

1 Answers1

4

MSDN: Application.ExecutablePath Property:

Gets the path for the executable file that started the application, including the executable name.

If you move the executable at runtime (and even if that succeeds, you don't want to), that doesn't change.

Save the new location in your application and refer to that.

If your actual question is "How to update an assembly for a running c# process (AKA hot deploy)?", then see that question.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272