davej
davej

Reputation: 1380

Silverlight, "The type or namespace name 'CookieContainer' does not exist in the namespace 'System.Net'"

I'm running VS2010 pro, and I downloaded a sample Silverlight app written in an older version. I did the conversion but now when I go to run it, I get this error. I searched the net, the only recommendation I found was to add a reference to "System.Net" (which didn't make sense, but I did anyway), but this didn't help. The offending code:

public System.Net.CookieContainer CookieContainer {...

Upvotes: 3

Views: 1370

Answers (2)

Vinny Marquez
Vinny Marquez

Reputation: 547

CookieContainer Class Namespace: System.Net Assembly: System (in System.dll) Supported in: 4, 3.5 SP1

CookieContainer still exists.

Try deleting the reference in your project then add System.net again.

Upvotes: 0

AnthonyWJones
AnthonyWJones

Reputation: 189505

The System.Net dll is usually referenced by default but perhaps it wasn't in the older project. Check the version number is 2.0.5.0 and that the file path is something like:-

c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\System.Net.dll

Upvotes: 1

Related Questions