我正在开发一个需要提供身份验证以及角色和配置文件管理的C#Web服务。我需要每个配置文件都具有List类型的属性。在web.config配置文件部分看起来是这样的:在.NET中使用List类型的配置文件属性成员
<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>
然而,当我开始在互联网服务和尝试访问它返回以下错误性质:
System.Configuration.ConfigurationErrorsException:尝试加载此属性的类型导致以下错误:无法加载类型'System.Collections.Generic.List <字符串>'。 (C:\ Projects \ MyProject \ web.config 58行)---> System.Web.HttpException:无法加载类型'System.Collections.Generic.List <字符串>'。
有没有办法使用泛型集合来达到此目的?