Mono Support .Net Profiles.. 

Viewed 25893 time(s), 3 post(s), 3/5/2011 1:38:36 PM - by shawndg
3/5/2011 1:38:36 PM
1871 Reputation 252 Total posts

I went thru the example posted here..

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

And As soon as I try the first part.. to rem out those lines.. I get a error..

Server Error in '/' Application.

Compilation Error

Description: An error occurred during the
compilation of a resource required to service this request. Please
review the following specific error details and modify your source code
appropriately.

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


Source Error:


Line 119: }
Line 120:
Line 121: protected ProfileCommon Profile {
Line 122: get {
Line 123: return ((ProfileCommon)(this.Context.Profile));

dont work..

<!-- Asp.Net compiles the profile to the App_Code.dll which can't be shiped with the MonoX CMS because custom projects needs to have ability of having custom code put in to the Asp.net folder App_Code (which is compile it to the App_Code.dll) -->
        <!--"System.Collections.Specialized.StringCollection" type is added to show that complex types are ignored for now-->
        <!--<profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
            <providers>
                <remove name="AspNetSqlProfileProvider"/>
                <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider"/>
            </providers>
            <properties>
            </properties>
        </profile>-->
     
    <!--ENABLE CUSTOM USER PROFILE FILEDS-->
     
        <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="GPSLocation" defaultValue="45.562141,18.676414"/>
          <add name="Children" />
          <add name="RecentSearchList"
               type="System.Collections.Specialized.StringCollection"
               serializeAs="Xml"
                />
          <add name="Hometown" type="String" serializeAs="String" />
          <add name="IsModerator" type="bool"  />         
          <group name="Bio">
            <add name="Title" type="string" />
            <add name="Description" type="String" />
          </group>
          <group name="Publication">
            <add name="Title" type="string" />
            <add name="Description" type="String" />
            <add name="Date" type="DateTime" />
          </group>
          <add name="ClubJoinedYear" type="int"  />
          <add name="MoneyDonated" type="decimal"  />         
        </properties>
    </profile>


works:

    <!-- Asp.Net compiles the profile to the App_Code.dll which can't be shiped with the MonoX CMS because custom projects needs to have ability of having custom code put in to the Asp.net folder App_Code (which is compile it to the App_Code.dll) -->
    <!--"System.Collections.Specialized.StringCollection" type is added to show that complex types are ignored for now-->
    <profile enabled="true" defaultProvider="AspNetSqlProfileProvider">
        <providers>
            <remove name="AspNetSqlProfileProvider"/>
            <add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider"/>
        </providers>
        <properties>
        </properties>
    </profile>
 
<!--ENABLE CUSTOM USER PROFILE FILEDS-->
 
    <!--<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="GPSLocation" defaultValue="45.562141,18.676414"/>
      <add name="Children" />
      <add name="RecentSearchList"
           type="System.Collections.Specialized.StringCollection"
           serializeAs="Xml"
            />
      <add name="Hometown" type="String" serializeAs="String" />
      <add name="IsModerator" type="bool"  />         
      <group name="Bio">
        <add name="Title" type="string" />
        <add name="Description" type="String" />
      </group>
      <group name="Publication">
        <add name="Title" type="string" />
        <add name="Description" type="String" />
        <add name="Date" type="DateTime" />
      </group>
      <add name="ClubJoinedYear" type="int"  />
      <add name="MoneyDonated" type="decimal"  />         
    </properties>
</profile>-->

1
3/5/2011 3:50:11 PM
15993 Reputation 2214 Total posts

Hi,

one of our users already had an issue related to "ProfileCommon" class, it is a Asp.Net issue and to fix the error you have you need uncomment profile section (without the custom properties), then open your project in a VS and compile the project. After that you can add your custom fields.

You can find more about the issue here, let us know if this has solved your issue.

Regards

2
3/8/2011 10:31:40 AM
15993 Reputation 2214 Total posts

Did you solve the "ProfileCommon" isssue ?

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