12

嗨,我一直在尝试解决我的问题,但是对此无能为力。

问题是

http://localhost/productservice/service.svc当在我的浏览器中输入这个地址时,它给了我 503 Service Unavailable 错误

当我从 VS 2010 运行我的代码时,它给了我

位于http://localhost/ProductsService/Service.svc的 HTTP 服务太忙。例外。

ProductService 在带有 ApplicationPoolIdentity 的 ASP.NET v4.0 集成应用程序池中运行。

我只是不知道我需要做什么!

(Windows 7 家庭版和 IIS7)

使用了 basicHttpBinding

服务器端配置是

<?xml version="1.0"?>
<configuration>
    <connectionStrings>
        <add name="AdventureWorksEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=PINCHY\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient"/>
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
            <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"/>
    </system.serviceModel>
    <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>
</configuration>

客户端 app.config 是

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <basicHttpBinding>
                <binding name="BasicHttpBinding_IProductsService" closeTimeout="00:01:00"
                    openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
                    <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                    <security mode="None">
                        <transport clientCredentialType="None" proxyCredentialType="None"
                            realm="" />
                        <message clientCredentialType="UserName" algorithmSuite="Default" />
                    </security>
                </binding>
            </basicHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:80/ProductsService/Service.svc"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IProductsService"
                contract="ProductsService.IProductsService" name="BasicHttpBinding_IProductsService" />
        </client>
    </system.serviceModel>
</configuration>

任何帮助将不胜感激谢谢

4

5 回答 5

22

有同样的问题,但原因不同。在 IIS(左侧面板)中,单击应用程序池并确保您选择的 ASP.NET 版本正在实际运行。我的因为某种原因关闭了。

于 2013-03-26T15:26:47.367 回答
8

我只是有同样的问题。对我来说,问题原来是密码无效。我的密码最近更改了,IIS 的应用程序池使用旧密码。更新密码后,应用程序再次运行。

希望有帮助。

于 2011-11-04T17:26:04.513 回答
3

我也遇到了同样的问题,解决方法是,

在 IIS 中单击默认网站下的 ProductsService 网站。在操作窗格下的右侧,单击高级设置。检查 Enabled Protocol 属性,该属性的值应以逗号分隔,例如: http,net.tcp 。实际上,我输入了分号而不是逗号,并且我曾经遇到过您所面临的相同异常。尝试替换分号哪个逗号。我认为它应该工作。

于 2012-05-25T05:12:06.173 回答
2

我们的团队遇到了同样的问题,503 Service Unavailable. 在我们的例子中,应用程序池很好,(身份设置正确并且应用程序池已启动)。

经过一些评估,我们发现在保留端口 80 的服务器上安装了一个基于 WCF 的服务。使用该netsh http命令我们能够看到 url 保留。

netsh http show urlacl

Reserved URL            : http://+:80/

以下链接证明很有帮助:http: //blogs.msdn.com/b/webtopics/archive/2010/02/17/a-not-so-common-root-cause-for-503-service-unavailable.aspx

于 2016-01-14T13:20:29.313 回答
1

我在 IIS 7 中不断收到 503 错误,在 localhost 上运行 .NET 4.0 网站。我对此颇为沾沾自喜,因为我所要做的就是单击左侧窗格中的应用程序池,您会在其中看到列出的站点和应用程序池。果然,相关的应用程序池总是停止,我只是重新启动它。然而,今天(我回到这个问题的原因)这并没有解决问题。就我而言,我有一个包含一些公共页面的网站,然后是 2 个受密码保护的应用程序。只有一个应用程序给出了 503 错误。我选择了应用程序并单击了高级设置,然后意识到问题出在应用程序池上。它指向 DefaultAppPool 而不是整个网站的应用程序池。当我纠正它时,网站的所有 3 个区域都重新开始正常工作。所以,综上所述,503错误可能是由停止的应用程序池引起的。只需确保重新启动正确的应用程序池以使您的网站再次运行。

于 2013-06-26T08:16:31.060 回答