views:

23

answers:

2

I am trying to go through the example at http://msdn.microsoft.com/en-us/library/aa719643(VS.71).aspx

Visual studio 2010 does not recognize System.Web.SessionState and various others. I tried adding a .net reference to them but they do not exist on my system. I have .Net 4 installed.

Why would these examples use namespaces that are not recognized by visual studio? alt text

A: 

System.Web.SessionState (and the others shown unrecognized) are in System.Web.dll. Verify that reference exists.

rchern
+2  A: 

System.Web isn't shown because VS2010 defaults to using the .NET4 Client Profile which doesn't include it. (You can see the "Filtered for .NET Framework 4 Client Profile" text at the top of the Add Reference dialog.)

You need to change your project's properties so that it targets the full version of the framework, then you'll be able to select System.Web.

LukeH
Ok, I switched the target framework to ".NET Framework 4".It now recognizes the namespaces however it does not recognize ManagementClass which I know is in system.management
Paul