Wcf 错误在<;serviceHostingEnvironment multipleSiteBindingsEnabled=";“真的”/&燃气轮机;在IIS上发布时

Wcf 错误在<;serviceHostingEnvironment multipleSiteBindingsEnabled=";“真的”/&燃气轮机;在IIS上发布时,wcf,iis,Wcf,Iis,我有一个带有默认方法的测试wcf服务,web配置为: <system.web> <compilation debug="true" targetFramework="4.0"/> </system.web> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior>

我有一个带有默认方法的测试wcf服务,web配置为:

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

在本地IIS上发布时,它可以正常工作。但当我尝试在远程IIS上发布时,我遇到以下错误:

描述:处理过程中发生错误 服务此请求所需的配置文件。请检查 下面是具体的错误详细信息,请修改您的配置文件 适当地

解析器错误消息:使用注册为的节是错误的 allowDefinition='MachineToApplication'超出应用程序级别。这 错误可能是由于未将虚拟目录配置为 IIS中的应用程序

Line 23:       </service>
Line 24:     </services>
**Line 25:        <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>**
Line 26:  </system.serviceModel>
Line 27:  <system.webServer>
第23行:
第24行:
**第25行:**
第26行:
第27行:
提前感谢。

我得到了解决方案:


在IIS中,应用程序是否确实是应用程序而不是虚拟目录?图标应该是看起来像地球的东西,而不是文件夹的图标。如果没有,请将其转换为应用程序右键单击文件夹,然后选择deploy and application.Service running with

,如果您使用的是framework 4.0,则仅使用一个端点,因此write multipleSiteBindingsEnabled=“False” serviceHostingEnvironment multipleSiteBindingsEnabled=“False”


使用此选项,在创建web应用程序时,它将运行

请确保浏览到实际的web文件夹(其中包含
Bin
*.svc
web.config
),而不是父文件夹。

是要发布到与其工作的机器不同环境的机器。请确保安装了.NET Framework,并且IIS具有所需的设置。以前它正在使用虚拟目录,不确定更改了什么-可能是我们正在使用的某些.NET功能需要虚拟目录作为“应用程序”。感谢您提供的解决方案如何判断哪个虚拟目录应该是IIS中的应用程序?