简体   繁体   English

找不到配置绑定扩展“system.serviceModel/bindings/basicHttpsBinding”

[英]Configuration binding extension 'system.serviceModel/bindings/basicHttpsBinding' could not be found

I am getting this error when I try to navigate to my .svc file.当我尝试导航到我的 .svc 文件时出现此错误。 It appears that it's not finding my basicHttpsBinding;看来它没有找到我的 basicHttpsBinding; here's that section of my web.config:这是我的 web.config 的那部分:

<system.serviceModel>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
  <add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/> 

I tried searching through Google but any answers I could find didn't seem to apply to what I'm doing here.我尝试通过谷歌搜索,但我能找到的任何答案似乎都不适用于我在这里所做的事情。 Most of what I found talked about custom bindings, of which I don't think I have any.我发现的大部分内容都是关于自定义绑定的,我认为我没有。 I'm honestly not even close to sure what could be causing this error, so any help would be greatly appreciated.老实说,我什至不确定是什么导致了这个错误,所以任何帮助都将不胜感激。 If you need more information let me know and I'll add it.如果您需要更多信息,请告诉我,我会添加。

BasicHttpsBinding is a new binding in .NET 4.5, therefore you cannot use it in a 4.0 application. BasicHttpsBinding是 .NET 4.5 中的新绑定,因此您不能在 4.0 应用程序中使用它。 Either you remove the protocolMapping or you use another binding such as basicHttpBinding or wsHttpBinding .要么删除 protocolMapping,要么使用其他绑定,例如basicHttpBindingwsHttpBinding

When you configure SSL in IIS, this should work as well.当您在 IIS 中配置 SSL 时,这应该也可以工作。

If you have a similar scenario as mine where the Visual Studio-generated Web.config has the following configs:如果您有与我类似的情况,其中 Visual Studio 生成的Web.config具有以下配置:

  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <pages controlRenderingCompatibilityVersion="4.0" />
  </system.web>

... add <httpRuntime targetFramework="4.5" /> ... 添加<httpRuntime targetFramework="4.5" />

So that you now have所以你现在有

  <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <pages controlRenderingCompatibilityVersion="4.0" />
    <httpRuntime targetFramework="4.5" /> 
  </system.web>

I also went on to remove <pages controlRenderingCompatibilityVersion="4.0" /> with no impact in my situation.我还继续删除<pages controlRenderingCompatibilityVersion="4.0" />而对我的情况没有影响。

web.config中删除protocolMapping部分,它将起作用。

if you use framework 4.5 or up you can add below code to your web.config如果您使用框架 4.5 或更高版本,您可以将以下代码添加到您的 web.config

The following attributes can be set on the tag.可以在标签上设置以下属性。

  <system.Web>
    <httpRuntime targetFramework="4.8" />
  </system.Web>

On VS2022, I explicitly specified the targetFramework attribute, as below:在 VS2022 上,我明确指定了 targetFramework 属性,如下所示:

From this由此

<httpRuntime/>

To this对此

<httpRuntime targetFramework="4.8"/>

...and it works well! ...而且效果很好!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 找不到配置绑定扩展名&#39;system.serviceModel / bindings / pollingDuplexHttpBinding&#39; - Configuration binding extension 'system.serviceModel/bindings/pollingDuplexHttpBinding' could not be found system.serviceModel / bindings / wsHttpBinding处的绑定没有配置的绑定 - The binding at system.serviceModel/bindings/wsHttpBinding does not have a configured binding system.serviceModel / bindings / wsHttpBinding处的绑定没有……错误 - The binding at system.serviceModel/bindings/wsHttpBinding does not have… error 在 .NET Core 项目中找不到 System.ServiceModel - System.ServiceModel not found in .NET Core project System.ServiceModel引用 - System.ServiceModel References System.ServiceModel消失 - System.ServiceModel disappear System.ServiceModel缺失 - System.ServiceModel missing 无法读取配置节“ system.ServiceModel”,缺少节声明 - The configuration section 'system.ServiceModel' cannot be read, missing section declaration 使用ConfigurationManager加载System.ServiceModel配置节 - Loading System.ServiceModel configuration section using ConfigurationManager 为WCF数据服务客户端生成System.ServiceModel配置部分 - Generating the System.ServiceModel configuration section for WCF Data Service client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM