Using a profile property of type List in .NET Membership
Posted
by hancock
on Stack Overflow
See other posts from Stack Overflow
or by hancock
Published on 2010-02-04T11:56:24Z
Indexed on
2010/03/25
2:03 UTC
Read the original article
Hit count: 494
Hi,
I'm working on a C# Webservice that needs to provide authentication as well as roles and profile management. I need each profile to have a property of type List. The profile section in the web.config looks like this:
<profile defaultProvider="MyProfileProvider" enabled="true">
<providers>
<remove name="MyProfileProvider"/>
<add connectionStringName="MySqlServer"
applicationName="MyApp"
name="MyProfileProvider"
type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add name="Websites" type="System.Collections.Generic.List<String>" serializeAs="Binary"/>
</properties>
</profile>
However, when I start the webservice and try to access that property it returns the following error:
System.Configuration.ConfigurationErrorsException: Attempting to load this property's type resulted in the following error: Could not load type 'System.Collections.Generic.List<String>'. (C:\Projects\MyProject\web.config line 58) ---> System.Web.HttpException: Could not load type 'System.Collections.Generic.List<String>'.
Is there a way to use a generic collection for this purpose?
© Stack Overflow or respective owner