Error on <serviceHostingEnvironment multipleSiteBindingsEnabled=“true”/> while publish on IIS

回眸只為那壹抹淺笑 提交于 2020-07-17 09:47:12

问题


I have one test wcf service with default methods and web config is :

 <system.web>
    <compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior>
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>

on local IIS it works fine when i publish it.But when i try to publish on remote IIS i am getting this error :

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

Line 23:       </service>
Line 24:     </services>
**Line 25:        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>**
Line 26:  </system.serviceModel>
Line 27:  <system.webServer>

thanks in advance.


回答1:


I got the solution :

In IIS if the application is indeed an application, not a virtual directory? The icon should be something looks like the earth, not a folder's icon. If not, please convert it to an application right click on the folder select deploy and then Application.Service running with




回答2:


Make sure you browse to the actual web folder (that contains Bin, *.svc and web.config) when creating web application, not the parent folder.




回答3:


If you working framework 4.0 only one ENDpoint so write multipleSiteBindingsEnabled="False" serviceHostingEnvironment multipleSiteBindingsEnabled="False"

Using this it will be run



来源:https://stackoverflow.com/questions/9905911/error-on-servicehostingenvironment-multiplesitebindingsenabled-true-while-p

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!