1Imports System.Runtime.CompilerServices 2Imports System.Reflection 3 4<Assembly: RuntimeCompatibility(WrapNonExceptionThrows:=True)> 5 6Class Attribute3 7 Shared Function Main() As Integer 8 Dim attr As RuntimeCompatibilityAttribute 9 Dim a As Assembly = Assembly.GetExecutingAssembly 10 11 If a.IsDefined(GetType(RuntimeCompatibilityAttribute), False) = False Then 12 Return 1 13 End If 14 15 attr = TryCast(a.GetCustomAttributes(GetType(RuntimeCompatibilityAttribute), False)(0), RuntimeCompatibilityAttribute) 16 17 If attr Is Nothing Then 18 Return 2 19 End If 20 21 If attr.WrapNonExceptionThrows = False Then 22 Return 3 23 End If 24 25 Return 0 26 End Function 27End Class