Ciao a tutti,
sto realizzando un applicazione web con il framework asp.net, con la quale in alcune pagine visualizzo mediante gridview dei records di alcune tabelle presenti in un db mysql il tutto su aruba. Ora ho il problema che una volta caricata l'applicazione sul dominio, le pagine che tentano di connettersi al db restituiscono il seguente errore:
Da quello che mi è sembrato di capire da una piccola ricerca su internet è che aruba usa un livello di trust medium, mentre per poter usare la libreria mysql(ho installato i connector/Net ufficiali e salvo la dll MySql.Data.dll in bin), ho bisogno di un livello di trust full.codice:Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Source Error:Stack Trace:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
[SecurityException: Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0 System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31 System.Security.CodeAccessPermission.Demand() +46 System.Environment.GetEnvironmentVariable(String variable) +66 MySql.Data.MySqlClient.MySqlConnectAttrs.Is64BitOS() +13 MySql.Data.MySqlClient.MySqlConnectAttrs.get_Platform() +5
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34274
Altra cosa che mi sembra di aver capito è che io attraverso l'applicazione non possa operare una modifica al level trust, ma sempre su internet ho anche letto che se possibile sarebbe meglio nn usare un server full trust.
A questo punto vi chiedo se è possibile usare mysql con aruba in medium trust, e se si, se potete spiegarmi in maniera chiara il modo.
Grazie a tutti per le eventuali risposte.
Cordiali Saluti,
Lorenzo

Rispondi quotando