Exemple #1
0
 public void Init(HttpApplication app)
 {
     if (WasCompiledInDebugMode(app))
     {
         if (Interlocked.Exchange(ref _hasCreatedChannel, 1) == 0)
         {
             // Start listening for connections
             RemotingConfiguration.RegisterWellKnownServiceType(typeof(DeleporterService), NetworkConfiguration.ServiceName, WellKnownObjectMode.Singleton);
             _remotingChannel = NetworkConfiguration.CreateChannel();
             ChannelServices.RegisterChannel(_remotingChannel, false);
         }
     }
     else
     {
         throw new InvalidOperationException("You should not enable Deleporter on production web servers. As a security precaution, Deleporter won't run if your ASP.NET application was compiled in Release mode. You need to remove DeleporterServerModule from your Web.config file. If you need to bypass this, the only way is to edit the Deleporter source code and remove this check.");
     }
 }