Click here to Skip to main content
15,886,798 members
Home / Discussions / C#
   

C#

 
GeneralRe: Object reference not set to an instance of an object. Pin
HJo25-Aug-03 20:30
HJo25-Aug-03 20:30 
QuestionHow to save/load stream(such as image) to/from database? Pin
xfqiu24-Aug-03 22:46
xfqiu24-Aug-03 22:46 
AnswerRe: How to save/load stream(such as image) to/from database? Pin
Mazdak25-Aug-03 3:03
Mazdak25-Aug-03 3:03 
GeneralRunning webpage Pin
deanoA24-Aug-03 22:14
deanoA24-Aug-03 22:14 
GeneralRe: Running webpage Pin
Mazdak25-Aug-03 4:56
Mazdak25-Aug-03 4:56 
GeneralAccessing Over A NETWORK Pin
deanoA24-Aug-03 20:40
deanoA24-Aug-03 20:40 
GeneralRe: Accessing Over A NETWORK Pin
Julian Bucknall [MSFT]26-Aug-03 7:06
Julian Bucknall [MSFT]26-Aug-03 7:06 
GeneralInheritance w/ 2 Main() methods in Visual Studio .NET C# Pin
Joe McBride24-Aug-03 15:48
Joe McBride24-Aug-03 15:48 
I'm currently learning C# and Visual Studio and have run into this problem.

I'm reading Petzold's "Programming Windows with C#" and am working with two classes, both of which have Main() methods.

The second class, CsDateInheritance, is an inherited class of the first, CsDateConstuctors, and I want the program to use the Main() method of the second class, CsDateInheritance.

If using a DOS command line, the program can be complied as such:
<br />
      C:\(rootfolder)>csc CsDateInheritance.cs CsDateConstructors.cs /main:CsDateInheritance <br />
<br />
      Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4 <br />
      for Microsoft (R) .NET Framework version 1.1.4322 <br />
      Copyright (C) Microsoft Corporation 2001-2002. All rights reserved. <br />
<br />
      C:\(rootfolder)> CsDateInheritance.exe <br />
      Birthday = 21 Aug 1981 <br />
      Today = 24 Aug 2003 <br />
      Days since birthday = 8038 <br />
<br />
      C:\(rootfolder)>_<br />

Program works perfectly.

Though, I want to be able to run/debug this program in Visual Studio .NET 2003. I'm using the C# Standard Edition.

I have the first class file inserted into the solution as a linked file.

When I compile in VS .NET, I get a "this program has more than one entry point defined" error. How can I fix this in VS .NET, without having to compile from the command line?

I have found that I can set the Main() method of CsDateConstructors "IsShared" value to false, and I get a clean build. Though, this sets the class to basically be "Inheritable" only, and not stand alone.

Anyone know the trick? All help/suggestions welcome.



Joe
realmrat@msn.com
GeneralRe: Inheritance w/ 2 Main() methods in Visual Studio .NET C# Pin
Joe McBride24-Aug-03 18:45
Joe McBride24-Aug-03 18:45 
GeneralWindowsService Questions Pin
Mazdak24-Aug-03 10:49
Mazdak24-Aug-03 10:49 
GeneralRe: WindowsService Questions Pin
Corinna John28-Aug-03 1:39
Corinna John28-Aug-03 1:39 
GeneralRe: WindowsService Questions Pin
Mazdak28-Aug-03 8:02
Mazdak28-Aug-03 8:02 
GeneralRe: WindowsService Questions Pin
Corinna John29-Aug-03 1:46
Corinna John29-Aug-03 1:46 
GeneralRe: WindowsService Questions Pin
Mazdak29-Aug-03 2:40
Mazdak29-Aug-03 2:40 
GeneralRe: WindowsService Questions Pin
Corinna John29-Aug-03 9:50
Corinna John29-Aug-03 9:50 
Generalreading and writting excel format/or using ado.net Pin
djkno324-Aug-03 6:32
djkno324-Aug-03 6:32 
QuestionIs it possible to display a WinForm in a WebForm? Pin
Cristoff24-Aug-03 4:21
Cristoff24-Aug-03 4:21 
AnswerRe: Is it possible to display a WinForm in a WebForm? Pin
leppie24-Aug-03 5:22
leppie24-Aug-03 5:22 
GeneralRe: Is it possible to display a WinForm in a WebForm? Pin
Kannan Kalyanaraman25-Aug-03 0:33
Kannan Kalyanaraman25-Aug-03 0:33 
GeneralRe: Is it possible to display a WinForm in a WebForm? Pin
leppie25-Aug-03 7:03
leppie25-Aug-03 7:03 
GeneralDelete multiple instances of PictureBox Pin
Depesz24-Aug-03 4:09
Depesz24-Aug-03 4:09 
GeneralRe: Delete multiple instances of PictureBox Pin
A.Wegierski24-Aug-03 19:57
A.Wegierski24-Aug-03 19:57 
GeneralRe: Delete multiple instances of PictureBox Pin
Depesz25-Aug-03 0:14
Depesz25-Aug-03 0:14 
GeneralNew #dev available Pin
leppie24-Aug-03 3:59
leppie24-Aug-03 3:59 
GeneralRe: New #dev available Pin
leppie24-Aug-03 5:20
leppie24-Aug-03 5:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.