Web服务(WCF)配置错误导致应用程序使用时出错

时间:2016-10-24 18:40:22

标签: c# wcf

我正在学习WCF,而我正在尝试在本地测试应用程序。但是,我遇到以下错误:

  

System.ServiceModel.ServiceActivationException:请求的服务,' net.tcp://xxx/Services/xx/xx.svc'无法激活......

我尝试解决此问题的方法是在IIS中的应用程序配置中添加https net.tcp。我也试图应用这篇文章中的建议而没有成功:What are the reasons that cause ServiceActivationException?

我的网络配置如下:

<?xml version="1.0"?>
<configuration>
    <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
        <add key="connectionStringFinish" value="DAT;" />
    </appSettings>
    <system.web>
        <compilation targetFramework="4.5.2" />
        <httpRuntime targetFramework="4.5" />
    </system.web>
    <system.serviceModel>
        <services>
            <service behaviorConfiguration="DefaultBehavior" name="xs.xs">
                <endpoint 
                    address=""
                    binding="netTcpBinding"
                    bindingConfiguration="mynetTcpBinding"
                    contract="xs.Ixs"/>
            </service>
        </services>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
            <add binding="wsHttpBinding" scheme="https" />
        </protocolMapping>
        <serviceHostingEnvironment 
                aspNetCompatibilityEnabled="true"    
                multipleSiteBindingsEnabled="true" />
        <diagnostics>
            <messageLogging 
                    maxSizeOfMessageToLog="1000000" 
                    logEntireMessage="true" logMalformedMessages="true"
                    logMessagesAtServiceLevel="true" 
                    logMessagesAtTransportLevel="true" 
                    maxMessagesToLog="3000" />
        </diagnostics>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true" />
        <directoryBrowse enabled="true" />
    </system.webServer>
</configuration>

我正在寻找一个不仅解决问题的答案,而且还可以为我在配置中做错了提供参考和/或解释。谢谢。

〜CH

0 个答案:

没有答案
相关问题