开发者

System.Web Reference in Windows Service in .NET 4.0

开发者 https://www.devze.com 2023-01-10 01:15 出处:网络
Hello I have two project in a .NET 4.0 framework visual studio solution. First is a Class Library and second is a windows se开发者_如何学Crvice. In My Class Library I am using HTMLEncode and HTMLDec

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

First is a Class Library and second is a windows se开发者_如何学Crvice. 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号