-1

I have 2 wpf projects and one is a console which acts as a server.

Screenshot

If anyone has any solutions or alternatives, I would be grateful.

I need to find a way of running the server or the console app project after a form has been filled or a button has been pressed.

4
  • You can run both applications together right-clicking on the solution and choosing Configure Startup Projects Commented Oct 29, 2023 at 17:15
  • That isn't what i want to do though. Commented Oct 30, 2023 at 12:12
  • @MichalLigezka please edit the question to clarify that. Also it is extremely unusual to try to launch CSPOJ from your code as it is not something that can be executed by itself (unlike compiled exe). Please confirm that indeed you want to start csproj (likely opening in VS) and not garden variety "start EXE in C# code on button click" (which has tons of answers on SO already - I've added one from the answer as duplicate). Commented Nov 2, 2023 at 0:01
  • (Note that "how to run exe" also answers the question currently asked in the post - Process.Start will work with both EXE and CSPROJ just fine) Commented Nov 2, 2023 at 0:03

1 Answer 1

0

Your console application is an executable application. For example, in your project, it's something like ChatServer.exe. So you can call it in your code and execute it whenever you want. for example, in the click handler of the form or any event handler that you want, you can run your .exe file.

for more information, you can see this How can I run an EXE file from my C# code?

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.