Click here to Skip to main content
15,898,945 members
Home / Discussions / C#
   

C#

 
AnswerRe: Error-Object reference not set to an instance of an object Pin
Alaric_29-Nov-07 8:19
professionalAlaric_29-Nov-07 8:19 
QuestionRe: Error-Object reference not set to an instance of an object Pin
T4AMD29-Nov-07 8:33
T4AMD29-Nov-07 8:33 
AnswerRe: Error-Object reference not set to an instance of an object Pin
Luc Pattyn29-Nov-07 8:46
sitebuilderLuc Pattyn29-Nov-07 8:46 
GeneralRe: Error-Object reference not set to an instance of an object Pin
T4AMD29-Nov-07 8:55
T4AMD29-Nov-07 8:55 
Questionremoving comments from xml strings Pin
AndrusM29-Nov-07 7:29
AndrusM29-Nov-07 7:29 
AnswerRe: removing comments from xml strings Pin
Dave Kreskowiak29-Nov-07 9:27
mveDave Kreskowiak29-Nov-07 9:27 
GeneralRe: removing comments from xml strings Pin
AndrusM29-Nov-07 22:13
AndrusM29-Nov-07 22:13 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak30-Nov-07 2:32
mveDave Kreskowiak30-Nov-07 2:32 
AndrusM wrote:
You wrote that this code modifies same collection inside foreach loop which is not allowed.
.NET does not throw exception for this code.
So it is .NET bug, isn't it ?


No, it's not a compile time error. There is no way for the compiler to know that the method called "Remove" removes items from the collection. You could call the very same method "Jaxtapose". The name of the method doesn't tell the compiler anything other than "this is a name". The compiler cannot tell what the code inside the method does.

It WILL throw a run-time exception though.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


GeneralRe: removing comments from xml strings Pin
AndrusM30-Nov-07 3:02
AndrusM30-Nov-07 3:02 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak30-Nov-07 16:12
mveDave Kreskowiak30-Nov-07 16:12 
GeneralRe: removing comments from xml strings Pin
AndrusM1-Dec-07 6:32
AndrusM1-Dec-07 6:32 
GeneralRe: removing comments from xml strings Pin
PIEBALDconsult1-Dec-07 8:31
mvePIEBALDconsult1-Dec-07 8:31 
GeneralRe: removing comments from xml strings Pin
Dave Kreskowiak1-Dec-07 12:41
mveDave Kreskowiak1-Dec-07 12:41 
QuestionStrange frequency readings Pin
Guybrush8629-Nov-07 7:19
Guybrush8629-Nov-07 7:19 
AnswerApply a frequency filter Pin
Ennis Ray Lynch, Jr.29-Nov-07 8:01
Ennis Ray Lynch, Jr.29-Nov-07 8:01 
AnswerRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 9:12
sitebuilderLuc Pattyn29-Nov-07 9:12 
AnswerRe: Strange frequency readings Pin
leppie29-Nov-07 9:54
leppie29-Nov-07 9:54 
GeneralRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 9:59
sitebuilderLuc Pattyn29-Nov-07 9:59 
GeneralRe: Strange frequency readings Pin
leppie29-Nov-07 10:17
leppie29-Nov-07 10:17 
GeneralRe: Strange frequency readings Pin
Luc Pattyn29-Nov-07 11:16
sitebuilderLuc Pattyn29-Nov-07 11:16 
GeneralRe: Strange frequency readings Pin
Big Daddy Farang29-Nov-07 12:26
Big Daddy Farang29-Nov-07 12:26 
Questionclickonce error Pin
arkiboys29-Nov-07 6:58
arkiboys29-Nov-07 6:58 
QuestionLINQ to SQL Question Pin
Philip Laureano29-Nov-07 5:38
Philip Laureano29-Nov-07 5:38 
GeneralRe: LINQ to SQL Question Pin
Sam Xavier18-Jan-08 0:02
Sam Xavier18-Jan-08 0:02 
QuestionBase 2 Log Method Pin
Skippums29-Nov-07 5:26
Skippums29-Nov-07 5:26 

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.