[Mono-aspnet-list] Could not find type: MySql.Web.Security.MySQLRoleProvider

ajwtech ajwtech at gmail.com
Mon Feb 28 18:40:37 EST 2011


I am doing my first port to mono from asp.net. I am working with a web site
developed by a coworker trying to integrate the site into a VMWare image we
are packaging for customers. The site connects to an external MSSQL Server
database and I want to port this to our MySql instance running on the VM
image. 

I have registered the MySql dll's downloaded from the MySql site.
I am running the latest version of Mono:

Mono JIT compiler version 2.10 (tarball Tue Feb 15 04:36:31 UTC 2011)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none
        Misc:          debugger softdebug 
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)



Here is the error I get:

System.Configuration.ConfigurationErrorsException: Could not find type:
MySql.Web.Security.MySQLRoleProvider, mysql.web
  at System.Web.Configuration.ProvidersHelper.InstantiateProvider
(System.Configuration.ProviderSettings providerSettings, System.Type
providerType) [0x00072] in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs:64 
  at System.Web.Configuration.ProvidersHelper.InstantiateProviders
(System.Configuration.ProviderSettingsCollection configProviders,
System.Configuration.Provider.ProviderCollection providers, System.Type
providerType) [0x0003e] in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/System.Web/System.Web.Configuration_2.0/ProvidersHelper.cs:72 
  at System.Web.Security.Roles.get_Providers () [0x00015] in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/System.Web/System.Web.Security/Roles.cs:260 
  at System.Web.Security.Roles.get_Provider () [0x00000] in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/System.Web/System.Web.Security/Roles.cs:248 
  at System.Web.Security.Roles.RoleExists (System.String rolename) [0x00000]
in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/System.Web/System.Web.Security/Roles.cs:188 
  at ASP.global_asax.Application_Start (System.Object sender,
System.EventArgs e) [0x0000a] in /usr/local/TimeTracker/Global.asax:14 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x000d0] in
/usr/src/redhat/BUILD/mono-2.10/mcs/class/corlib/System.Reflection/MonoMethod.cs:226 

Here is my web.config

<?xml version="1.0"?>
<configuration>
	<connectionStrings>
		<add name="TimeTrackerConnectionString1"
			connectionString="Data Source=localhost;user
id=REMOVED;password=REMOVED;database=REMOVED;"
			providerName="MySql.Data.MySqlClient"/>
	</connectionStrings>
	<system.web>
		<authentication mode="Forms">
			<forms
			  loginUrl="~/TimeTracker/login.aspx"
			  
			  timeout="30"
			  name=".ASPXFORM$"
			  path="/"
			  requireSSL="false"
			  slidingExpiration="true"
			  defaultUrl="Default.aspx"
			  
			  enableCrossAppRedirects="false"/>
		</authentication>

		<membership defaultProvider="MySqlMembershipProvider">
			<providers>
				<clear/>
				<add name="MySqlMembershipProvider"
					  type="MySql.Web.Security.MySQLMembershipProvider, mysql.web"
						connectionStringName="MySqlMembershipConnection"
						enablePasswordRetrieval="false"
						enablePasswordReset="true"
						requiresQuestionAndAnswer="false"
						requiresUniqueEmail="true"
						passwordFormat="Clear"
						maxInvalidPasswordAttempts="5"
						minRequiredPasswordLength="6"
						minRequiredNonalphanumericCharacters="0"
						passwordAttemptWindow="10"
						
						applicationName="/time"
						autogenerateschema="true"/>
			</providers>
		</membership>

		<roleManager enabled="true" defaultProvider="MySqlRoleProvider">
			<providers>
				<clear />
				<add connectionStringName="MySqlMembershipConnection"
					applicationName="/time"
					name="MySqlRoleProvider"
					type="MySql.Web.Security.MySQLRoleProvider, mysql.web"
					autogenerateschema="true"/>
			</providers>
		</roleManager>

		<profile>
			<providers>
				<clear/>
				<add type="MySql.Web.Security.MySqlProfileProvider, mysql.web"
					  name="MySqlProfileProvider"
					  applicationName="/time"
					  connectionStringName="MySqlMembershipConnection"
					  autogenerateschema="true"/>
			</providers>
		</profile>

		<identity impersonate="true" />

		<siteMap defaultProvider="AspNetXmlSiteMapProvider" enabled="true">

			<providers>

				<clear/>

				<add name="AspNetXmlSiteMapProvider"
type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap"
securityTrimmingEnabled="true"/>

			</providers>

		</siteMap>
			<compilation debug="true">

			<assemblies>
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
				<add assembly="MySql.Data, Version=6.3.6.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d"/> 
				<add assembly="MySql.Web, Version=6.3.6.0, Culture=neutral,
PublicKeyToken=c5687fc88969c44d"/> 
			</assemblies>
			</compilation>

			<customErrors mode="Off"/>

			<machineKey decryptionKey="AutoGenerate,IsolateApps"/>

	</system.web>
</configuration>

Here is the code being executed when I recieve the error:

<%@ Application Language="C#" %>

<%@ Import Namespace="System.Threading" %>

<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="MySql.Web.Security" %>





<script runat="server">



    void Application_Start(Object sender, EventArgs e) {

        // Code that runs on application startup


        if (Roles.Enabled)

        {

           if (!Roles.RoleExists("ProjectAdministrator"))

            {

                Roles.CreateRole("ProjectAdministrator");

            }

            if (!Roles.RoleExists("ProjectManager"))

            {

                Roles.CreateRole("ProjectManager");

            }



            if (!Roles.RoleExists("Consultant"))

            {

                Roles.CreateRole("Consultant");

            }

        }





    }



    void Application_End(Object sender, EventArgs e) {

        //  Code that runs on application shutdown



    }

        

    void Application_Error(Object sender, EventArgs e) { 

        // Code that runs when an unhandled error occurs



    }



    void Application_BeginRequest(Object sender, EventArgs e)

    {

    }

    void Session_Start(Object sender, EventArgs e) {

        // Code that runs when a new session is started

        



    }



    void Session_End(Object sender, EventArgs e) {

        // Code that runs when a session ends. 

        // Note: The Session_End event is raised only when the sessionstate
mode

        // is set to InProc in the Web.config file. If session mode is set
to StateServer 

        // or SQLServer, the event is not raised.



    }

       

</script>


Any help would be greatly appreciated. Please let me know if I have left out
anything that would help



-- 
View this message in context: http://mono.1490590.n4.nabble.com/Could-not-find-type-MySql-Web-Security-MySQLRoleProvider-tp3328976p3328976.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.


More information about the Mono-aspnet-list mailing list