Link to home
Start Free TrialLog in
Avatar of Olukayode Oluwole
Olukayode OluwoleFlag for Canada

asked on

How can i confirm and ensure that my application reads and uses information in my appconfig file

I have a feeling that my app is not reading my appconfig file

I know this because i tried 2 IP address for the local server (127.0.0.1)  and an external server  (99.99.99.99)  (Please note that 99.99.99.99  is just a dummy)


in the connection string section (see below)

 <connectionStrings>
    <add name="Tournaments" connectionString="Host = 99.99.99.99; Database = tournaments; Port = 5432; Username = postgres" />
  </connectionStrings>

on both runs it was only connecting to the local server 127.0.0.1 and running my userprofile   form

I tried to debug the application starting with the first line in program.cs

and each time it run my userprofile  form connectining to  127.0.0.1.  I dont even know where it picks 127.0.0.1  when i am using the external server

How can i confirm and ensure that my application recognises and uses the connection string

in the appconfig file.

below is my program.cs  and appconfig   scripts


 
 static void Main()
        {
            DatabaseType db = default(DatabaseType);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            GlobalConfig.InitializeConnections(true, db);
            Application.Run(new UserProfileForm());
          
        }

Open in new window


<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <appSettings>
    <add key="filePath" value="C:\data\TournamentTracker" />
    <add key="greaterWins" value="1" />
    <add key="senderEmail" value="techsupport@datatronicsnig.com" />
    <add key="senderDisplayName" value="Crystal Accounts Admin" />
    <add key="smsAccountSid" value="nicetry" />
    <add key="smsAuthToken" value="nope" />
    <add key="smsFromPhoneNumber" value="5551212" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
  <connectionStrings>
    <add name="Tournaments" connectionString="Host = 99.99.99.99; Database = tournaments; Port = 5432; Username = postgres" />
  </connectionStrings>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network">
        <network host="127.0.0.1" userName="techsupport@datatronicsnig.com" password="oluwole" port="25" enableSsl="false" />
      </smtp>
    </mailSettings>
  </system.net>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
  </startup>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.web>
    <membership defaultProvider="ClientAuthenticationMembershipProvider">
      <providers>
        <add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 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>

Open in new window


I will be grateful for any help

Thanks

Olukay
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

1. on the machine running the database is the firewall open for the port 

2. on the router are you port forwarding from the wan to the machine using the appropriate protocol and to the machine ip address running the database 

ASKER CERTIFIED SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Olukayode Oluwole

ASKER

Thats correct

I am using postgreSQL   running on windows 10 my laptop  

and  PostgreSQL running on Ubuntu on the server.

I will try  inotify-tools  and get back though i dont know how to

"Camp on your config file directory in one window ".

Let me get Inotify-tools and instal firts

Regards


Olukay
Downloaded  inotify-tool from  SourceForge  ( see screen)

User generated image
Its a zipped file

It wont unzip on my PC .

Its  asking which app should be used to open it

What app will this be ?


Olukay
Thanks