MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Custum profile  (Mono Support )

Viewed 16463 time(s), 3 post(s) 4/25/2011 2:51:54 PMby andreydruz
andreydruz

andreydruz

4/25/2011 2:51:54 PM
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.
This content has not been rated yet. 
15 Reputation 1 Total posts
khorvat

khorvat

4/26/2011 7:55:43 AM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts
khorvat

khorvat

4/26/2011 7:58:46 AM
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
This content has not been rated yet. 
15993 Reputation 2214 Total posts