I'd be grateful if anyone could point me towards the right direction for the following problem.

Given: Sharepoint 2010 project. FBA Authentication with custom user profile (class called UserProfile, inherited from ProfileBase). Custom user profile class is located in the Test.Utils library.

Required: Run a custom timer job once a day to get the list of user emails (require to fetch and compare data from UserProfile) to send notifications.

I've managed to get timer job running and fetching membership data, however I'm failing to fetch user profile details for a given user.

My owstimer.exe.config looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
        <remove name="Test-FBA" />
        <add connectionString="Data source=(local)\Sharepoint;Integrated Security=True;Initial Catalog=Test_dev;" name="Test-FBA" />
            <add assembly="Test.UserUtils, Version=, Culture=neutral, PublicKeyToken=5f674de4cd3d93d8" />  
        <add name="Profile" type="System.Web.Profile.ProfileModule, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
        <add name="ProfileBase" type="System.Web.Profile.ProfileBase, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <membership defaultProvider="FBAMembershipProvider">
            <add name="FBAMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    applicationName="/" connectionStringName="Test-FBA" enablePasswordReset="true" 
    enablePasswordRetrieval="true" passwordFormat="Clear" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
    maxInvalidPasswordAttempts="3" minRequiredNonalphanumericCharacters="0" />
    <roleManager cacheRolesInCookie="false" defaultProvider="FBARoleProvider" enabled="true">
            <add name="FBARoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
    applicationName="/" connectionStringName="Test-FBA" />
    <profile enabled="true" defaultProvider="SqlProfileProvider" inherits="Test.UserUtils.UserProfile, Test.UserUtils">
            <add name="SqlProfileProvider" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" applicationName="/" connectionStringName="Test-FBA" />
    <authentication mode="Forms">
        <forms loginUrl="~/_layouts/FBA/Login.aspx" />

When I try to access UserProfile from timerjob class, i.e.

UserProfile profile = UserProfile.GetProfile(memberuser.UserName);

I get this error: Could not load file or assembly 'Test.Utils' or one of its dependencies. The system cannot find the file specified.

What I've tried: - This assembly is in the GAC. - I've stopped the SP timer, deployed the solution, restarted the timer to attach to the OWSTimer process - I've rebooted the IIS

Do I miss something else?

Thanks in advance!


-- Update 13/09

First comments made me change the structure a bit. Now I have Test.UserUtils which don't reference to any custom DLLs except System and Sharepoint- related ones.

I have updated my OWSTimer.config.exe above to reflect my latest (still not working) version.

ULS Viewer provides me with the following error:

Exception stack trace:   
at System.Web.Profile.ProfileBase.InitializeStatic()    
at System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated)    
at Test.UserUtils.UserProfile.GetProfile(String username)    
at Test.Web.AlertManagement.TimerJob.SubscriberAlertsTimerJob.GetListRegisteredUsers(SPSite site, String connectionString)    
at Test.Web.AlertManagement.TimerJob.SubscriberAlertsTimerJob.GetListOfConfirmedSubscribers(String alertSectorsAsString, SPSite site, String connectionString)    
at Test.Web.AlertManagement.TimerJob.SubscriberAlertsTimerJob.Execute(Guid contentDbId)    
at Microsoft.SharePoint.Administration.SPTimerJobInvokeInternal.Invoke(SPJobDefinition jd, Guid targetInstanceId, Boolean isTimerService, Int32& result)

The code still fails at the call to UserProfile:

using System.Web.Profile;

namespace Test.UserUtils
    public class UserProfile: ProfileBase
        public static UserProfile GetProfile(string username)
            **return Create(username, true) as UserProfile;** <- fails here
  • Does Test.Utils have any references to other DLLs/Namespaces that you also need to include or install to the GAC? Commented Sep 12, 2011 at 19:19
  • @John Yes, I had some references to other DLLs. Thanks for reminding about that. I've created a separate Test.UserUtils now which doesn't have any references except System and Sharepoint related. There is one which I had to add was System.Web, which I have a feeling creates some problems. See update.
    – Galiya
    Commented Sep 13, 2011 at 10:26

1 Answer 1


When ever i see could not load assembly, the first thing i suggest trying is fuslogvw.exe to see what asseblies are tried loaded from where

Check out a guide here.

You could also try to debug the issue with Process Explorer.

  • Thanks for your message. I've debugged using Process Explorer and found out that previously I was using the dll, which has some dependencies. However, after my changes (see updated section) Process Explorer doesn't seem to suggest anything specific.
    – Galiya
    Commented Sep 13, 2011 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.