Click here to Skip to main content
15,918,404 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I have created a small Windows Forms N-Tier Application and am using the following configurations in my Web.config which is in WCF Service

<configuration>

  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetframework="4.0" />
    <pages>
      <namespaces>
        <add namespace="System.Runtime.Serialization" />
        <add namespace="System.ServiceModel" />
        <add namespace="System.ServiceModel.Web" />
      </namespaces>
    </pages>
  </system.web>
  <system.servicemodel>
    <behaviors>
      <servicebehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <servicemetadata httpgetenabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <servicedebug includeexceptiondetailinfaults="true" />
        </behavior>
      </servicebehaviors>
    </behaviors>
    <servicehostingenvironment multiplesitebindingsenabled="true" />
  </system.servicemodel>
  <system.webserver>
   <modules runallmanagedmodulesforallrequests="true" />
  </system.webserver>
  
</configuration>


On the client application i.e. The Client Project I have the following in App.config file:

<<pre>?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="ZHRIS_Final_Assembly_Client.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    </sectionGroup>
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="ZHRIS_Final_Assembly_Client.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <connectionStrings>
    <add name="ZHRIS_Final_Assembly_Client.My.MySettings.NursingCouncilZimbabweConnectionString"
      connectionString="Data Source=MUNHEMBA\SQLSERVER2K8;Initial Catalog=NursingCouncilZimbabwe;Integrated Security=True"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
  </startup>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536000" maxBufferPoolSize="524288" maxReceivedMessageSize="65536000"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost/ZHRISWCFService/Service.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService"
        contract="ZHRISService.IService" name="BasicHttpBinding_IService" />
    </client>
  </system.serviceModel>
  <applicationSettings>
    <ZHRIS_Final_Assembly_Client.My.MySettings>
      <setting name="ColourTheme" serializeAs="String">
        <value>Control</value>
      </setting>
    </ZHRIS_Final_Assembly_Client.My.MySettings>
  </applicationSettings>
  <userSettings>
    <ZHRIS_Final_Assembly_Client.My.MySettings>
      <setting name="ExaminationRegisterList" serializeAs="String">
        <value>rassdk://ExaminationRegisterList.rpt</value>
      </setting>
    </ZHRIS_Final_Assembly_Client.My.MySettings>
  </userSettings>
</configuration


I would like to have the WCFService hosted by IIS on my test machine, so that when the client application is installed and run data can be accessed on the database, the same way it does on the development machine.

I have only been developing in VB.NET for a few months and would appreciate any guidelines available.

Thanks
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900