Tuesday, May 27, 2014

When attempting to use an out parameter in a C# method which is a list of T...

...you may get this:

Out parameter 'yourNameHere' might not be initialized before accessing

 
 

...when you mouse over all references to the variable in Visual Studio which now have squiggly red lines under them. The way to beat this is to use ref in lieu of out.

No comments:

Post a Comment