Click here to Skip to main content
15,892,927 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Pete O'Hanlon13-Nov-14 4:49
mvePete O'Hanlon13-Nov-14 4:49 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
AnswerRe: C# FormatCurrency(VB) to ToString PinPopular
Dave Kreskowiak12-Nov-14 11:13
mveDave Kreskowiak12-Nov-14 11:13 
GeneralRe: C# FormatCurrency(VB) to ToString Pin
Bernhard Hiller12-Nov-14 21:15
Bernhard Hiller12-Nov-14 21:15 
AnswerRe: C# FormatCurrency(VB) to ToString Pin
Dominic Burford13-Nov-14 5:34
professionalDominic Burford13-Nov-14 5:34 
QuestionStrange thing with AsemblyResolve event Pin
Marcos Bischoff12-Nov-14 4:28
Marcos Bischoff12-Nov-14 4:28 
AnswerRe: Strange thing with AsemblyResolve event Pin
Eddy Vluggen12-Nov-14 8:05
professionalEddy Vluggen12-Nov-14 8:05 
AnswerRe: Strange thing with AsemblyResolve event Pin
Freak3013-Nov-14 1:11
Freak3013-Nov-14 1:11 
I once had a very similar problem. I was using something like this.
C#
Thread worker = null;
try
{
    new Thread(new ThreadStart(threadFunc));
}
catch (Exception)
{
    // error handling
}
.
.
.
void threadFunc()
{
    try
    {
         // do something.
    }
    catch (Exception)
    {
         // error handling
    }
}

The damn thing kept crashing on me in spite of the try/catch. I finally found out, that an assembly was missing that was referenced in threadFunc. So the Framework tried to load the assembly when inspecting the function, and that was already in the new thread (so the try in the main thread didn't work) but outside of my code.

The solution was to use an intermediate function (with a try/catch inside) similar to the way you are doing it with your ConsoleCrap class. So the lesson learned was: Don't put anything that can crash on load in a function that is directly called by the framework.
The good thing about pessimism is, that you are always either right or pleasently surprised.

QuestionQuick Loading of WPF application Pin
teek1312-Nov-14 2:42
teek1312-Nov-14 2:42 
AnswerRe: Quick Loading of WPF application Pin
SledgeHammer0112-Nov-14 5:04
SledgeHammer0112-Nov-14 5:04 
GeneralRe: Quick Loading of WPF application Pin
teek1312-Nov-14 8:32
teek1312-Nov-14 8:32 
GeneralRe: Quick Loading of WPF application Pin
SledgeHammer0112-Nov-14 8:59
SledgeHammer0112-Nov-14 8:59 
GeneralRe: Quick Loading of WPF application Pin
Eddy Vluggen12-Nov-14 9:15
professionalEddy Vluggen12-Nov-14 9:15 
GeneralRe: Quick Loading of WPF application Pin
teek1312-Nov-14 19:04
teek1312-Nov-14 19:04 
GeneralRe: Quick Loading of WPF application Pin
SledgeHammer0112-Nov-14 19:21
SledgeHammer0112-Nov-14 19:21 
GeneralRe: Quick Loading of WPF application Pin
teek1313-Nov-14 0:11
teek1313-Nov-14 0:11 
GeneralRe: Quick Loading of WPF application Pin
SledgeHammer0113-Nov-14 6:55
SledgeHammer0113-Nov-14 6:55 
GeneralRe: Quick Loading of WPF application Pin
teek1313-Nov-14 7:22
teek1313-Nov-14 7:22 
GeneralRe: Quick Loading of WPF application Pin
SledgeHammer0113-Nov-14 9:12
SledgeHammer0113-Nov-14 9:12 
AnswerRe: Quick Loading of WPF application Pin
Eddy Vluggen12-Nov-14 8:04
professionalEddy Vluggen12-Nov-14 8:04 
GeneralRe: Quick Loading of WPF application Pin
teek1312-Nov-14 8:40
teek1312-Nov-14 8:40 
GeneralRe: Quick Loading of WPF application Pin
Eddy Vluggen12-Nov-14 9:14
professionalEddy Vluggen12-Nov-14 9:14 
AnswerRe: Quick Loading of WPF application Pin
Pete O'Hanlon12-Nov-14 9:43
mvePete O'Hanlon12-Nov-14 9:43 
AnswerRe: Quick Loading of WPF application Pin
NickPace12-Nov-14 10:45
NickPace12-Nov-14 10:45 
GeneralRe: Quick Loading of WPF application Pin
teek1312-Nov-14 19:20
teek1312-Nov-14 19: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.