我正在尝试使用通用列表作为用户配置文件的属性。我承认这可能只是让我的生活变得比它需要的更艰难,但我不想仅仅因为数据存储困难而改变编程模型。
我的 web.config 中有这个
</providers>
<properties>
.....
<add name="AListProperty" type="System.Collections.Generic.List`1[[System.Int32]]"/>
<add name="AnotherListProperty" type="System.Collections.Generic.List`1[[MyNamespace.Web.UI.MyReallySimpleClass]]">
</properties>
</profile>
第一个属性“AListProperty”工作正常。第二个会根据我在 web.config 中的 delcare 方式引发各种异常。MyReallySimpleClass 是公共的,可序列化的,由 2 个公共字段组成(目前)
所以,我的问题是 1. 有谁知道在 web.config 中声明这些类型的格式记录在哪里。2. 我做错了什么?看起来不错,我看不出两个声明之间有任何语义差异。
谢谢