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 )

17366 put(a) pogledan, 3 odgovor(a) 25.4.2011. 14:51:54Kreirao(la) andreydruz
andreydruz

andreydruz

25.4.2011. 14:51:54
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.
Ovaj sadržaj još nije ocijenjen. 
15 Reputacija 1 Ukupno objava
khorvat

khorvat

26.4.2011. 7:55:43
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava
khorvat

khorvat

26.4.2011. 7:58:46
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
Ovaj sadržaj još nije ocijenjen. 
15993 Reputacija 2214 Ukupno objava