Connection Error C # PostGree - Locaweb [duplicate]

1

I have a webservice consuming postgreesql data and when I try to connect to the base after posting. The host I'm trying to use: "serveripanema.no-ip.info"

  

Npgsql.NpgsqlException: Failed to establish a connection             to '177.195.43.242'. --- >             System.Security.SecurityException: Request for the             permission of type 'System.Net.SocketPermission, failed.

I got in touch with locaweb and for surprise they did the test in php and it worked:

   <?php
    if(!@($conexao=pg_connect ("host=177.193.40.222 
     dbname=bdteste port=5438   user=admin password=xxxxx"))) {
     print "Não foi possível estabelecer uma conexão com o banco de dados.";
     } else {
     pg_close ($conexao);
     print "Conexão OK!"; 
     }
   ?>

Has anyone ever been through this?

    
asked by anonymous 04.04.2017 / 23:03

1 answer

4

You need to have the application's TrustLevel as FullTrust to run NpgsqlException .

Locaweb does not allow applications using FullTrust .

Solution : Change the provider or hosting.

    
04.04.2017 / 23:07