Mono with SQL Server Membership Provider?

Obviously, Mono replaces the SQL Server membership provider links with the sqlite membership provider (see ASP.NET_Settings_Mapping ). Is there a way to convince Mono to use SQL Server for a membership provider?

When I try to log into my web application, I get the following:

System.Configuration.Provider.ProviderException: Operation aborted due to an exception (see Trace for details). at System.Web.Security.SqliteMembershipProvider.ValidateUser (string,string) <0x003bb> at DirectMail.Controllers.AccountMembershipService.ValidateUser (string,string) [0x00000] in [file].cs:404 at DirectMail.Controllers.AccountController.ValidateLogOn (string,string) [0x00040] in [file].cs:346 at DirectMail.Controllers.AccountController.LogOn (string,string,bool,string) [0x00000] in [file].cs:79 at (wrapper dynamic-method) System.Runtime.CompilerServices.ExecutionScope.lambda_method (System.Runtime.CompilerServices.ExecutionScope,System.Web.Mvc.ControllerBase,object[]) <0x001c1> at System.Web.Mvc.ActionMethodDispatcher.Execute (System.Web.Mvc.ControllerBase,object[]) <0x00028> at System.Web.Mvc.ReflectedActionDescriptor.Execute (System.Web.Mvc.ControllerContext,System.Collections.Generic.IDictionary`2<string, object>) <0x0015b> at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod (System.Web.Mvc.ControllerContext,System.Web.Mvc.ActionDescriptor,System.Collections.Generic.IDictionary`2<string, object>) <0x00036> at System.Web.Mvc.ControllerActionInvoker/<InvokeActionMethodWithFilters>c__AnonStoreyB.<>m__E () <0x00092> at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter (System.Web.Mvc.IActionFilter,System.Web.Mvc.ActionExecutingContext,System.Func`1<System.Web.Mvc.ActionExecutedContext>) <0x00125> 

The top of the /usr/local/etc/mono/4.0/settings.map file on a single Linux Debian machine:

 <?xml version="1.0" encoding="utf-8" ?> <settingsMap> <map sectionType="System.Web.Configuration.MembershipSection, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" mapperType="Mono.Web.Util.MembershipSectionMapper, Mono.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" platform="Unix"> <!-- The 'what' tag specifies which region of the section to modify. The 'value' attribute value is mapper-specific and is not defined here. It can be any expression understood by the mapper to designate the section region to modify. --> <what value="providers"> <!-- 'what' can contain any number of occurrences of any three elements: replace - replace the designated region add - add a new entry to the region clear - clear the region remove - remove the designatedregion The attributes to any of the above are freeform and are not processed by the mapper manager. They are stored verbatim for the mapper to peruse. --> <replace name="AspNetSqlMembershipProvider" type="System.Web.Security.SqliteMembershipProvider, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqliteServer" /> </what> </map> <!-- ... --> 
+4
source share
2 answers

The ASP.NET Settings Mapping page that you referred to in the "Preventing settings mappings" section says that adding

 <appSettings> <add key="MonoAspnetInhibitSettingsMap" value="anything"/> </appSettings> 

In your Web.config application, the display of settings will be disabled. However, I found that the value "nothing" does not work. If instead I use the value "true", then it does the following:

 <appSettings> <add key="MonoAspnetInhibitSettingsMap" value="true"/> </appSettings> 
+3
source

This should be a misconfiguration, as for Mono 2.0 there is an implemented sqlmembershipprovider. To get the connection, DBProviderFactory is used. An implementation of SqlClient also exists, therefore, only the conclusion that web.config for the site is incorrect is unthinkable because sqlclient and sqlite are almost the same in a crowded web.config.

If someone can post this, it can clear up the problem.

+1
source

All Articles