views:

195

answers:

4

Hi guys, i'm having a problem when i try to host my website on godaddy. This is what i receive from website:

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

To discover the problem, i've tried changin my web.config, adding "trust level='Medium'". But i get an error when i try to access godaddy mysql server with the mysql connector.

Any ideas ? Thanks in advance !

+1  A: 

You're trying to do something that GoDaddy has limited you from doing (you're running in a partial trust environment).

You need to figure out WHAT code is causing this error. Once you've done this, you have two choices:

1) Don't do it

-or-

2) Get a new host that allows you to run in full trust (such as a virtual server)

Will
A: 

If you're using System.Reflection, that can cause it.

derek
mmm, no, i'm not using it.I know i'm using mysqlconnector.. maybe it can cause security exception ?
stighy
here's GoDaddy's info on medium trust: http://help.godaddy.com/article/1039
derek
this is interesting... so i suppose the problem could be related to the mysqlconnector ..
stighy
check some of the open-source platforms such as mojoportal and blogengine.net. They have 2 web.configs, 1 for medium trust, and 1 for full trust. Might be of interest to see what the difference is between them. fyi, I have used MySqlConnector on GoDaddy with no issues, maybe there's a setting on it that may need to change though.
derek
A: 

Ok, i found the solutions. http://help.godaddy.com/article/1496 It was related the mysql connector ! Damn it (godaddy :( ) i spent 1 day look at the solutions !

stighy
A: 

For anyone having this problem I've put together an article outlining the issues I had and how I got around them. I also explain how to use Entity Framework in .NET 4 with MySQL in a medium trusted environment. You can find the article here: http://inknowledge.co.uk/News/2010/09/mysql-net-4-entity-framework-and-medium-trust-hosting-environments/

Ricky Brundritt