Shared Hosting Providers - Trust Levels - Non-direct Mode
Shared Hosting Providers - Trust Levels - Non-direct Mode
I'm in a frustrating position where I'm not able to use the MySQLDirect provider in ASP.NET 2.0 on a shared hosting server because they only allows "medium" trust.
After many emails and telephone calls, it is clear that I will have to revert to using non-direct mode because they just wont budge.
Can anyone give me an example of how to use non-direct mode to connect to the MySQL database plse?
Thanks in advance
Leon
After many emails and telephone calls, it is clear that I will have to revert to using non-direct mode because they just wont budge.
Can anyone give me an example of how to use non-direct mode to connect to the MySQL database plse?
Thanks in advance
Leon
Even though I have Direct=false set, I still get the following security exception (connstring included below):
Server Error in '/' Application.
--------------------------------------------------------------------------------
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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr) +1642820
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseArray(ParseRecord pr) +847
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) +76
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) +64
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum binaryHeaderEnum) +1127
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +186
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) +12
CoreLab.Common.aq.a(Stream A_0, String A_1, String A_2, String& A_3) +137
CoreLab.Common.aq.a(Type A_0, String& A_1, Assembly& A_2) +974
CoreLab.Common.aq.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4) +41
CoreLab.Common.aq.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3) +1261
CoreLab.MySql.MySqlConnection.Open() +98
CoreLab.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +452
Server Error in '/' Application.
--------------------------------------------------------------------------------
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=2.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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Runtime.Serialization.Formatters.Binary.ObjectReader.CheckSecurity(ParseRecord pr) +1642820
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseArray(ParseRecord pr) +847
System.Runtime.Serialization.Formatters.Binary.ObjectReader.ParseObject(ParseRecord pr) +76
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Parse(ParseRecord pr) +64
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum binaryHeaderEnum) +1127
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +186
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream) +12
CoreLab.Common.aq.a(Stream A_0, String A_1, String A_2, String& A_3) +137
CoreLab.Common.aq.a(Type A_0, String& A_1, Assembly& A_2) +974
CoreLab.Common.aq.a(LicenseContext A_0, Type A_1, String& A_2, Boolean& A_3, String& A_4) +41
CoreLab.Common.aq.a(LicenseContext A_0, Type A_1, Object A_2, Boolean A_3) +1261
CoreLab.MySql.MySqlConnection.Open() +98
CoreLab.Common.Web.Providers.DbProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection properties) +452
What version of MySQLDirect do you use?
We can't reproduce any error.
Seemingly there is a difference in our config files. Try to check record in web.config file that level="Medium":
and maybe web_mediumtrust.config differs from default.
Send this file (web_mediumtrust.config) to the address provided in the Readme file.
We can't reproduce any error.
Seemingly there is a difference in our config files. Try to check record in web.config file that level="Medium":
Code: Select all
Send this file (web_mediumtrust.config) to the address provided in the Readme file.