There are a few ways you can run the same executable as the present instance in C#, without using Process.Start(). Here are two ways:
AppDomain.CurrentDomain.ExecuteAssembly(Assembly.GetEntryAssembly().Location);
This will execute the same executable as the present instance.
MethodInfo method = typeof(Program).GetMethod("Main");
method.Invoke(null, null);
Replace "Program" with the name of your program class if it's different. This will call the Main() method of the same executable, effectively running it again.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-02-14 11:00:00 +0000
Seen: 9 times
Last updated: Nov 27 '22
What does "terminate called after throwing an instance of 'std::out_of_range'" mean?
What is the method to obtain the current DecoderVideoRenderer in Android ExoPlayer 2?
How can the Django post_save() signal be implemented?
What is the process for transferring image files to an AWS EC2 instance?
What is the issue with calling `jakarta.validation.Validation#buildDefaultValidatorFactory`?
How can the ServiceCollection be overridden in middleware?
When a fragment is destroyed, why isn't the Android ViewModel also destroyed?