2008-12-25 24 views
1

我想部署我WCF Web服務的免費主機測試,但它給了我下面的錯誤:部分信任的主機上託管的WCF服務

The Binding with name WSDualHttpBinding failed validation because the Binding type System.ServiceModel.WSDualHttpBinding is not supported in partial trust. Consider using BasicHttpBinding or WSHttpBinding, or hosting your application in a full-trust environment.

任何想法如何,我可以設置我的託管環境以Full-Trust或任何其他方式解決此問題?

回答

4

宿主環境設置爲部分信任,以便您的代碼無法干擾其他人的代碼。您無法提升託管環境授予您的權限。

這意味着您僅限於BasicHttpBinding,BasicHttpContextBinding,WebHttpBinding,WSHttpBinding,WSHttpContextBinding和WS2007HttpBinding。

您將您的網站設置爲使用中等信任度(很可能是您的主持人正在使用的),以便您可以在本地測試您的網站,但與主持人執行的限制相同。添加到你的web.config來做到這一點。

0

很簡單略低於行添加到您的web.config文件

<configuration> 
    <system.web> 
    <trust level="Full" /> 
    </system.web> 
    </configuration>