2010-01-18 57 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副本,並將其從源代碼管理中刪除。