简体   繁体   中英

Why I can't use the KeyedByTypeCollection class?

I want to use the System.Collections.Generic.KeyedByTypeCollection ( ref ) in a WPF application but I get the

the type or namespace name does not exist are you missing an assembly reference

error, even if my class is using the System.Collections.Generic namespace.

Why is that happening?

If you look in the docs , the assemblies in which the type is defined are listed.

If you target the .NET Framework, you should add a reference to System.ServiceModel.dll from your WPF application. You do this by selecting it under Project->Add Reference->Assemblies->Framework in Visual Studio.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM