views:

14

answers:

1

Hi,

Iam getting following error when iam using 'System.Net.HttpStatusCode' in my wcf project.

The type 'System.Net.HttpStatusCode' exists in both 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll' and 'D:\HKMP\Branch\NewAmelio\amelioSL\Web\Services\bin\System.Net.dll'

HttpResponseMessageProperty property = new HttpResponseMessageProperty();

// Here the response code is changed to 200.

property.StatusCode = System.Net.HttpStatusCode.OK;
+1  A: 

In your Visual Studio project do you have the reference to System.Net.dll marked as "Copy Local"? Select the reference in Solution Explorer and then press F4 to open the property grid. You'll want to make sure that Copy Local is set to "false" because this reference is already available on every computer with the .NET Framework installed.

You'll then also want to delete any copy of System.Net.dll that you have in your project folder as well as delete it from source control.

Eilon