user3802347
user3802347

Reputation: 108

WCF Service Library Won't Accept System.Web Reference

I have a WCF project service library that is receiving an encrypted username and password. I need to encrypt my response back to the requested user. I created a separate service library and add the encryption methods in it. Because I am using System.Web.HttpUtility.UrlEncode(EncryptUser(key, user), Encoding.GetEncoding("utf-8")), I need to add a reference to System.Web dll. However, adding the reference to System.Web causes an issue with the WCF Service. Every time I compile, it says that the reference to USER.dll is not found. If I remove the reference to system.web dll, the WCF Service is not complaining, but I am getting a message "HttpUtility does not exist in the other project are you missing a reference?" How do I get around this given it is specified in the requirement that I use System.Web.HttpUtility.UrlEncode?

Upvotes: 0

Views: 129

Answers (1)

user3802347
user3802347

Reputation: 108

The issue is fixed after going to the WCF project's property and change the target Framework to .NET Framework 4.

Upvotes: 1

Related Questions