簡體   English   中英

在客戶端測試中測試WCF時出錯

[英]Error while testing wcf in client test

我正在創建一個簡單的wcf Web服務,該服務將允許用戶從數據庫表中提取數據。 實施后如果我在Web瀏覽器中查看服務,我將獲得下一頁

在瀏覽器中查看服務后,我得到了沒有錯誤的頁面 (您已創建服務。)沒有任何錯誤。 但是,如果我調試模式,我會得到以下錯誤。

如果調試以在測試客戶端窗口中運行,則顯示此頁面

我真的不明白問題出在哪里,但是我認為它來自我的配置,但是我無法到達哪里。

這是我的web.config文件。

<system.serviceModel>
    <services>
        <service behaviorConfiguration="namespaceName.Service1Behavior" name="namespaceName.Service">
            <endpoint address="http://localhost:6937/Service.svc" binding="basicHttpBinding" contract="namespaceName.IService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="namespaceName.Service1Behavior">
                <!-- To avoid disclosing metadata information, set the value below to false before deployment -->
                <serviceMetadata httpGetEnabled="true" />
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>

我認為您的配置文件中包含以下內容:

<system.web>
  <compilation debug="true" />
<system.web>

暫無
暫無

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

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