Ciao a tutti,
Ho sviluppato un sito che utilizza il server aruba con un database mysql.
Il sito è sviluppato con ASP.NET 2.0 e il web.config è impostato per utilizzare un porvider per MySQL. Ma quando utilizzo gli elementi(Login e CreateUserWizard) che adoperano questo provider, la quale dll e sorgenti sono stati scaricati, ho l'errore di 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.Diagnostics.EventLogPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Ho provato ricompilando i file sorgenti mettendo sul file AssemblyInfo.cs l'AllowPartiallyTrustedCallers in questo modo:
[assembly: AllowPartiallyTrustedCallers()]
Aggiunto il riferimento sul progetto del sito, l'ho pubblicato con la relativa funzione di visual studio.
web.config:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<pages theme="Black"/>
<authorization>
<allow users="?"/>
</authorization>
<compilation debug="true">
<assemblies>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<customErrors mode="Off">
<error statusCode="403" redirect="NoAccess.htm"/>
<error statusCode="404" redirect="FileNotFound.htm"/>
</customErrors>
<siteMap defaultProvider="siteMapProvider" enabled="true">
<providers>
<clear/>
<add name="siteMapProvider" type="Simple.Providers.MySQL.MysqlSiteMapProvider" connectionStringName="SimpleProviderConnectionString" applicationName="WebSiteArancioblu" description="MySQL site map provider" securityTrimmingEnabled="true"/>
</providers>
</siteMap>
<roleManager defaultProvider="roleProvider" enabled="true" cacheRolesInCookie="false" cookieName=".ASPROLES" cookieTimeout="7200" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<clear/>
<add name="roleProvider" type="Simple.Providers.MySQL.MysqlRoleProvider" connectionStringName="SimpleProviderConnectionString" applicationName="WebSiteArancioblu" description="MySQL role provider"/>
</providers>
</roleManager>
<membership defaultProvider="membershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="membershipProvider" type="Simple.Providers.MySQL.MysqlMembershipProvider" connectionStringName="SimpleProviderConnectionString" applicationName="WebSiteArancioblu" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="true" passwordFormat="Clear" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" description="MySQL membership provider"/>
</providers>
</membership>
<profile defaultProvider="profileProvider" automaticSaveEnabled="true">
<providers>
<clear/>
<add name="profileProvider" type="Simple.Providers.MySQL.MysqlProfileProvider" connectionStringName="SimpleProviderConnectionString" applicationName="WebSiteArancioblu" description="MySQL Profile Provider"/>
</providers>
<properties>
<clear/>
</properties>
</profile>
<webParts>
<personalization defaultProvider="personalizationProvider">
<providers>
<clear/>
<add name="personalizationProvider" type="Simple.Providers.MySQL.MysqlPersonalizationProvider" connectionStringName="SimpleProviderConnectionString" applicationName="WebSiteArancioblu" description="MySQL Personalization Provider"/>
</providers>
</personalization>
</webParts>
</system.web>
<system.codedom>
</system.codedom>
<connectionStrings>
<add connectionString="Driver={MySQL ODBC 3.51 Driver};server=62.149.150.75;port=3306;option=3;database=Sqlxxxxx_1;uid=xxxxxx;pwd=xxxxxxx" name="SimpleProviderConnectionString" providerName="System.Data.Odbc"/>
</connectionStrings>
<system.webServer>
</system.webServer>
</configuration>
Grazie dell'attenzione
Modificato da T0nY89 il 17 settembre 2008 11.09 -
Modificato da T0nY89 il 17 settembre 2008 15.13 -