Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

iis

wcf

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.

like image 612
Sunny Avatar asked Mar 28 '12 10:03

Sunny


2 Answers

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

like image 50
Sunny Avatar answered Oct 09 '22 22:10

Sunny


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

like image 20
Peter Avatar answered Oct 09 '22 22:10

Peter