簡體   English   中英

如何在IIS Express上添加WCF服務?

[英]How to add WCF service on IIS Express?

我有wcf服務包,正等待放入IIS。 當我在默認網站等上創建虛擬目錄時,一切正常。但是,當我嘗試訪問Chrome中的路徑時,出現錯誤消息:

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

當我評論此部分時:

<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />

我可以訪問目錄,但不能訪問服務。 任何想法?

我再嘗試一點,然后弄清楚我做錯了什么。 我無法在“默認網站”下創建虛擬路徑。 我必須創建自己的站點,該站點指定WCF文件存儲的文件夾。 像這樣:

appcmd add site /name:WcfService1 /id:2 /physicalPath:C:\WcfService1 /bindings:http/*:8080

這樣,虛擬目錄將被標記為應用程序,並且一切正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM