Console Application


G

Guest

Hello, I used VS 2005 to create a console application. Got the application
working just fine. I then decided I would create a folder for each of my
"console" applications within that project. I created a new folder and
placed the working application under tht folder (This included the .config
file, the driver .cs (void main) and the class which is called by the driver
class which does all of the work).

I created a new folder for a new console application and created a .config
file, a driver class and then a class which would do all "work" for this new
console application.

When I compile the project, it flags the 2 "Driver" classes with the error
indicating that there is more then one "entry" point. How do I correct this
problem? How should I create these types of projects in the future? Start
the project with defining it as nothing more then a "Class Library" and then
create folders and then create the console application under those folder?

Thanks in advace for your assistance!!
 
Ad

Advertisements

F

fallenidol

since it is a console project it can only have one entry point (i.e. Main
method). you would need to go back to your original structure to get rid of
the errors. you could create multiple projects (one for each of your console
apps) within a single solution which would also solve your problem.
 
Ad

Advertisements

S

ssamuel

Hi, Jim.

Your problem started when you decided to create folders in your project
file for different applications. In VS, each project is an assembly,
and each assembly necessarily contains only one application or part
thereof.

Create multiple projects, one for each console application. Better yet,
create a separate solution for each application. That's the "official"
VS way of doing it.

If you need to share code, create a library project (a Class Library)
in its own solution, and share that project across different solutions.
Alternately, create the library solution, compile it, optionally put it
in the GAC, and reference it as a binary. That's how Microsoft does it:
mscorlib.dll contains most of the System.* namespaces.


Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Console application 2
Console Applications 8
Application and Console??? 3
Console Application 7
Console application 1
console applications 3
Console Application 1
Console application 1

Top