Mono Support Custum profile 

Viewed 17522 time(s), 3 post(s), 4/25/2011 2:51:54 PM - by andreydruz
4/25/2011 2:51:54 PM
15 Reputation 1 Total posts

Hello,

I was trying to add custum field to profile on (MonoX_4_0_2650_40.zip 19.32 MB)
http://www.mono-software.com/Downloads/#MonoX

<profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
    <providers>
        <remove name="AspNetSqlProfileProvider"/>
        <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider"/>
    </providers>
    <properties>
        <add name="Teachers" type="string"/>
    </properties>
</profile>


I have error

The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)

I copy "ProjectName.sln" to root folder and add ProfileCommon class( from http://msdn.microsoft.com/en-us/library/aa983476.aspx#Y3888).

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.Profile;
 
public class ProfileCommon : ProfileBase
{
    [SettingsAllowAnonymous(false)]
    [ProfileProvider("AspNetSqlProfileProvider")]
    public string Teachers
    {
        get
        {
            if (this.GetPropertyValue("Teachers") == null) return string.Empty;
            else return (string)this.GetPropertyValue("Teachers");
        }
        set
        {
            this.SetPropertyValue("Teachers", value);
        }
    }
}


There is other error

System.ArgumentNullException: Value cannot be null.
Parameter name: type


I doing something wrong?

Thanks,
Andrey.

1
4/26/2011 7:55:43 AM
15993 Reputation 2214 Total posts

Hi Andrey,

there are few issues related to ASP.NE Profile that resides in the .NET Framework so can you please try and find a solution inside one of the following resources:

http://www.mono-software.com/Mono/Pages/Discussion/dtopic/uvoGrpA1GUO4AJ6KATl6gQ/Problem-adding-custom-profile/?pageno=1&dmsgId=ZWtu1erKJUqLB56KATl6iA#PostZWtu1erKJUqLB56KATl6iA

http://www.mono-software.com/Mono/Pages/Discussion/dtopic/xvWDQB1Jck24p56dAPnRIA/Net-Profiles/

http://www.mono-software.com/Blog/post/Mono/38/Support-for-ASP-NET-profiles-in-MonoX/

After you get more into the issue can you please get back to us if you have solved the issue or not ?

Regards

2
4/26/2011 7:58:46 AM
15993 Reputation 2214 Total posts

Hi,

I forgot to mention that is you are using WAP I think the solution would be just to uncomment the ASP.NET Profile section in web.config then copy the ProjectName.sln  to the MonoX root folder, open the solution and compile the solution after that it should work (If I can remember one of our users used this procedure to fix the issue).

And don't create the ProfileCommon class  manually.

Regards

3
This is a demo site for MonoX. Please visit Mono Software for more info.