2012-10-11 97 views
0

我有一個是通過webHttpRelayBinding和Azure的服務總線露出兩個「本地」,並在雲中的WCF REST服務。託管在IIS 6 WCF REST服務,也暴露了webHttpRelayBinding到服務總線

這對我的IIS 7.5 Express實例的偉大工程,但是當我把它部署到的Windows Server 2003/IIS 6的環境中,我開始收到以下錯誤:

The service cannot be activated because it does not support ASP.NET compatibility. ASP.NET compatibility is enabled for this application. Turn off ASP.NET compatibility mode in the web.config or add the AspNetCompatibilityRequirements attribute to the service type with RequirementsMode setting as 'Allowed' or 'Required'.

我讀過,我需要完全刪除對ASP.NET的任何依賴關係來解決此問題(請參閱here)。我已經重構了我的代碼,以便包含服務定義的程序集沒有任何對System.Web的引用,但仍然出現錯誤。

所以我認爲這是什麼意思是,我不能在所有IIS託管服務。如果是這樣的話,我唯一的選擇是使用Windows服務來託管嗎? WAS在Win2k3上不可用。

回答

0

你嘗試在你的web.config移除從serviceHostingEnvironment元素aspNetCompatibilityEnabled屬性?

本身就是它的可在WIN2K3(這是怎麼webhosted WCF服務工作),但IIS的應用程序池和激活模型是在它的新版本略有不同。