iis express .svc 无法访问该文件。它给出了文件未找到的错误

问题描述 投票:0回答:1

在 .net 项目中,我在 localhost 上收到 svc 文件未找到错误。我做了IIS设置。 http 激活与我还查看了我的 web.config 文件,但没有任何效果。

我需要自己解决这个问题,因为我正在从另一台计算机向该服务发出请求。

     <handlers>
          <add name="svc-integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler" resourceType="File" preCondition="integratedMode" />
     
        </handlers>
  <system.serviceModel>
    <services>
      <service name="Clinic_Admin.Areas.Mobil.Service.ClinicService">
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webBinding" name="ClinicRestSoap" contract="Clinic_Admin.Areas.Mobil.Service.IClinicService" />
          
       
      </service>

      <!--<service name="Clinic_Admin.Areas.Mobil.Service.ClinicService" behaviorConfiguration="ServiceBehavior">
        <endpoint  binding="wsHttpBinding" bindingConfiguration="TransportSecurity" name="ClinicRestSoap" contract="Clinic_Admin.Areas.Mobil.Service.IClinicService" />


      </service>-->
      
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="TestServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>

       
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100" maxConcurrentInstances="100" />
          <dataContractSerializer maxItemsInObjectGraph="2147483646" />
        </behavior>
        
        <!--<behavior name="EntryServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <useRequestHeadersForMetadataAddress>
            <defaultPorts>
              <add scheme="http" port="80" />
              <add scheme="https" port="443" />
            </defaultPorts>
          </useRequestHeadersForMetadataAddress>
         
        </behavior>-->


        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
    <bindings>

      <wsHttpBinding>
        <binding name="TransportSecurity">
      
          <security mode="None" />
        </binding>
      </wsHttpBinding>

      <!--<wsHttpBinding>
        <binding name="TransportSecurity">
          <security mode="Transport">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="Certificate" algorithmSuite="Default" />
          </security>
        </binding>
      </wsHttpBinding>-->

      <webHttpBinding>
        <binding name="webBinding" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" transferMode="Streamed">

          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
          <security mode="Transport"></security>

        </binding>
      </webHttpBinding>

      <!--<webHttpBinding>
        <binding name="webHttp" />
      </webHttpBinding>-->
    </bindings>
  </system.serviceModel>

使用 WCF 选择 IIS 上的功能:

enter image description here enter image description here

处理程序映射:

enter image description here

.net visual-studio wcf web-config iis-express
1个回答
0
投票

请检查该项目的 IIS 应用程序池是否具有以下提到的设置: 应用程序池设置

要为较新版本的 .Net 项目运行 SVC,请将托管管道模式设置为集成非常重要。

© www.soinside.com 2019 - 2024. All rights reserved.