WCF user bindings / extensions cause validation error in app.config

I was curious if anyone knows how to fix this: when I add the Extension or bindingElementExtension binding to my WCF configuration, Visual Studio gives a warning about checking the schema because the extension name is not specified in the system.serviceModel schema:

Warning 1 Binding elements have an invalid nmsBinding child element. List of possible elements expected: 'BasicHttpBinding, customBinding, msmqIntegrationBinding, netPeerTcpBinding, netMsmqBinding, netNamedPipeBinding, NetTcpBinding, wsFederationHttpBinding, ws2007FederationHttpBinding, WsHttpBinding, ws2007HttpBinding, WSDualHttpBinding, mexHttpBinding, mexHttpsBinding, mexNamedPipeBinding, mexTcpBinding, WebHttpBinding, netTcpContextBinding, wsHttpContextBinding, basicHttpContextBinding'p>

This may be a dumb question, but is there a way to “dynamically” register these extensions with the visual studio so that they check? I thought I could remove xsd somewhere in the visual studio configurations, but I would prefer not to do this if there is some other magic way.

This is what my serviceModel configurator looks like:

<system.serviceModel>

    <services>
        <service name="Zed.Apache.NMS.WCF.Test.Server.TestApacheNMSService">
            <endpoint
                name="nmsServiceEndpoint"
                address="tcp://localhost:61616"
                binding="nmsBinding"
                bindingConfiguration="defaultNmsBinding" 
                contract="Zed.Apache.NMS.WCF.Test.Server.ITestApacheNMSService" />
        </service>
    </services>

    <bindings>
        <nmsBinding> <!-- VALIDATION ERROR HERE -->
            <binding name="defaultNmsBinding"
                     destination="TestApacheNMSQueue"
                     destinationType="Queue" />
        </nmsBinding>
    </bindings>

    <extensions>
        <bindingExtensions>
            <add name="nmsBinding"
                 type="Apache.NMS.WCF.NmsBindingCollection, Zed.Apache.NMS.WCF, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
        </bindingExtensions>
    </extensions>

</system.serviceModel>
+3
source share
1 answer

I believe that VS2008 uses the file "C: \ Program Files \ Microsoft Visual Studio 9.0 \ xml \ Schemas \ DotNetConfig.xsd" (with the default setting) to check the configuration file. You can modify this file or specify a different scheme in the "Properties" section for the configuration file.

However, if you only get warnings about development time, this may not be worth the trouble.

+3
source

Source: https://habr.com/ru/post/1702428/


All Articles