Reputation: 11
Am wondering is there anything called Console-less application with same features of console.
Detail: I like to write an application, where I can call the application (myapp.exe arg1 arg2), but don't want any console to show up. All it does is generating an .ASX file. Am currently calling this application from Windows Media Center, so I don't want console to show up.
Any thoughts and suggestions? Thanks.
Upvotes: 1
Views: 873
Reputation: 7850
In Visual Studio 2005 (.NET 2.0) and above, you can just create a Windows Forms application and then pull the form display out of the Program.Main method and put your logic there:
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
// TODO: Your logic here
}
}
Upvotes: 0
Reputation: 48583
In your project properties, change the output type to 'Windows Application' and select your Program
class as your startup object (or whichever class contains your Main
method).
To do it from scratch, just create a Windows Application, delete the form the template creates by default, and modify your Main
method to run your code.
Upvotes: 8