Author: EnzoCity | Posted on: 10/19/2009 2:03:20 AM | Views : 348

 I have a Function I use that builds an html formatted email to send error reports.  Using VS 2005 I get a warning:
Function 'BuildMessage' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
Is there a way to correct this warning?
Here's my "BuildMessage" Function:
Function BuildMessage() As String Dim strMessage As New StringBuilder strMessage.Append("<style type=""text/css"">") strMessage.Append("<!--") strMessage.Append(".basix {") strMessage.Append("font-family: Verdana, Arial, Helvetica, sans-serif;") strMessage.Append("font-size: 12px;") strMessage.Append("}") strMessage.Append(".header1 {") ...

Go to the complete details ...