"Recently, I inherited an ASP.NET web application that hadn't been touched in many a year," wrote Scott Schottler, "I was pleasantly surprised to see that, not only did it successfully convert from a Visual Studio 2003 project, but that it actually built without errors."

"Of course, my excitement soon waned when I looked into the code. Now we've all seen the Try-Catch-Gulp pattern, but this is ridiculous."

Public Function GetDAO(ByVal typeName As String) As Object
    Try
        Return Activator.CreateInstance(System.Type.GetType(typeName, True, True))
    Catch ex As ArgumentNullException
        Throw
    Catch ex As ArgumentException
        Throw
    Catch ex As NotSupportedException
        Throw
    Catch ex As Reflection.TargetInvocationException
        Throw
    Catch ex As MethodAccessException
        Throw
    Catch ex As MemberAccessException
        Throw
    Catch ex As Runtime.InteropServices.InvalidComObjectException
        Throw
    Catch ex As Runtime.InteropServices.COMException
        Throw
    Catch ex As TypeLoadException
        Throw
    End Try
End Function
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!