ConfigurationManager.ConnectionStrings returns someones elses values!!

ConfigurationManager.ConnectionStrings returns someones elses values!!

Old forum URL: forums.lhotka.net/forums/t/1692.aspx


rxelizondo posted on Sunday, November 05, 2006

I was under the impression that in order to have the application run as a remoting application, I needed to create a Web.Config file that included the connection strings on it as show below:

 

  <connectionStrings>

    <add name="PTracker"

                   connectionString="BLA BLA BLA"

                   providerName="System.Data.SqlClient" />

    <add name="Security"

                   connectionString="BLA BLA BLA"

                   providerName="System.Data.SqlClient" />

  </connectionStrings>

 

This way, I could use the ConfigurationManager object to retreive those values the same way it’s shown in the book:

 

string myString = ConfigurationManager.ConnectionStrings["PTracker"].ConnectionString;

 

Well, apparently I was wrong, turns out that when I place the config file on the web and I run the application, the ConfigurationManager is returning someone elses values! I suspect that these values belong to some master Web.Config file but I have no idea.

 

At the moment, the application is running on a shared hosted environment so I am wondering if the hosting company configured the IIS server is such a way that I get the wrong readings.

 

The other reason why I may be getting the wrong readings is because I am not supposed to get the connection string the way I am doing it right now but I looked at the book and I think this is the proper way.

 

Could someone please help me and tell me what’s going on?

 

Thank you.

rxelizondo replied on Tuesday, November 07, 2006

Never mind, I am an idiot, I forgot to up date the old CSLA 1.X Config file to reflect the changes for the new CSLA 2.X. Turns out, I wasn’t remoting at all,  I was just fantasizing that I was remoting so I was picking the values from the Web.Config file from my computer. Embarrassed [:$]

Bayu replied on Tuesday, November 07, 2006

rxelizondo:

Never mind, I am an idiot, I forgot to up date the old CSLA 1.X Config file to reflect the changes for the new CSLA 2.X. Turns out, I wasn’t remoting at all,  I was just fantasizing that I was remoting so I was picking the values from the Web.Config file from my computer. Embarrassed [:$]




LOL Big Smile [:D]

When I read your post I was baffled. I actually have been trying to reproduce your thing, but I couldn't, so I just thought this was beyond me.  Tongue Tied [:S]

Welcome to the club. I find myself in these situations from time to time as well .... let's say that at least they serve a good laugh. Wink [;)]

Bayu

ajj3085 replied on Tuesday, November 07, 2006

No worries, everyone here has done something like that.  Glad you found the solution though.

Copyright (c) Marimer LLC