Profile Provider

Oct 28, 2012 at 4:48 PM

I've been trying to configure BlogEngine using the software. I had to tweak it a bit to be able to load Membership and Role Providers, but it fails while trying to load a Profile Provider, although there's no entry for profile provider in web.config.

Can someone explain where the default Profile Provider comes from?


Nov 1, 2012 at 4:53 PM
Edited Nov 1, 2012 at 4:53 PM

Hi Kris,

Sorry for missing your message, my wife and I are having a baby within the next few days so things have been a bit manic.

If you don't specify a profile provider .net will assume you are using the default provider. Either System.Web.Providers.DefaultProfileProvider or System.Web.Profile.SqlProfileProvider depending on what version of you are using.

By default the profile provider should be disabled. When did you do a pull of the code? A recent commit should stop the app from trying to use the profile or role providers if they have not been enabled.

What tweaks did you have to do to get the app to work in your environment?

Did you try the ClickOnce install? What did it not achieve for you?

Could you put a copy of your config on here so that I we can test it?


Nov 2, 2012 at 12:26 AM

I downloaded the source and built it using VS 2012. 

Strangely enough the default profile provider is enabled. I explicitly disabled it in Web.config using     <profile enabled="false">.

I've been trying to play with BlogEngine custom providers. It would require number of changes (to BlogEngine) to make it work, but that's a separate issue. I tweaked DbMembershipProvider, so it can be instantiated independently of BlogEngine, but hit two more problems.

1.  BlogEngine.Core.dll contains the following code

      private static readonly bool isMono = (Type.GetType("Mono.Runtime") != null);

The application fails on attempt to access isMono. Perhaps when BlogEngine.Core.dll is loaded, it's not properly initialized. Eliminating initilization code stopped the problem.


2. The application fails later with 'Cannot load BlogEngine.Core.dll' error. Guess some code used to manage providers is expecting provider type to be statocally linked.



Nov 2, 2012 at 11:47 AM

When loading the web.config the app looks in the bin folder relative to the app to locate any missing assemblies. It also may have an issue with loading assemblies across the network or if the assemblies are blocked by the OS.

I think to handle some of the more complected scenarios we might have to switch to using a separate AppDomain to load up the providers. This will make things easier when loading the config and targeting a folder on the network because we can use the Unrestricted permission on the AppDomain. It will however make passing data to and from more complected as it has to cross the AppDomain boundary.

Nov 3, 2012 at 5:05 PM

Actually loading a remote assembly dynamically works fine. It fails while trying to access 'Membership.Providers' - guess it cannot instantiate a custom provider type. I'll create a mock implementation of MembershipProvider to look at this issue. In the meantime I've added reference to BlogEngine.Core and I'm able to run the project.