Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 AssembliesMicrosoftFramework.NETFrameworkv4.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...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
228 views
Welcome To Ask or Share your Answers For Others

1 Answer

You need to add the System.Web reference;

  1. Right click the "Reference" in the Solution Explorer
  2. Choose "Add Reference"
  3. Check the ".NET" tab is selected.
  4. Search for, and add "System.Web".

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...