VS2012添加服务引用不更新配置文件

Phi*_*ray 14 .net c# service-reference .net-4.5

我使用webHttpBinding创建了一个新的IIS主机WCF服务,该webHttpBinding当前在我的开发机器上的IIS Express上运行,当我尝试"添加服务引用"时,服务正确构建并且Reference.cs文件看起来很好但是web .config或app.config文件未更新.

没有收到警告或错误消息.

服务和客户端都以.Net 4.5为目标.

服务配置

  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="webInteropSecureBinding" allowCookies="false" maxBufferPoolSize="2097152" maxBufferSize="2097152" maxReceivedMessageSize="2097152">
          <security mode="Transport" />
        </binding>
      </webHttpBinding>
    </bindings>
    <services>
      <service name="PsmDataProvider.PsmProvider" behaviorConfiguration="SecureRest">
        <clear />
        <endpoint address="" binding="webHttpBinding" bindingConfiguration="webInteropSecureBinding" name="PsmProvider" contract="PsmDataProvider.IPsmProvider" listenUriMode="Explicit" behaviorConfiguration="webHttpBehavior" />
        <endpoint address="mex" binding="mexHttpsBinding" name="mex" contract="IMetadataExchange" listenUriMode="Explicit" />
        <host>
          <baseAddresses>
            <add baseAddress="https://localhost:44300/PsmProvider/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SecureRest">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="webHttpBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

客户端配置

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
</configuration>
Run Code Online (Sandbox Code Playgroud)

客户服务参考

在此输入图像描述

经过一些调查后,我发现了这些StackOverflow问题

问题1

问题2

问题3

这篇文章

博客文章

上面的每一个都指的是解开我已经完成的"引用程序集中的重用类型"标记的相同问题.

在此输入图像描述

问题是它没有解决问题.我已尝试更新和删除并重新创建服务引用,但它从不更新配置文件.

这是服务器端配置的问题吗?或者这是客户端的问题?如何更改以使代理生成按预期工作?

Phi*_*ray 7

好的,看起来在向实现WebHttpBinding WCF绑定的服务添加服务引用时存在问题.

这在Carlos Figueira博客文章中讨论