0

when i want to use HttpCookie who a part of System.Web i found that intellisense does not show them nor they found in reference when i put using System.Web

Can someone show me what thing i need to do to use HttpCookie. i try with using System.Web but still i not see them in intellisense can someone show me how i can use HttpCookie.

i found problem in WPF project their is nothing problem come when i do that in ASP.NET MVC

i can see only three thing AspNetHostingPermission AspNetHostingPermissionAttribute AspNetHostingPermissionLevel

Anirudha Gupta
  • 9,073
  • 9
  • 54
  • 79
  • 2
    Mr. Spielberg, HttpCookie is defined in `System.Web.dll`; do you have that reference included ? And it's quite unusual for a WPF app to be dealing with cookies; can you elaborate on what exactly you are trying to do ? – Bala R May 01 '11 at 15:34

4 Answers4

3

WPF does have a concept of Cookies, but they are different than what you are use to in Web Applications. What is it you are trying to do?

You can use the GetCookie and SetCookie on the Application class. For an overview of cookies in WPF, you can read here:

http://msdn.microsoft.com/en-us/library/ms750478.aspx#Cookies

vcsjones
  • 138,677
  • 31
  • 291
  • 286
  • I'm pretty sure that will only work in XAML browser applications. I don't think that's what we have here – Conrad Frix May 01 '11 at 18:08
  • Except for that first bullet in the documentation that says "WPF standalone applications and XBAPs can both create and manage cookies." – vcsjones May 01 '11 at 18:27
0

You need to add a reference to System.Web in your project.

Right click the project in visual studio, select add reference, and select System.Web from teh list provided.

debracey
  • 6,517
  • 1
  • 30
  • 56
0

Check if your project is not Profiled for ".Net Framework 4.0 Client Profile" which is Default. It should be just ".Net 4.0 Framework"

szogun1987
  • 627
  • 6
  • 14
0

Check if your project is not Profiled for ".Net Framework 4.0 Client Profile" which is Default. It should be just ".Net 4.0 Framework""

It worked for me. At first I had not been able to add ref System.Web, because was have profiled for ".Net Framework 4.0 Client Profile"...

Julien Vivenot
  • 2,230
  • 13
  • 17
Goliathus
  • 31
  • 2