[Mono-aspnet-list] ProfileCommon not automatically generated under XSP
william.leader at gmail.com
Mon Aug 31 08:10:50 EDT 2009
After some testing I have discovered that it is the use of Groups in the
profile properties in the web.config that causes the problem. If I modify my
web.config properites section as follows, then the code works fine in XSP in
<add name="GamesJoined" type="Int32" serializeAs ="String"
Which means that as a work around I can just not use property groups, which
is less than ideal. I have found that removing the groups from the profile
properties section corrects the problem on both mono 2.2 and 220.127.116.11, so now
I need to determine if this is caused by the profile provider or some code
inside Mono itself.
On Mon, Aug 31, 2009 at 11:14 AM, william leader
<william.leader at gmail.com>wrote:
> What I had installed is mono 2.2, and the error page reports: *Version
> information: * Mono Version: 2.0.50727.1433; ASP.NET <http://asp.net/>Version: 2.0.50727.1433
> Just to be sure I've tried running under mono 18.104.22.168, and I get the same
> error message, except now the error page no longer shows the line numbers
> which is less helpful.
> I'm not convinced this is a bug since as Marek points out This feature has
> been around for three years. I'm more inclined to believe I'm doing
> something wrong like I am missing a parameter or setting somewhere.
> On Mon, Aug 31, 2009 at 10:26 AM, Marek Habersack <grendel at twistedcode.net
> > wrote:
>> wleader wrote:
>> 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.
>> 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
>>> Visual Studio, and also with XSP running inside the mono runtime in
>>> 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
>>> So far I have added the following to my web.config
>>> <profile defaultProvider="MySQLProfileProvider">
>>> <remove name="MySQLProfileProvider"/>
>>> <add name="MySQLProfileProvider"
>>> applicationName="/" />
>>> <group name="GameStats">
>>> <add name="GamesJoined" type="Int32" serializeAs ="String"
>>> </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
>>> 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
>>> could not be found. Are you missing a using directive or an assembly
>>> Does anyone have advice about what I can do to get profile code that
>>> on both .Net and Mono hosts?
>>> -William Leader
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-aspnet-list