Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Friday, 18 February 2011

Static fields...

It took me almost 1 day to fix a very stupid problem:

My program is working on my machine while it doesn't work on my friend's machine and other remote desktops.
I added try n catch, extra logging, nothing works.


The system always dies straight away and ask me to report to MS. I even tried to comment out everything in my main method....

after nearly 1 day of investigation, it turns out that one of my reference is not "copy to local" !!! and this thing is a static variable which is initilized before the main!!!

Friday, 16 July 2010

C# Performance

Little notes on C# performance
  • For loop > Foreach
  • TryGetValue > if(variable.Contains(key)) variable[key]