views:

48

answers:

1

Hello I have two project in a .NET 4.0 framework visual studio solution.

First is a Class Library and second is a windows service. In My Class Library I am using HTMLEncode and HTMLDecode functions so I referenced system.web.dll in my class library project. But when i referenced my class library in windows service it's not referencing correctly after a lot of research i found out that the problem is causing because system.web.dll is not referenced in windows service project. So I tried to add it in my windows service project. But it's not showing there for windows service, however it referenced correctly in class library project.

In Visual studio 2007 (.NET 3.5) it was working fine but now Microsoft have removed this ability. I am not sure why Microsoft did that. Is it a bug or they did it on purpose. But I am not sure how to solve this thing. I can't find other way to use HTMLDecode or HTMLEncode functions without system.web.dll

Any Suggestions? Please Help.

Thanks in advance

+1  A: 

By default, Visual Studio 2010 projects target the .Net 4.0 Client Profile, which does not include System.Web.dll.

To reference System.Web.dll, you need to change you service project to target the regular framework (not the Client Profile) in Project Properties.

Alternatively, you can use the WPL.

SLaks
Thanks a lot. You saved my day.
Marc V