I'm trying to create a Windows Service in VS2010 but can't seem to add System.Web as reference. When I browse for it and add it manually I get an exclamation mark over the reference. I've tried adding it for other projects and it works fine, just not for a windows service project. Is there a reason for this? I need it to call System.Web.HttpUtility.UrlEncode. Is there alternative method I can use?
It sounds like your project is configured to target a given framework profile, likely one of the new "Client" distributions. It is telling you that the DLL you've added is not in the targeted profile.
If you look in your project properties, there will be a target framework option under "Application" or possibly "Build".
One perhbaps rather silly amendmend: Maybe you run in the same problem like I did. I read a lot about changing the target framework. The question for me was: How? In the solution explorer I always hit the top node and "properties" but got a dialog which has only some complile options - nothing more! I want to add the hint that you have to mark your WCF library project first, THEN enter the project properties in VS2010 using the context menu and you will see a totally different properties page: Where you can change the behavior from client project to normal .NET 4.0. Almost took me half an hour...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With