I have created very simple ASP.NET web site with web service that is placed in an IIS application pool. Port and address are defined in the site settings of IIS. Web.config is very simple:

<configuration>
    <system.web>
      <compilation debug="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>

It even does not have information regarding service.

I have looked at other samples of web.config and found them much more large:

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="jsonHttp" />

      </webHttpBinding>
      <basicHttpBinding>
        <binding name="basicHttp"/>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="HelloDeviceCntrl.AaaComModule.AaaComModule">
        <endpoint address="http://localhost:8001/json/Aaacom/" binding="webHttpBinding" bindingConfiguration="jsonHttp" contract="HelloDeviceCntrl.AaaComModule.IAaaComModule" behaviorConfiguration="JsonEndpointBehaviour"/>
        <endpoint address="http://localhost:8001/basic/Aaacom/" binding="basicHttpBinding" behaviorConfiguration="DefaultEndpointBehaviour" contract="HelloDeviceCntrl.AaaComModule.IAaaComModule" />
      </service>
      <service name="HelloDeviceCntrl.BaaModule.BaaModule">
        <endpoint address="http://localhost:8001/json/Baa/" binding="webHttpBinding" bindingConfiguration="jsonHttp" behaviorConfiguration="JsonEndpointBehaviour" contract="HelloDeviceCntrl.BaaModule.IBaaModule"/>
        <endpoint address="http://localhost:8001/basic/Baa/" binding="basicHttpBinding" behaviorConfiguration="DefaultEndpointBehaviour" contract="HelloDeviceCntrl.BaaModule.IBaaModule"/>
      </service>
      <service name="HelloDeviceCntrl.ABCModule.ABCModule" behaviorConfiguration="ABCModuleServiceBehaviour">
        <endpoint address="http://localhost:8001/json/ABC/" binding="webHttpBinding" bindingConfiguration="jsonHttp" contract="HelloDeviceCntrl.ABCModule.IABCModule" behaviorConfiguration="JsonEndpointBehaviour"/>
        <endpoint address="http://localhost:8001/basic/ABC/" binding="basicHttpBinding" behaviorConfiguration="DefaultEndpointBehaviour" contract="HelloDeviceCntrl.ABCModule.IABCModule"/>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <!--<serviceMetadata httpGetEnabled="true" />-->
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="ABCModuleServiceBehaviour">
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
          <serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8001/ABC/get"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="JsonEndpointBehaviour">
          <webHttp defaultOutgoingResponseFormat="Json" defaultBodyStyle="Wrapped" faultExceptionEnabled="true" automaticFormatSelectionEnabled="true" />
        </behavior>
        <behavior name="DefaultEndpointBehaviour">
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
  </system.serviceModel>
  <appBaa>
    <add key="anykey1" value="anyvalue1" />
    <add key="ClientBaaProvider.ServiceUri" value="" />
  </appBaa>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, serviceUri="" />
      </providers>
    </membership>
    <roleManager defaultProvider="ClientRoleProvider" enabled="true">
      <providers>
        <add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
      </providers>
    </roleManager>
  </system.web>
</configuration>

I got several questions while comparing both configs.

Why my config has no information about port and address? Can I manually add to web.config and overload existing value in site settings?

Should all these configuration lines be edited manually or appended according some project settings?

Related posts

Recent Viewed