When you application requires Full Trust permission and your hosting provider provider doesn’t offer Full Trust permission, then your application won’t work. This is an error message that you might find if your hosting provider doesn’t support Full Trust

“The System.SecurityException error occurs when a SocketTools .NET component is used with an ASP.NET application, displaying the error message: The application attempted to perform an operation not allowed by the security policy.”

More Information

This error indicates that the server is not configured for full trust. The SocketTools .NET components require unrestricted access to specific system resources such as the networking subsystem and system registry. To grant full trust to your ASP.NET application, you need to modify the web.config file to include the following:

<location allowOverride="true">
  <system.web>
    <trust level="Full" originUrl=".*"/>
  </system.web>
</location>

Note that setting the code access security level to full trust enables the application to call native code, access system services, open database connections and access the registry and modify files outside of the server’s virtual directory.

If your hosting provider doesn’t provide full trust, then above code won’t work too. So, you need to find hosting provider that support Full Trust.