How to create a .net application without an interface

How to create a .net application without an interface. How should I do it? I don't want this to be a console application. The best choice is a winform application that never calls application.run.

The purpose of the application is to launch and execute a simple task. let's say check the server for updating or copying files. Nothing works when a Windows service is needed.

+2


source to share


5 answers


If Windows service is not an option, you can simply create an empty project (or console application) and set the compiler target to Windows application in the project properties ( /t:winexe

command line option). This is essentially equivalent to your own proposal.



The whole point is that it /t:winexe

sets a flag subsystem

in the generated binary to the Windows executable so that the command line is not displayed when the application is running.

+12


source


You seem to have answered your own question. Never call the app. However, you never create a form, that is, the user never sees anything.



However, if you're looking for an app to run in the background, you can look for a Windows Service app. From which you can create one of these using the project template in Visual Studio

+3


source


You are looking for a Windows service. Windows services start at system startup and run in the background without any user interface. One caveat, they must be installed to run, and debugging can be a little tricky. Visual Studio provides a Windows Service project template that can get you started.

0


source


0


source


Another fairly simple way to do this is to create a winform application and hide the form in the OnLoad method.

0


source







All Articles