En utilisant VS 2010 MVC3, j'ai configuré le fichier web.config pour me connecter à ma base de données distante. Quand je débogue ses courses ok, enregistre, se connecte bien. Mais quand je le télécharger à l'hôte que je reçois cette erreur:Exception de sécurité sur le framework .NET asp 4 utilisant MySQL, niveau de confiance: Moyen
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.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
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.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
MySql.Data.MySqlClient.MySqlConnectionStringBuilder.CreatePermissionSet() +0 MySql.Data.MySqlClient.MySqlConnectionStringBuilder.DemandPermissions() +38 MySql.Data.MySqlClient.MySqlConnection.PermissionDemand() +94 MySql.Data.MySqlClient.MySqlConnection.Open() +196
MySql.Web.Common.SchemaManager.GetSchemaVersion(String connectionString) +65
MySql.Web.Common.SchemaManager.CheckSchema(String connectionString, NameValueCollection config) +39
MySql.Web.Security.MySQLRoleProvider.Initialize(String name, NameValueCollection config) +462
System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) +419
Im en utilisant MySQL Connector Net 6.5.4
Que diriez-vous du problème [System.Security.Permissions.SecurityPermission, mscorlib] (http://forums.codeguru.com/showthread.php?t=449172). Semble être le même problème en raison des autorisations sur les niveaux de confiance dans l'hôte. Est-ce un hôte partagé? – matthewnreid
Oui tristement C'est –
Avez-vous résolu ceci? – rcdmk