[Mono-aspnet-list] ProfileCommon not automatically generated under XSP

Marek Habersack grendel at twistedcode.net
Mon Aug 31 05:26:20 EDT 2009


wleader wrote:
> Hello,
What is the Mono version you're using? ProfileCommon has been supported in Mono since 2006.
If you're using the latest mono and still see the issue, then this is a bug - please file a bug 
(http://mono-project.com/Bugs) with a self-contained test case attached. If you're using some old 
version of Mono, please upgrade.

marek

> I am building my ASP.Net 2.0 application using Visual Studio as my IDE. As I
> make changes I like to test with both the development server included with
> Visual Studio, and also with XSP running inside the mono runtime in Windows.
> My presumption is that testing this way I can be sure to write code that
> works on .Net hosts and Mono hosts.
> 
> Currently I am working on adding a feature that uses Profiles, and I have
> things working using the MySQL Profile Provider under the Visual Studio web
> server. 
> 
> So far I have added the following to my web.config
> 
>     <profile defaultProvider="MySQLProfileProvider">
>       <providers>
>         <remove name="MySQLProfileProvider"/>
>         <add name="MySQLProfileProvider"
>              type="MySql.Web.Profile.MySQLProfileProvider,
> MySql.Web,Version=5.2.5.0,Culture=neutral, PublicKeyToken=C5687FC88969C44D"
>              connectionStringName="LocalMySqlServer"
>              applicationName="/" />
>       </providers>
>       <properties>
>         <group name="GameStats">
>           <add name="GamesJoined" type="Int32" serializeAs ="String"
> defaultValue="0"/>
>         </group>
>       </properties>      
>     </profile>
> 
> Once that was done inside visual studio, I was able to start using the
> ProfileCommon object which appears to be automatically generated by the
> compiler. In the code I can then do the following:
> 
>         ProfileCommon profile = (ProfileCommon.Create("ValidUsername") as
> ProfileCommon);
>         LabelUsername.Text = profile.UserName; 
>         TextBoxGamesJoined.Text = profile.GameStats.GamesJoined.ToString();
> 
> This works great under the visual studio developement server, but when I
> attempt to load a page with this code on XSP I get the error message:
> 
> Compiler Error Message: CS0246: The type or namespace name `ProfileCommon'
> could not be found. Are you missing a using directive or an assembly
> reference? 
> 
> Does anyone have advice about what I can do to get profile code that works
> on both .Net and Mono hosts?
> 
> Thanks,
> -William Leader



More information about the Mono-aspnet-list mailing list