1

I have created a windows form app that does a few things before having a new application take over from there.

The new application needs to be a separate project within the same solution, using references for the functions to be called from the original app.

The original app will call different functions within the console app and the console app will do some processing and show output based on what has been called. Almost like a log.

The problem I am facing by adding a console app is that the console app closes immediately when the last line in main is run.

So the question is can a separate project be created that prints messages to console with persistence(Continuous running)?

It does not necessarily have to be a console output, but it would be preferred.

Appreciate the help.

Bike_dotnet
  • 234
  • 6
  • 18
  • So your question is about how to communicate between two separate apps, right? It would help if you would add some background, e.g. why those functions must be in a separate app. – Christoph Lütjen Oct 31 '21 at 13:32
  • In answer to how to keep a console app running, does this help? https://stackoverflow.com/questions/2586612/how-to-keep-a-net-console-app-running/2586635. If you have any other issue you'll need to exaplin more clearly. – Nick.Mc Oct 31 '21 at 13:44
  • You can share code between projects, but you cannot run them in sequence within one .NET app. Once started, they are different processes within Windows and you will need some inter-process communication or share data via a file or database. – Olivier Jacot-Descombes Oct 31 '21 at 14:35
  • So for context, I am a junior dev that got put on a project. And one part of the project is having a console window/output window running concurrently with my main app. And the main app does some stuff including api processing etc. Every time the main app does something I need to show it on the console app as a message if that makes sense. – Bike_dotnet Oct 31 '21 at 15:59
  • 1
    Does this help? [How do I show a console output/window in a forms application?](https://stackoverflow.com/questions/4362111/how-do-i-show-a-console-output-window-in-a-forms-application). – Olivier Jacot-Descombes Oct 31 '21 at 16:17
  • 1
    Create a Windows Form project. Then: Project Properties -> Application -> Output Type -> Console Application Does this help? – Jiale Xue - MSFT Nov 01 '21 at 01:34

0 Answers0