I
Ian
All,
I'm trying to figure out the correct way to specify a profile property
type with a generic type, where the type parameter is a type from a
generated assembly. Consider the following web.config snippet:
<configuration>
<system.web>
<profile>
<providers>
</providers>
<properties>
<clear/>
<add name="TestItem" type="MyGalleryItem"/>
<add name="ItemList" type="System.Collections.IList"/>
<add name="MyStringList"
type="System.Collections.Generic.List`1[System.string]"/>
<add name="TestItemList"
type="System.Collections.Generic.List`1[MyGalleryItem]"/>
</properties>
</profile>
</system.web>
</configuration>
Where MyGalleryItem is a class defined in ~/App_Code/MyGalleryItem.cs
The first three properties (with the fourth commented out) work fine.
The addition of the List<MyGalleryItem> causes it to fail.
It seems to need an assembly qualified name in order to find the type
parameter for my typed list (TestItemList,) but since the assembly name
is generated by the ASP.NET runtime (usually of the form
App_Code.XXXXXXXX.dll), I cant specify it in the web.config. Can
anyone make any suggestions as to how to make this work?
Thanks,
Ian
I'm trying to figure out the correct way to specify a profile property
type with a generic type, where the type parameter is a type from a
generated assembly. Consider the following web.config snippet:
<configuration>
<system.web>
<profile>
<providers>
</providers>
<properties>
<clear/>
<add name="TestItem" type="MyGalleryItem"/>
<add name="ItemList" type="System.Collections.IList"/>
<add name="MyStringList"
type="System.Collections.Generic.List`1[System.string]"/>
<add name="TestItemList"
type="System.Collections.Generic.List`1[MyGalleryItem]"/>
</properties>
</profile>
</system.web>
</configuration>
Where MyGalleryItem is a class defined in ~/App_Code/MyGalleryItem.cs
The first three properties (with the fourth commented out) work fine.
The addition of the List<MyGalleryItem> causes it to fail.
It seems to need an assembly qualified name in order to find the type
parameter for my typed list (TestItemList,) but since the assembly name
is generated by the ASP.NET runtime (usually of the form
App_Code.XXXXXXXX.dll), I cant specify it in the web.config. Can
anyone make any suggestions as to how to make this work?
Thanks,
Ian