17
votes

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.

3
Is the machine you are publishing to a different environment to the machine it works on. Make sure of the .NET Framework installed and IIS having the required settinsg - Rajesh

3 Answers

16
votes

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

3
votes

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
votes

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

Using this it will be run