Imports System.Web Imports System.Reflection Public Class GlobalBase Inherits System.Web.HttpApplication Private oApp As App = Nothing Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs) End Sub Sub Application_Start() RegisterSoapExtension(GetType(TraceExtension), 1, 0) End Sub Sub Application_End() End Sub <System.Security.Permissions.ReflectionPermission(System.Security.Permissions.SecurityAction.Demand, Unrestricted:=True)> _ Public Shared Sub RegisterSoapExtension(type As Type, priority As Integer, group As System.Web.Services.Configuration.PriorityGroup) End Sub End ClassHow can I make sure the Application_Start() will only execute RegisterSoapExtension() when I am running under a Web Service? Because I assume this will conflict if being run under a Web site or will be useless.