Fehler bei der Protokollzuordnung beim Hosten eines WCF-Dienstes in IIS
Entwickelte ich einen einfachen WCF-Dienst mit VS 2010. Und ich veranstaltete in der Standard-website in IIS durch das Hinzufügen von Anwendung und legen Sie den Physischen Pfad
Und ich versuchte, Sie zu durchsuchen .svc-Datei es gibt mir die folgende Fehlermeldung:
"Die Konfiguration im Abschnitt 'protocolMapping' kann nicht gelesen werden, weil es fehlt, ist ein Abschnitt der Erklärung"
und ich habe versucht, viele Lösungen, aber es funktioniert nicht
Ich Erstellt WCF Service Library ist eine App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="EvalServiceLibrary.EvalService">
<clear />
<endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService"
listenUriMode="Explicit">
<identity>
<dns value="localhost" />
<certificateReference storeName="My" storeLocation="LocalMachine"
x509FindType="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
listenUriMode="Explicit">
<identity>
<dns value="localhost" />
<certificateReference storeName="My" storeLocation="LocalMachine"
x509FindType="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
<endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService"
listenUriMode="Explicit">
<identity>
<dns value="localhost" />
<certificateReference storeName="My" storeLocation="LocalMachine"
x509FindType="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
<endpoint address="net.tcp://localhost:8888/evalservice" binding="netTcpBinding"
contract="EvalServiceLibrary.IEvalService" listenUriMode="Explicit">
<identity>
<dns value="localhost" />
<certificateReference storeName="My" storeLocation="LocalMachine"
x509FindType="FindBySubjectDistinguishedName" />
</identity>
</endpoint>
<endpoint address="net.pipe://localhost/evalservice" binding="netNamedPipeBinding"
bindingConfiguration="" contract="EvalServiceLibrary.IEvalService" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080/evalservice" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="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>
</configuration>
und ich Gehosteten WCF-Dienst-Bibliothek-Anwendung in der WCF-Webseite (Mein Kunde) hat eine Web.config:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="false" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<services>
<service name="EvalServiceLibrary.EvalService">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="" contract="EvalServiceLibrary.IEvalService" />
<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration="" contract="EvalServiceLibrary.IEvalService" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="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>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
InformationsquelleAutor der Frage Amr Ramadan | 2012-10-29
Du musst angemeldet sein, um einen Kommentar abzugeben.
Amr,
Das klingt wie Sie möglicherweise Probleme mit Berechtigungen in den Ordner, den Sie .svc läuft aus, bitte können Sie überprüfen und sehen, wenn Sie die folgenden Berechtigungen gibt es:
Für das Problem mit dem Protokoll-Mapping, stellen Sie bitte sicher, dass der app Pool für die IIS-Website-setup zu verwenden .net 4, als von dem, was ich verstehe-mapping-Protokoll ist nur verfügbar im .net 4.
Hoffe, das hilft
InformationsquelleAutor der Antwort Iain
Ich hatte das gleiche Problem, aber endlich kapiert, dass Sie haben, um den STANDARD-Anwendungspool .Net 4.0, nicht nur den Anwendungspool für die eigene Webseite.
InformationsquelleAutor der Antwort Valerie
Für das Problem mit dem Protokoll-Mapping, stellen Sie bitte sicher, dass der app Pool für die IIS-Website-setup zu verwenden .net 4.
InformationsquelleAutor der Antwort Jaydeep Shil
Habe ich das gleiche Problem. Durch sich ändernde Anwendungs-pool .net framework von 2.0 bis 4.o war mein problem gelöst
InformationsquelleAutor der Antwort Ravin singh D