I have 2 applications. one is a console application and the other is a windows form application.

I need both of these to run together in order for my application to work. for example:

The console application - has controls over the cursor, so it'll navigate 5cm blocks from left to right on the screen.

The Windows form application - will be in the back ground, and when the cursor goes over the form different things will pop up

(the above is just as example)


What i need to do is, to run both these applications in just 1 click. as in when i run the solution, i need it to pop up the windows form and then launch the console application (which is in another solution), and finally to get my application running.

hope i made my question clear. This question might sound dumb, but i am new to C#. Please help.

Give me step by step instructions how to do this.

i am using Windows Visual Studio 2008.

Dani AI

Generated

Two practical options will solve the “one click = both apps running” requirement. The simplest when feasible is to merge the console logic into the WinForms project (or into a shared class library) — this removes interprocess complexity, makes cursor/GUI interaction far easier, and follows ’s suggestion. If keeping them separate is required, either (A) put both projects in a single solution and use Visual Studio’s multiple-startup feature, or (B) have one program launch the other (a small launcher or the WinForms app starting the console EXE).

Steps for the “both projects in one solution” approach (VS2008):

  • Add the console project: Solution Explorer → right‑click the solution → Add → Existing Project → select the console .csproj (or copy the compiled .exe into the WinForms bin if the project can’t be added).
  • Make both start when debugging: right‑click the solution → Properties → Common Properties → Startup Project → select “Multiple startup projects”, set Action = Start for each project, click OK.
  • Optionally set Project Dependencies so build order is correct.

Alternative: launch the console EXE from the WinForms app (call early, e.g., Program.Main or Form.Load):

using System.Diagnostics;

var psi = new ProcessStartInfo {
    FileName = @"C:\path\to\ConsoleApp.exe",
    Arguments = "",
    WorkingDirectory = System.IO.Path.GetDirectoryName(@"C:\path\to\ConsoleApp.exe"),
    UseShellExecute = false,
    CreateNoWindow = false
};
Process.Start(psi);

Notes and troubleshooting:

  • Ensure the console EXE path is correct and the project is built. Check platform target (x86/x64) and working directory.
  • If cursor control needs elevated rights, run the process with appropriate privileges (debugging may require running Visual Studio as Administrator).
  • For maintainability, extract shared logic into a class library and reference it from the WinForms app rather than keeping critical behavior split across processes.
    Also, ’s point about phrasing is worth keeping in mind — clear, focused questions tend to get faster, more precise answers.

Recommended Answers

All 3 Replies

Give me step by step instructions how to do this.

Does not sound very friendly, doesn't it?
So, I don't expect many answers to your question. :)

Question 1: Why a console app and a winform app? I think it might be easier to have just a winform app and that's all unless the console one does something special, but I don't see why it couldn't be combined.

Question 2: What's your goal in doing something like this? Seems odd to me. While it can be done, there might be a better, easier, more elegant way of doing whatever it is your trying to do.

Does not sound very friendly, doesn't it?
So, I don't expect many answers to your question. :)

I am not expecting many answers, but one correct answer :) Thanks for the reply.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.