【发布时间】:2014-08-24 22:09:14
【问题描述】:
我刚刚创建了一个 WCF 网站 .net 3.5,我认为通过创建一个默认站点就足以复制。但它很难复制。我有 VS2013 以及从我的 MSDN 下载的所有更新,并且我有 Windows 8.1。
我必须说,几个月前我在一些机器上遇到了这个问题,所以其他机器帮忙,我假设它与安装有关,但现在它出现在 3 台不同的机器上,其中一台它们使用 Windows 8。它们都是 64 位的。
服务做得很完美,因为到目前为止我的交付和生产都是如此,它运行顺利。
现在我创建了一个基本的 ASP.net aqlso .net 3.5。并尝试添加服务引用,但添加失败后显示以下消息。
下载时出错 'http://localhost:40226/HabeasDataService.svc/_vti_bin/ListData.svc/$metadata'。 请求失败,HTTP 状态为 404:未找到。 元数据包含无法解析的引用:“http://localhost:40226/HabeasDataService.svc”。吨 远程服务器返回意外响应:(405) 方法不允许。 远程服务器返回错误:(405) Method Not Allowed。 如果在当前解决方案中定义了服务,请尝试构建解决方案并再次添加服务引用。
当然,我使用 clena 进行了重建,但问题仍然存在。
服务的配置如下
<system.serviceModel>
<services>
<service behaviorConfiguration="ServicesLayer.Service1Behavior"
name="ServicesLayer.Service1">
<endpoint
bindingConfiguration="BigHttpBinding"
name="BasicHttp"
address=""
binding="basicHttpBinding"
contract="ServicesLayer.IHabeasDataService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServicesLayer.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false 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="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding
name="BigHttpBinding"
maxBufferSize="65536"
maxBufferPoolSize="65536"
maxReceivedMessageSize="65536"
transferMode="Buffered">
<readerQuotas
maxDepth="64"
maxStringContentLength="65536"
maxArrayLength="65536"
maxBytesPerRead="4096"
maxNameTableCharCount="32768"/>
</binding>
</basicHttpBinding>
</bindings>
</system.serviceModel>
我注意到这一行:
<!-- To avoid disclosing metadata information, set the value below to false before deployment -->
<serviceMetadata httpGetEnabled="true"/>
并尝试两种配置,仍然是同样的错误。
当我尝试通过单击浏览器中的视图来运行 svc 文件时,我收到了一个类似这样的 404.17 错误。
这非常令人沮丧,因为它完全阻碍了开发。
注意 与 IIS 相关的所有内容都可能有用,但请记住它是 IIS Express。无论如何切换到本地 IIS,仍然失败,但正如我所说。在生产服务器上它是薄荷的
【问题讨论】:
-
404.17 它可能指向安装错误。检查此stackoverflow.com/questions/87107/… 以及该站点在哪个框架版本上运行
-
该站点位于 .net 3.5 上。您提供的解决方案是针对 IIS 的。我还在开发时间,我正在使用 VS2013,并且使用 IIS Express 进行调试。在那里我找到了一个链接,我会检查一下
-
您是从
bin或debug文件夹中添加一些引用dll 吗?还是在任何地方都使用 Windows 身份验证/模拟? -
不,我只是通过菜单选项做了标准程序,添加服务参考,发现,双击显示方法和BOOM我在问题中发布的错误出现
-
您找到解决方案了吗?我有一个相同的问题
标签: wcf .net-3.5 visual-studio-2013 iis-express http-error