KeyedCollection Exception

S

SAL

Can anyone help me with why, when the mouse is placed over my collection
object, it shows the following exception:

{"The generic type 'System.Collections.ObjectModel.Collection`1' was used
with the wrong number of generic arguments in assembly 'mscorlib,
Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'.":"System.Collections.ObjectModel.Collection`1"}S

The code is so simple, which may be the why for the exception but I'm just
not getting it.

public class CCKeyedCollection : KeyedCollection<string, ICollectionItem>
{

protected override string GetKeyForItem(ICollectionItem item)
{
return item.Key();
}
}


public interface ICollectionItem
{
string Key();
}

What's weird is that the code seems to execute fine, no crashing or
anything. I wouldn't know about this exception had I not placed the mouse
pointer over the new collection object after construction.
VS2008 compiling for .NET 2.0 assembly for use in a cohorts program.
Please forgive me if this is just toooo elementary.

Thanks in advance,
S
 
C

Colbert Zhou [MSFT]

Hello SAL

The managed support service of the newsgroup
microsoft.public.dotnet.languages.csharp is now available on Visual C#
General forum:
http://social.msdn.microsoft.com/Forums/en-SG/csharpgeneral/threads.

Would you please repost the question in the forum with the Windows Live ID
used to access your Subscription benefits? Our engineers will assist you in
the new platform. The article
http://msdn.microsoft.com/en-us/subscriptions/aa974230.aspx introduces more
information about the migration. In the future, please post your C#-related
questions directly to the forums. If you have any questions or concerns,
please feel free to contact us: (e-mail address removed).

Regards,
Colbert Zhou
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup and Forum support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Top