How to use System.Web in a Console Application
I’ve been bitten by this and have seen others run into it enough times that I thought I’d blog about it. Let’s say you’re creating a new Console, WPF, or Windows Forms application in .NET 4. You’re using Visual Studio 2010, and everything is going great until you get to the part where you wanted to make an HTTP request. You know you can do this, you’ve done it before, heck, you might even be copying code straight out of MSDN that does what you need. But it doesn’t compile. If you try and add a reference to System.Web, you’ll find it’s not there: If you look closely, though, you’ll see at the top of the dialog it says “Filtered to: .NET Framework 4 Client … more