Visual Studio Development Bookmark and Share   
 index > Visual Studio Guidance Automation Toolkit > how to run multiple class file with Main() method on each of them independently in a project?
 

how to run multiple class file with Main() method on each of them independently in a project?

how to run multiple class file with Main() method on each of them independently in a project?I am new to VS, I tried to see if there any options but couldn't. Can anyone help me out?

thank yo.
vectory  Wednesday, June 04, 2008 4:32 AM

Please be more specific. In what way do you want to "run" them? As console applications? As Windows Forms applications?

And, is this question really about the Guidance Automation Toolkit?


Use File->New Project to create Web Service Projects
John Saunders  Wednesday, June 04, 2008 11:55 AM
I want to run them as console application. In ecplise IDE, it can have as many class files with Main() method and can be run independently just by selecting the file. I am excepting similar option in VS, I saw the target object option in the property of project, but it is just definining which class file should be the entry object. I don't know much about VS but trying to learn. If this question is not under correct catagory, could you help me where should I post it?

thank you.
vectory  Wednesday, June 04, 2008 9:06 PM

Once you've built those classes in Eclipse, how do you run them (other than in the IDE)? I would think you'd have to build each one into a separate executable file in order to run them.

That's how you'll have to do it with .NET. Windows doesn't have a concept of classes, only of executable programs. You'll have to build each one into its own executable program by placing each one into a separate console project.

BTW, I'm not sure how this is a Guidance Automation Toolkit issue. Can you tell us how this relates to GAT? I suppose you could create a guidance package that would create separate projects for each class...


Use File->New Project to create Web Service Projects
John Saunders  Wednesday, June 04, 2008 10:51 PM
John Saunders!

Are you helping me or teasing me for my ignorance. If you can't help me then its ok.......

Sorry I couldn't put the question in the understandable way. I meant to say source files having class(CLASS) with Main() methods by saying class file not .class( dot class). And I was asking on which catagory should i post this question and you are asking me to relate with GAT. Now how can I do that. You are making me nervous.

Please don't reply to my question if you can't help me or ask me to quit the forum if those belongs to you.

I was just trying to learn...
vectory  Thursday, June 05, 2008 4:34 AM
I was not trying to tease you. I have some familiarity with Eclipse, but not very much. I had no idea how you could use Eclipse to take a bunch of class files and turn each one into a separate executable program.

And, I actually gave you the answer. In .NET you will have to put each one into a separate console project, so that each one can be turned into a separate console application.

You may not have realized it, but you posted in the "Guidance Automation Toolkit" forum, which is about a particular toolkit (seehttp://msdn.microsoft.com/en-us/practices/aa718950.aspxfor details). I assumed you posted here because you had a question about GAT. Since I was unable to see how your question related to GAT, I asked you to tell me how your question related to GAT. I then made a guess about how your question might possibly have been related to GAT, as GAT could be used to create a command in Visual Studio that would take a directory full of .cs files and turn it into a set of projects, each one containing one of the .cs files.
Use File->New Project to create Web Service Projects
John Saunders  Thursday, June 05, 2008 4:50 AM

So, if i need a separate console application to execute .cs file (with Main()), I think it would be hard for me to learn the way I am trying to. Basically, when I want to be familiar with any build in classes/library. I search the existing examples and copy its .cs file into project in the IDE and then run. I don't have to concern whether the project already have .cs file with Main or project as a whole has compile error. Atleast in ecplise. Just I can run this single file and see the output. I found this way is possible if i use csc compiler in command prompt. So i was just curious if this is possible with VS IDE.

anyway thank you sir. Next time while posting, I will study deeply which catagory should be best for my question


vectory  Thursday, June 05, 2008 5:52 AM
I'm guessing that next time you might want to post in either theVisual C# IDE or Visual C# General forums.
Use File->New Project to create Web Service Projects
John Saunders  Thursday, June 05, 2008 11:13 AM

You can use google to search for other answers

Custom Search

More Threads

• Gudence Package Error
• Unsupported version of Microsoft Visual C# 3.0 / Microsoft Visual Basic 9.0
• confused about data sources
• Command Bar to Bound recipe
• GAX installed but not showing in VS 2008
• wix creates a .bak file???
• Some items in HoL don't match GAT
• GAT not compatible with W2K?
• SiteMap Navagation getting covered up
• Deploying Guidance Package