views:

69

answers:

1

Hi

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?

Thanks in advance

Christo

+2  A: 

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".

Adam
Thanks! I changed the Target framework from ".net framework 4 client profile" to ".net framework 4" and it works fine now.
Christo