views:

494

answers:

1

I get this error when compiling a C# application. Looks like a trivial error, but I can't get around it.

My setup is Windows 7 64 bit. Visual-Studio 2010 C# express B2Rel.

I added a reference to System.Web.dll located at C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0, but it has a yellow exclamation symbol and I still get the above error. I also have the using System.Web declaration.

What am I doing wrong?


Update: After getting the prompt answer pointing me at the root cause, I searched a bit in Google to where it states that System.Web.dll is for the full framework. I did not find such a reference.
For newbies like me, this blog summarizes the difference between the frameworks (client and full) nicely. I could not find a spot that says whether a certain Dll is supported in the client framework or not. I guess the exclamation mark in Visual Studio should be the first signal...

+3  A: 

You're probably targeting the Client Profile, in which System.Web.dll is not available.

You can target the full framework in Project Properties.

SLaks
Bingo! where is that specified? Where was I supposed to read this? Thanks.
Shaihi