2010-01-18 82 views
2

Iam在我的wcf项目中使用'System.Net.HttpStatusCode'时遇到以下错误。 “C:\ WINDOWS \ Microsoft.NET \ Framework \ v2.0.50727 \ System.dll”和“D:\ HKMP \ Branch \ NewAmelio \ amelioSL \ Web”中都存在“System.Net.HttpStatusCode”类型\ Services \ bin \ System.Net.dll'冲突的Dll

HttpResponseMessageProperty property = new HttpResponseMessageProperty(); 

// Here the response code is changed to 200. 

property.StatusCode = System.Net.HttpStatusCode.OK; 

回答

2

在您的Visual Studio项目中,您是否具有标记为“Copy Local”的System.Net.dll引用?在解决方案资源管理器中选择参考,然后按F4打开属性网格。您需要确保“复制本地”设置为“false”,因为此引用在安装了.NET Framework的每台计算机上都可用。

然后,您还需要删除项目文件夹中的任何System.Net.dll副本,并将其从源代码管理中删除。