开发者

How can I enable intellisense in an associated config file using System.ServiceModel

All the questions I've found referring to intellisense seem to refer to custom configuration settings. i'开发者_开发技巧m trying to get intellisense on a .net standard section that's been moved out of web.config into service.config.

Is there a way?


Firstly you need to have Visual 2012 or higher. This is ensure that you have the latest schema files installed and references.

but mostly its all about how to create your root web.config or app.config file.

in your root config (app.config/web.config) you need to specify WCF service model associated config files like this

  <system.serviceModel>
    <behaviors configSource="Configuration\behaviors.config"/>
    <bindings configSource="Configuration\bindings.config" />
    <client configSource="Configuration\client.config"/>
    <services configSource="Configuration\services.config" />
  </system.serviceModel>

then make sure your, say, bindings.config file starts with the behaviors node

<bindings>
  <basicHttpBinding>
    <binding name="HoHo" messageEncoding="Text">
      <security mode="None"/>
    </binding>
  </basicHttpBinding>
</bindings>

using configSource can really help keep the configuration files readable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜