Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 [modifed] Pin
Matt U.20-May-10 16:58
Matt U.20-May-10 16:58 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 [modified] Pin
Luc Pattyn20-May-10 17:15
sitebuilderLuc Pattyn20-May-10 17:15 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.21-May-10 12:36
Matt U.21-May-10 12:36 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn21-May-10 13:03
sitebuilderLuc Pattyn21-May-10 13:03 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.21-May-10 17:14
Matt U.21-May-10 17:14 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn21-May-10 22:22
sitebuilderLuc Pattyn21-May-10 22:22 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.22-May-10 2:16
Matt U.22-May-10 2:16 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn22-May-10 2:49
sitebuilderLuc Pattyn22-May-10 2:49 
check for this pattern:

class Program {
    public static Main() {
        Application.Run(new MainForm());
    }
}

class MainForm {
    private int i=Globals.Value;  // touching the Globals class causes it to compile and initialize

    public MainForm() {
        MessageBox.Show("We never get here");
        ...
    }
    ...
}

class Globals {
    private static j=...;   <<<<<<<<<<<<<<<<<<<<<
    private static Globals() {
        ... <<<<<<<<<<<<<<<<<<<<<
    }
    public static int Value {
        get {
            ... <<<<<<<<<<<<<<<<<<<<<
        }
    }
}

All statements marked <<<<<<<<<<<<<<<<<<<<< will execute before you reach MessageBox.Show and could crash your app

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]

I only read formatted code with indentation, so please use PRE tags for code snippets.

I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).

GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 [modified] Pin
Matt U.22-May-10 7:28
Matt U.22-May-10 7:28 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.22-May-10 14:16
Matt U.22-May-10 14:16 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Luc Pattyn22-May-10 14:28
sitebuilderLuc Pattyn22-May-10 14:28 
GeneralRe: WinForms App Only Runs When Pressing F5 (Start Debugging) :: VS2008 & .NET 3.5 Pin
Matt U.20-May-10 14:58
Matt U.20-May-10 14:58 
QuestionHelp Re: DateTime and DayofWeek - Increasing DayofWeek Value Pin
roman_s20-May-10 7:45
roman_s20-May-10 7:45 
AnswerRe: Help Re: DateTime and DayofWeek - Increasing DayofWeek Value [modified] Pin
Luc Pattyn20-May-10 8:31
sitebuilderLuc Pattyn20-May-10 8:31 
QuestionZip files Pin
DinoRondelly20-May-10 6:36
DinoRondelly20-May-10 6:36 
AnswerRe: Zip files Pin
J4amieC20-May-10 6:45
J4amieC20-May-10 6:45 
AnswerRe: Zip files Pin
The Man from U.N.C.L.E.20-May-10 6:46
The Man from U.N.C.L.E.20-May-10 6:46 
GeneralRe: Zip files Pin
DinoRondelly20-May-10 7:06
DinoRondelly20-May-10 7:06 
AnswerRe: Zip files Pin
Hristo-Bojilov20-May-10 9:59
Hristo-Bojilov20-May-10 9:59 
Question.mov file writer Pin
c242320-May-10 5:28
c242320-May-10 5:28 
AnswerRe: .mov file writer Pin
Martin Jarvis20-May-10 6:57
Martin Jarvis20-May-10 6:57 
GeneralRe: .mov file writer Pin
c242320-May-10 7:46
c242320-May-10 7:46 
QuestionRetrieve data (using query) from a Access database Pin
Chiman120-May-10 4:29
Chiman120-May-10 4:29 
AnswerRe: Retrieve data (using query) from a Access database Pin
Andy_L_J20-May-10 4:40
Andy_L_J20-May-10 4:40 
AnswerRe: Retrieve data (using query) from a Access database Pin
Abhinav S20-May-10 4:43
Abhinav S20-May-10 4:43 

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.