Profiles with Generic Types

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

Ian

....just as a followup:

Naturally, if I move the type MyGalleryItem into a class library
project of its own, I can then change
System.Collections.Generic.List`1[MyGalleryItem] to
System.Collections.Generic.List`1[MyGalleryItem, MyAssembly] and
everything works fine.

It seems to me like there SHOULD be a way to do this without FORCING a
second assembly, but for now that works.

Ian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Profiles 0
Profiles problem 0
Profiles 1
Profiles & Membership 0
Profiles in Asp.net 2
How to use multiple profiles 1
Profiles - extend property attributes? 0
Profiles 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top