Connector 6.0.4 - Profile Provider exception with DLL into BIN folder
Posted by: Marco Cianciaruso
Date: July 23, 2009 09:26AM

Hi to all

I have a problem that happen on two different production server(win 2003), where the Connector 6.0.4 is not installed but for each website I upload into BIN folder the needed DLL. My development PC and the both server run in MediumTrust level with the same configuration file.


On development machine is installed the Connector 6.0.4 and I defined all needed for membership, role, profile providers into website WEB.CONFIG in the following way simply copy and past from MACHINE.CONFIG

<connectionStrings>
<remove name="LocalMySqlServer"/>
<add name="LocalMySqlServer" connectionString="server=myserver;user id=myID;password=myPASS;database=myDB;port=3306;pooling=false"/>
</connectionStrings>

..
..
..


<system.data>
<DbProviderFactories>
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>

<system.web>
<membership defaultProvider="MySQLMembershipProvider">
<providers>
<remove name="MySQLMembershipProvider"/>
<add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" applicationName="/" passwordFormat="Hashed" maxInvalidPasswordAttempts="4" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" autogenerateschema="true" />
</providers>
</membership>
<roleManager defaultProvider="MySQLRoleProvider" enabled="true">
<providers>
<remove name="MySQLRoleProvider"/>
<add name="MySQLRoleProvider" type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/"/>
</providers>
</roleManager>
<profile defaultProvider="MySQLProfileProvider" enabled="true">
<properties>
<add name="AdminInfo" type="myNamespace.AdminProfile" serializeAs="Xml"/>
</properties>
<providers>
<remove name="MySQLProfileProvider"/>
<add name="MySQLProfileProvider" type="MySql.Web.Profile.MySQLProfileProvider, MySql.Web, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" connectionStringName="LocalMySqlServer" applicationName="/"/>
</providers>
</profile>

..
..
..

<system.web>



And all work perfectly, I able to use all the features of Memebership provider, I'm able alto to create and delete user, and like you see in my web.config I use also a property named "AdminInfo" where I save all that I need, and all is registered into my_aspnet_profiles table.

namespace myNamespace

<Serializable()> _
Public Class AdminProfile

Public FullDirAccess As Boolean
Public ExpirationPassword As Date

End Class

End Namespace



Assuming that all this work perfectly on my dev PC, an issue appear when I publish my website into Win2003 server where the connector is not installed and I put all the DLL into BIN folder.

I have made simple test.aspx with only the following code:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Response.Write(Profile.AdminInfo.FullDirAccess)

End Sub


On the Server run without problem only If i'm anonymous(i think because an AdminInfo is not instaciated), if I'm authenticated this exception is throw:


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.


Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
MySql.Web.Profile.MySQLProfileProvider.DecodeProfileData(DataRow profileRow, SettingsPropertyValueCollection values) +0
MySql.Web.Profile.MySQLProfileProvider.GetPropertyValues(SettingsContext context, SettingsPropertyCollection collection) +656





One of both Win2003 server is in my internal LAN and I made the following test:
- Installed the connector to check if with the DLL into GAC the issue was still present. Like my previsions once the Connector was installed on the server the problem was disappeared. Unistalling it is comed again.



If I try to read, for example, Profile.isDirty no problem appear. Only if I try to read my common property I have this problem.

I think it's a bug... I tested using Hight Trust level, without result, only Full Trust work without problem.
I tried the 6.1.0.0 too, but the same issue was happen.

-----------------------------
Marco
using Visual Studio 2008



Edited 1 time(s). Last edit at 07/23/2009 09:39AM by Marco Cianciaruso.

Options: ReplyQuote


Subject
Written By
Posted
Connector 6.0.4 - Profile Provider exception with DLL into BIN folder
July 23, 2009 09:26AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.