Solved

Convert Windows Form Application to Console Application

Posted on 2013-01-11
5
441 Views
Last Modified: 2013-01-14
Hi all,

I have a Windows Form Application with a single form,
and I got rid of all the controls on it.
What is the best way to convert my project to Console Application?

Any help is appreciated,

Thank you
0
Comment
Question by:darrgyas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 250 total points
ID: 38768457
why would you do that? if you just want to run your application from a scheduler, it does not require to be console.
0
 
LVL 70

Assisted Solution

by:Éric Moreau
Éric Moreau earned 250 total points
ID: 38768465
otherwise, start a new application using the console template and move the files you need
0
 
LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 125 total points
ID: 38768526
Your forms code gets initiated thru either the Constructor, Load() or Shown() event.  Just move that code to the Main() method of your Console application (along with any supporting methods/functions).

If it's more complicated than that then please show us the code in question.
0
 
LVL 13

Assisted Solution

by:LIONKING
LIONKING earned 125 total points
ID: 38768544
Create a new project, add existing items for all your classes.
Copy all your logic (code) from the Form to the program.cs.

If any events have to be taken care of, you'll probably need to add some logic to the console application.

If it's not big, it would be easier if we saw at least the structure of the code.
0
 

Author Comment

by:darrgyas
ID: 38774151
I was hoping for some magic, like a tweak in a project file or something like that.
I guess not.
Thank you all
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question