Inquiridor
Problema com conexão mysql (Request for the permission of type '...' failed.)

Pergunta
-
Desenvolvi um site e repentinamente ele começou a apresentar o seguinte erro
Request for the permission of type 'MySql.Data.MySqlClient.MySqlClientPermission, MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' failed.
Entrei em contato com a empresa de hospedagem e me falaram sobre que eu deveria definir trust level mas não consegui fazer a alteração para Medium
agradeço desde já qualquer ajuda
Obrigado
-------------------------------------- Se a resposta for útil marque como resposta
- Movido AndreAlvesLima sexta-feira, 6 de julho de 2012 12:24 (De:.NET Development - Geral)
Todas as Respostas
-
Amigo, tente adicionar a seguinte tag ao seu web.config
<system.web> <trust level="Medium" /> </system.web>
http://msdn.microsoft.com/pt-br/library/tkscy493.aspx
Olavo Oliveira Neto
http://olavooneto.wordpress.com
Twitter @Olavooneto
Facebook Olavo Neto
Linkedin Olavo Neto
Se for útil marque como resposta e faça um Developer feliz :) -
Prezado(a),
Estou migrando seu post para o fórum de Desenvolvimento Web Geral.
Por favor, das próximas vezes que tiver alguma dúvida relacionada a esse assunto, poste por lá.
Obrigado.André Alves de Lima
Microsoft MVP - Client App Dev
Visite o meu site: http://www.andrealveslima.com.br
Me siga no Twitter: @andrealveslima -
Quando eu insiro esta tag no meu web.config ele me retorna o seguinte erro:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using <location allowOverride="false"> from an inherited configuration file.
Source Error:Line 51: Line 52: <system.web> Line 53: <trust level="Medium" /> Line 54: </system.web> Line 55:
Juan Nogueira www.juannogueira.com.br Se foi útil, marque como resposta!
-
adicione apenas o <trust level="Medium" /> dentro da tag <System.Web> existente no Web.config.
Sendo que pode ser problema com sua versão do mysql.data.dll.
Não esqueça de marcar o post como útil caso tenha te ajudado.
- Editado Marco Souza terça-feira, 10 de julho de 2012 15:14