[英]Deploying a WCF service on IIS 5.1
我一直在嘗試將WCF服務部署到IIS 5.1。 我在這里找到了這個答案–似乎是同一個問題; 但是,當我按照此步驟操作,然后嘗試瀏覽到服務頁面時,出現以下錯誤:
A name was started with an invalid character. Error processing resource 'http://MyComputerName/MyService/MyService...
<%@ ServiceHost Language="C#" Debug="true" Service="ServiceNamespace.MyService" CodeBehind="MyService.sv...
我已經在IIS中創建了一個虛擬目錄,並將其指向解決方案文件夾的子目錄-並正在發布到該虛擬目錄。
我的web.config服務節點如下所示:
<services>
<service name="ServiceNamespace.MyService" behaviorConfiguration="ServiceNamespace.MyService">
<!-- Service Endpoints -->
<endpoint address="" binding="basicHttpBinding" contract=" ServiceNamespace.IMyService">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
<identity>
<dns value="localhost"/>
</identity>
-->
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
在VS2008下運行時,可以編譯並正常運行。 有人能在正確的方向上指出我的意思嗎?
我終於找到了答案。 IIS下的應用程序配置為使用ASP.NET 1.1。 我將其更改為2.0,並且工作正常。
path后面的代碼看起來不正確,我認為它應該是相對路徑,因此:
CodeBehind =“〜/ App_Code / YourServiceClass.cs”
檢查文件后面的代碼是否指向cs文件,看起來是否指向svc文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.