C#.net windows application

Since I am new to c#.net 2008 but I have worked a little with visual 
basic.net 2005, I have the following questions I would like to ask: 
1. When I am looking at a .sln file that I will be maintaining a work, I can 
see there are lots of static void Main() methods in a file called program.cs 
throughout the solution in separate folderts. Can you tell me the purpose of 
this kind of code? Does this instantiate an object, is this a class libary 
member? 
2. When running the C#.net 2008 professional version windows application, 
how do I know which 'main' method is being called? 
3. When looking at this sln, I would like to determine all the different 
ways to run this .sln application there are. To do this would I look at the 
different ways there are to run the application (release, debug, configuation 
mange), would I use the object explorer? How would you recommend I learn how 
this .sln is executed 
0
Utf
5/31/2010 4:42:01 AM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

1 Replies
1123 Views

Similar Articles

[PageSpeed] 4

jazzydance wrote:
> Since I am new to c#.net 2008 but I have worked a little with visual 
> basic.net 2005, I have the following questions I would like to ask: 
> 1. When I am looking at a .sln file that I will be maintaining a work, I can 
> see there are lots of static void Main() methods in a file called program.cs 
> throughout the solution in separate folderts. Can you tell me the purpose of 
> this kind of code? Does this instantiate an object, is this a class libary 
> member? 

You appear to have the same Internet identity as "Wendy Elizabeth".  Are 
you?  If so, why are you posting a question almost identical to the 
previous one you posted?

To add to my previous answer (since you didn't mention solutions in your 
previous question): a single solution can refer to two more projects, 
any of which can be an application.  Each application project will have 
its own entry point, defined as a Main() method in some class (but in 
the Program class by default).

When debugging a solution, only one project can be the current "startup 
project", which you can choose by selecting in the Solution Explorer, 
right-clicking and selecting the menu item "Set as Startup Project" (or 
something like that…I forget if that's the exact wording).

Of course, when running each application outside of the debugger, you 
can choose whichever specific application you want to run, and each will 
work according to whatever its project settings were.

> 2. When running the C#.net 2008 professional version windows application, 
> how do I know which 'main' method is being called? 

One way to do it is open the solution and the press the F10 key, which 
will single-step into the startup project's entry point.

Without debugging, you would have to look to see which project is the 
startup project for the solution (it will be the project displayed with 
a bold font name in the Solution Explorer), and then look at that 
project's properties to see which class is the startup object for the 
project.  The Main() method in that class is the entry point for the 
project.

> 3. When looking at this sln, I would like to determine all the different 
> ways to run this .sln application there are. To do this would I look at the 
> different ways there are to run the application (release, debug, configuation 
> mange), would I use the object explorer? How would you recommend I learn how 
> this .sln is executed 

You don't execute a Solution per se, though as I mentioned, a Solution 
does have a current startup project.  It's the project that is executed, 
and that can change if there are more than on executable projects in the 
Solution.

Configuration Manager can show you all the different configurations 
configured for the Solution (noting, of course, that each project can 
have its own possible build configurations which may or may not be 
identical to those for the Solution, though normally one tries to keep 
the Solution and project configurations in sync with each other).

Beyond that, it's simply a question of what project is the current 
startup project, and what class within that project is the current 
startup object class.

Pete
0
Peter
5/31/2010 5:07:45 AM
Reply:

Similar Artilces:

Windows CE .net
I have a new MobilePro 900c (Windows CE .net) and when I try to run my existing application it says it is missing part of the application. I look for the mfc dll and it is not there. I try copying the mfcce30.dll from the ARM folder inWindows CE Tools and it still doesn't work. Any ideas or am I missing something really obvious. Any thoughts or suggestions would be welcome. TIA, Will Singer "Will Singer" <will@pdmb.com> wrote in message news:<OSwjoletEHA.220@TK2MSFTNGP15.phx.gbl>... > I have a new MobilePro 900c (Windows CE .net) and when I try to run my >...

*Keeping* multiple CToolbars docked in a single row during window resize
I have an MDI app with several toolbars docked in a single row (using DockControlBarLeftOf etc.) I am trying to prevent the rightmost toolbars from repositioning beneath the other toolbars in the same row as the main window frame is resized. Currently each toolbar is automatically repositioned on the left of the screen in order to prevent it going out of view as the window width shrinks. I would like to keep the toolbars as they are initially set; in a single row, during any window sizing operations. I still need to make the toolbars *manually* draggable, floatable and moveable by user mou...

How to build a project in Visual C++.net developed in Visual C++ 6
Hi, I am Nageshwar. I have developed a project in VC++ 6.0 and OpenGL. I have installed VC++.net in my system. When I compile and build the same code in VC++.net environment, I am getting errors. I have used fstream.h to read and write to files. But this header file is showing errors in VC++.net. I have used iostrea.h header. This is also showing erros. I think I need to use a different version of headers. Please suggest me how to recover from these errors. Which header file I have use instead of fstream.h header? etc., Thanks for all who help me.. Awaiting an early response, Nageshwar ...

C: Drive documents and setting expansion
Whenever I, Right Click Start then click "Explore", I get an expansion of the my user ID folders. Now, I rarely us "Documents and Settings" and would like to have it expand differently. What do I need to change so that can happen?? Thanks.. Bruce A. Julseth wrote: > Whenever I, Right Click Start then click "Explore", I get an > expansion of the my user ID folders. Now, I rarely us "Documents and > Settings" and would like to have it expand differently. > > What do I need to change so that can happen?? 1. You could ...

Installing Dynamics GP 9 on Windows XP + SQL Server 2005 Standard
Hi, I installed Dynamics GP 9.0 on Windows XP with SQL Server 2005 Standard without problems during installation. But, when I open GP Utilities the "Server" field is blank and the combo box listing there are no servers to choose from. Or, in the other words, GP Utilities doesn´t show any server. Or again, seems that GP Utilities doesn´t care about the database... And I can´t go ahead. I´d be very glad for any help. Thanks. Marcos, You need to create an ODBC data source so that Utilities knows what server to point to - take a look at page 29 of the GP 9...

Windows update installation problem under Windows 7 64 bit
This morning I noticed a message in the Action Center saying that there had been a "Windows Update installation problem" dated two days ago. A Windows update did not install properly, it said. I checked my system and application logs for the past week and found no error messages. I checked Windows Update history and I did an update for Internet Explorer 8 on 1/23, two days earlier, that it said completed successfully. I do see there is an Internet Explorer 8 update to be installed.still and am assuming that must be *again*? So I am confused. Do I have a problem or not? How do...

CRM 1.2 Install, Windows 2003 and Security Service
Hi, anyone know why when I install CRM1.2 on Windows 2003 Server I get an error with the MSCrm Security Service, The exact error is as follows Setup was unable to unregister the security service. I have search everywhere for this problem with no luck thanks in advance Brian Corbett ------=_NextPart_0001_0819F6A1 Content-Type: text/plain Content-Transfer-Encoding: 7bit Hi Brian, I have seen this happening when CRM and SQL run on the same machine. In order to fix this try the following steps: 1. Log in to your CRM server as Domain admin and under CMD prompt. 2. Type cd Progr...

Windows 7 fails configuring updates
Windows 7 fails configuring updates OS: Windows 7 Ultimate 64 bit Antivirus: Avira AntiVir Personal RaZ123121 wrote: > Windows 7 fails configuring updates > OS: Windows 7 Ultimate 64 bit > Antivirus: Avira AntiVir Personal All updates or a specific one ? When did this issue start to occur ? Click the Start orb > type the following in the Search field windowsupdate.log Under Programs, click on windowsupdate.log Scroll all the way to the bottom of the log for the most recent entries. Copy and paste at least the last 50 or so lines of the log into your repl...

.NET Framework 1.1
I have Vista Home Basic. In the Control Panel\Programs and Features I find: Microsoft .NET Framework 1.1 Microsoft .NET Framework 3.5 SPI Microsoft Corporation Under Publisher there is nothing in the fist. Is it OK? Should I redownload it? Also, do I need both of them? Also, in Control Panel\Windows Update\View Update History, I see that Microsoft .NET Framework 1.1 Service Pack 1 has failed, and was not tried again. Should I download it manually? Thanks, emf -- It ain't THAT, babe! - A radical reinterpretation https://files.nyu.edu/emf202/public/bd/itaintm...

Using XSL in VB.net
All I want to do is execute a simple transformation in VB.net.... I know this has to be simple. I tried the following as suggested by a web page I found.... Dim xslt as New XslTransform() xslt.Load("Filename") xslt.Transform("InFile", "ResultFile") This appears to be very straightforward to me. However, this causes an error saying the code is obsolete... (I thought the whole Framework version concept meant backwards compatability, but I guess not.) it further says "You should pass XmlResolver to Transform() method" Can anyone tell me how / where...

Windows 7 Password Recoverey
Need Windows 7 Password Recovery options so you can recover your Windows 7 password? If you need to get your Windows 7 password recovered, then I will help you to do this. I will help you to do this by giving you the best Windows 7 password recovery options. This way, you'll be able to recover your Windows 7 password on the easiest, fastest and safest way. the best way to recover your Windows 7 password is by using a Windows 7 Password Recovery program. This way, you'll be able to automatically recover a Windows 7 password. The program is called Password Resetter, and It...

pas de connexion sur windows mail
Comment faire pour r�initialiser le mot de passe afin d'ouvrir et prendre connaissance de mes mails/pas de probleme pour envoyer des messages ...

Create timeline for 2500 B.C. to 100 B.C.?
Visio only allows me to create timeline for after 1900 AD. Can I use Visio to create a timeline for 2500 BC to 100 BC? Visio's Divided timeline has exactly what I need except I can not enter BC as the start and end time. And Visio always require end time to be greater than the start time. Any suggestion on how I can do this in Visio? You're not going to be able to use the timeline because the code is linked to the system clock (only goes back to 1900). You'll have to use the vanilla shapes that come with visio. Al "Little Black Sheep" <Little Bl...

Sort Order on Order Fulfillment Window
In the sales order fulfillment window you can sort the lines items by Order Entered or Site/Bin/Item. Does the Site/Bin/Item only sort by Bin if Multi-bin is used? I am not using multi-bin but have created bin for each item in each site on the Quantities/Sites window. thanks. ...

Database Object Window will not display
I have a database that nothing I have tried will cause the Database Object Window to be displayed again. I have set the start up parameters back the the default settings. I have double check the code and I do not have any code that is hidding the Database Window. I performed a compact repair. I also converted it from a 2000 DB to a 2002 - 2003 with out success. In the view options I have checked all objects. The only changed has been the database was copied from its old server location into its new location when we upgraded servers. My other databases (all 35 of them) seem to be funct...

C++ : Is it lots harder than c# and VB
Hi everyone, I learned Java whilst at university and have taught myself c# and VB.net. I think I am ok at it. I was thinking, these languages will probably be bigger in the future so I better get ready for them. But then, I also realised that COM is still quite important and so is C++. So I thought I better just try and have a look at C++ and COM. And now I'm scared. So my question is - why does C++ look so much harder than c#? For example : 1. The methods all have really stupid names that are hard to descern a function from. 2. You need to think about pointers and cleaning up ...

intermittent error calling .NET web service
I'm getting an intermittent error when calling a .NET web service from a .NET console application. Both are using v.1.1.4322 of the framework. Any ideas on what could be causing this? It can fail and then a few seconds later can work fine. The exception is: <log4net:event logger="WRDataSyncApp" timestamp="2005-01-11T03:00:49.7336956-05:00" level="ERROR" thread="5808" domain="WRDataSyncApp.exe" username="CLT01IAWEB010N0\EquityAdmin"><log4net:message>Exception: System.InvalidOperationException Message: There is...

Visual C++ to read Strings from Serial Port
Hi. I'm doing a project using Visual C++ to read data from Serial Port. My program needs to do *something* when it receives specific data. For eg, if the program receives "Alarm 1 Zone 4", it will do something. The data received will be variable in length. My questions: 1) Any recommendations for the serial Comm Class for Visual C++? 2) How can i compare the data i receive from serial to the specific messages i'm looking for, eg data types, size of data types, limitations & etc.? Thanks. Any comments are highly appreciated. Leng As far as the serial part goes, it i...

Net Worth Error
In Money 2007, I get an error when I try to look at my net worth. The error reads, "An error occurred, but Money is unable to retrieve and display details about what happend. (Resource = rcreport. Error = 2109.)" I ran the Standard File Repair but received a "No broken records in the original file." result. Any suggestions? Thank you. I had a similar problem with the monthly reports. Look at my post called "Troubleshooting method" that I wrote on 9/13/06, it might give you some ideas. Regards Bill Wood "T. J. Allard" <T. J. Allard@discu...

C#.net windows application
Since I am new to c#.net 2008 but I have worked a little with visual basic.net 2005, I have the following questions I would like to ask: 1. When I am looking at a .sln file that I will be maintaining a work, I can see there are lots of static void Main() methods in a file called program.cs throughout the solution in separate folderts. Can you tell me the purpose of this kind of code? Does this instantiate an object, is this a class libary member? 2. When running the C#.net 2008 professional version windows application, how do I know which 'main' method is being called? ...

Windows XP 64bit Movie Maker
Hi, Currently i'm using some 32bit Windows Movie Maker filters (*.ax / *.dll) as effects in a project i'm building, and i have to port my project to 64bits. Because 32bit filters don't work on a 64bit system, my question is : does it exist a Windows Movie Maker 64Bit for Windows XP 64bit? Thanks, Alex. ...

Floating form/window?
Hello all. Is there a way to have a "floating" form on an Excel spreadsheet? What I mean is to have a form (with controls) that always is available no matter what worksheet the user clicks on. For my particular project, there will be about 50 worksheets in this one project. What I want is to have a form (or window) that is always available so that the user can add a new member whenever they wish. I thought about using a command button, but then I don't know how to make that button appear on each worksheet. The new member would always be added to the active worksheet (or th...

Setting for multiple controls <ekXTh.42469$VU4.14648@bgtnsc05-news.ops.worldnet.att.net>
Did you know you can just select all the controls on the form in design mode by typing CTRL-A (or alternatively multiple by holding down SHIFT and then clicking on each one). Then with all you want to change selected do the Conditional Format and it will apply to all! EggHeadCafe.com - .NET Developer Portal of Choice http://www.eggheadcafe.com ...

MFC DLL Calling C# Assembly
I have been trying to get a simple mfc dll I wrote to add to numbers call a C# assembly. Here is a sample of my C++ code in my cpp file. extern "C" _declspec(dllexport) int Calc(int no1,int no2) { //result = no1 + no2; return MangedAdder(no1, no2); } #pragma managed #using <mscorlib.dll> #using <ControllerLibrary.dll> int MangedAdder(int a, int b) { ControllerLibrary::DLLController *t = new ControllerLibrary::DLLController(); return t->AddNumbers(a, b); } All I really need is an extern function in a mfc dll that calls a me...

Type Casting in C and C++
Hello NG As an old style programmer I've been casting values with the C-syntax like: double dVal=3.14; float fVal = (float) dVal; but now I've been told that the C++ syntax should do a better job float fVal = static_cast <float>(dVal); for some reason. Is this true? Will the C++ compiler really generate different (better?) code or is it simply more writing I have to do? Thanx Richie >As an old style programmer I've been casting values with the C-syntax like: > >double dVal=3.14; >float fVal = (float) dVal; > >but now I've been told that the C+...