shiitake_the_mushroom
shiitake_the_mushroom

Reputation: 143

Why can't I use SynchronizedCollection when I include System.Collections.Generic?

I'm trying to include the following line in my C# code, but for some reason it's being marked as an error:

        public SynchronizedCollection<Uri> allImages = new SynchronizedCollection<Uri>();

I've tried including using System.Collections.Generic but it does not resolve the issue. Any idea how I can get a SynchronizedCollection<T> working in my application?

Upvotes: 7

Views: 5314

Answers (1)

Scott Chamberlain
Scott Chamberlain

Reputation: 127593

If you look at the documentation you will see it states

Namespace: System.Collections.Generic
Assembly: System.ServiceModel (in System.ServiceModel.dll)

This means that although it is in the System.Collections.Generic namespace you need to make sure you have the System.ServiceModel.dll dll included in your project as a refrence to be able to use the class.

Upvotes: 20

Related Questions