Reputation: 4678
I need to write a very small application which writes some system data to a file and then exits. I could do this in a console application but I have no need or desire for a console window to appear during this process.
I would normally use a Windows Forms application with no forms, execute the code in the Main method and then allow the application to exit, however, this time I couldn't help but wonder if this is the best way to do it and whether you could do it with a WPF application instead, what the differences are and whether or not once you've remove any forms/windows and unnecessary reference, it matters or not.
Upvotes: 3
Views: 1075
Reputation: 43023
Windows Forms with no window or console app with the type changes to windows application will give you the same result which is a simple app with Main()
method and now windows.
WCF will only make sense if you actually want to display something as you're not going to use any of its features in your case.
Upvotes: 0
Reputation: 888107
WPF and WinForms are two different libraries that show UIs.
If you never show a UI, you aren't using either of them.
You should start with a WinForms project (WPF projects set extra project metadata that you don't want), then delete the reference to System.Windows.Forms.dll
.
Alternatively, start with a console project, then change the Output type to Windows Application.
Upvotes: 8