Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 937303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:27:22+00:00 2026-05-15T21:27:22+00:00

A while back, I asked a question on here about how to run an

  • 0

A while back, I asked a question on here about how to run an application as a thread in the memory space of another application, rather then a new process: Executing a program as a thread and not as a process

As a follow up to that question, I think I have a theory on how I might do this to acheive what it is I’m trying to do. First off, let me say, the reason I am doing this is because I am trying to create a test bed application that can “test” other applications, but control them so if they get an exception, my test bed application can end the thread and restrart it automatically.

My theory on how to do this is to create an interface, called ITestBed for example and have the main class in my application implement this. The implementation will contain one method, TestApp(), for example. All I need to do from my test bed application is call this method and this method on the application side can just mirror the constructor of my current object? Will this work?

Essentially, what I am trying to do is mimmick how Visual Studio works. If you set a break point in your program, hit to run your application in Visual Studio, your application is running as a child of the Visual Studio application. To test this, you could end the visual studio application and your application will also end. How can I acheive this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:27:23+00:00Added an answer on May 15, 2026 at 9:27 pm

    You don’t need to run it as a separate thread.

    When you use Process.Start to launch a process, it is a child process of the current application.

    Just watch for the Process.Exited event (making sure to set EnableRaisingEvents to true), and use it to see when the process exits. You can then restart the process automatically at that point.


    My theory on how to do this is to create an interface, called ITestBed for example and have the main class in my application implement this. The implementation will contain one method, TestApp(), for example. All I need to do from my test bed application is call this method and this method on the application side can just mirror the constructor of my current object? Will this work?

    This will work. You can load the main exe’s assembly via reflection, and construct the main object, then call your method. Doing this makes the process part of your current application, however – so it has some side effects. You’re sharing process memory space in this situation.

    If you do this, you may want to look into Application Domains. By loading and “launching” your ITestBed implementation in a separate AppDomain, you’ll protect your main application.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 463k
  • Answers 463k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer For anyone else trying this here is the code that… May 16, 2026 at 12:53 am
  • Editorial Team
    Editorial Team added an answer You could use Adobe Air, follow this tutorial and include… May 16, 2026 at 12:53 am
  • Editorial Team
    Editorial Team added an answer Here is all members of InputSystem have invalid addresses in… May 16, 2026 at 12:53 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.