System.Diagnostics.Debug.Assert

Posted on March 28, 2009. Filed under: .NET, best practice, C#, programming | Tags: , , |

Checks for a condition and displays a message if the condition is false.
Assert(Boolean) Checks for a condition and outputs the call stack if the condition is false.
Refer: http://msdn.microsoft.com/en-us/library/system.diagnostics.debug.assert.aspx

One advantage of Debug.Assert() is that the C# and VB compilers (not C++) eliminate the Debug.Assert() statement from the CIL code when the DEBUG precompile constant is not defined.
Refer: http://mark.michaelis.net/Blog/DontUseTheSystemDiagnosticsAssertMethodsUnless.aspx

Dont use it in production / release code.


Read Full Post | Make a Comment ( None so far )

Recently on .NET Programming Tips and Tricks…

Exporting Data: Creating XML Files using C#

Posted on August 19, 2008. Filed under: .NET, ASP.NET, C#, programming, XML, XSD | Tags: , , , , |

Getting Started With ASP.NET AJAX

Posted on July 28, 2008. Filed under: programming, Uncategorized | Tags: , |

ASP.NET 2.0: Populating a Datalist using a T-SQL Stored Procedure & Datalist Custom Paging

Posted on July 21, 2008. Filed under: .NET | Tags: , |

    About

    My stuff about .NET, C#, ASP.NET, AJAX, Visual Studio, SQL Server, XML, Web Services, WCF, WPF, WF, CRM, etc.

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • The latest comments to all posts in RSS

    Meta

Liked it here?
Why not try sites on the blogroll...

Create your own website, free on WordPress.com.Create your own website.
Start free