c# - Entity Framework with MySQL throwing exception when deployed to a hosted environment -


i have deployed asp.net application uses: .net 4,5 entity framework 6.1.3 mysql.data 6.9.8 mysql.data.entity 6.9.8

it works correctly in development environment.

i getting following error message when access database.

the type initializer 'mysql.data.mysqlclient.mysqlclientfactory' threw exception.

system.security.securityexception: system.security.permissions.securitypermission @ mysql.data.mysqlclient.mysqlclientfactory..cctor()

the type of first permission failed was: system.security.permissions.securitypermission

the zone of assembly failed was: mycomputer

if access hosted mysql database iis server on local computer works correctly.

i have tried/checked:

  • ensuring dlls have copylocal set true
  • adding trust level setting web.config; caused application fail on hosted server
  • i have latest version of mysql dlls
  • used google
  • raised support issue hosting company , searched faqs

how can resolve problem?

it may helpful let people know hosting provider using - have experienced similar issues themselves.

some hosting providers picky particular config settings, example trust settings mentioned.

some hosting providers provide quick assistance customers - issue lot of new customers face, , if cover how resolve in faq/help section. if isn't covered in faq/help section customer support may able provide assistance.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -