无法在IIS6中启动Ado.Net数据服务

时间:2010-09-03 12:21:06

标签: .net asp.net .net-4.0 wcf

我正在尝试在我的IIS上运行示例WCF ADO.Net Data Sertice,它给我留言

 The resource cannot be found.

    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /testing_wcf_service/WcfDataService1.svc/

Web配置文件

<?xml version="1.0"?>
<configuration>
    <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
            </assemblies>
        </compilation>
    </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" aspNetCompatibilityEnabled="false">
            <!--<baseAddressPrefixFilters>
                <clear/>
                <add prefix="http://localhost/Testing_Wcf_Service/"/>
            </baseAddressPrefixFilters>-->
        </serviceHostingEnvironment>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
    <validation validateIntegratedModeConfiguration="false" />
    <security>
      <authentication>
        <anonymousAuthentication enabled="true" />
        <basicAuthentication enabled="false"/>
      </authentication>
    </security>
    </system.webServer>
    <connectionStrings>

    </connectionStrings>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing" >
        <listeners>
          <add name="ServiceModelTraceListener"/>
        </listeners>
      </source>

      <source name="System.ServiceModel" switchValue="Verbose,ActivityTracing"                >
        <listeners>
          <add name="ServiceModelTraceListener"/>
        </listeners>
      </source>
      <source name="System.Runtime.Serialization" switchValue="Verbose,ActivityTracing">
        <listeners>
          <add name="ServiceModelTraceListener"/>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="App_tracelog.svclog"
         type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
         name="ServiceModelTraceListener" traceOutputOptions="Timestamp"/>
    </sharedListeners>
  </system.diagnostics>
</configuration>

这是一个很好的视觉工作室2010,但不是从IIS开始,我搜索了很多,但找不到解决方案。

任何人都可以指导我朝正确的方向前进。

提前谢谢。

1 个答案:

答案 0 :(得分:0)

404错误是找不到文件。

  • 可能是文件不在您期望的位置。尝试浏览IIS并查看是否可以找到该文件。
  • 可能是IIS不知道SVC文件是怎么回事。是否安装了.Net框架的正确版本?是否注册了类型。
  • 从您发布的配置中,我看不到您正在使用的绑定。 IIS 6支持的绑定是有限的。
  • 这可能是客户端中的地址有问题。错误消息中svc之后的斜杠“/”可能导致问题。