visual studio publicar c# wcf web-services iis wcf-binding

c# - studio - Error en la asignación de protocolo al hospedar un servicio WCF en IIS



wcf iis windows 10 (4)

Amr,

Parece que puede haber problemas de permisos en la carpeta desde la que se ejecuta .svc, por favor, puede verificar y ver si están disponibles los siguientes permisos:

  • / IIS_IUSERS
  • / IIS_IUSR --- Si ejecuta el servicio web en modo anónimo

Para el problema con el Mapeo de protocolo, asegúrese de que el grupo de aplicaciones que está utilizando para el sitio de IIS esté configurado para usar .net 4, por lo que entiendo que la asignación de protocolos solo está disponible en .net 4.

Espero que esto ayude

Desarrollé un servicio WCF simple con VS 2010. Y aloje en el sitio web predeterminado en IIS agregando la aplicación y establecí la ruta física

E intenté explorar el archivo .svc, me da el siguiente error:

" La sección de configuración ''protocolMapping'' no se puede leer porque falta una declaración de sección "

y probé muchas soluciones pero no funciona

Creé WCF Service Library tiene una App.config con esto:

<?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>

y Hospedeé la aplicación Biblioteca de Servicios WCF en el sitio web de WCF (Mi Cliente) tiene un Web.config con esto:

<?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>


He enfrentado el mismo problema. Al cambiar el grupo de aplicaciones .NET Framework de 2.0 a 4.o se resolvió mi problema


Para el problema con la asignación de protocolos, asegúrese de que el grupo de aplicaciones que está utilizando para el sitio de IIS esté configurado para usar .net 4.


Tuve el mismo problema, pero finalmente descubrí que debe configurar el grupo de aplicaciones DEFAULT en .Net 4.0, no solo el grupo de aplicaciones para el sitio web individual.