[Mono-list] ConfigurationManager.ConnectionStrings is NULL

"Andrés G. Aragoneses" knocte at gmail.com
Sun Mar 30 11:30:07 UTC 2014


On 28/03/14 15:50, weng nanshan wrote:
> Hi,all
>  
> I am runing a web application on mono. There is a strange problem.
> I define a database connection string in Web.config file, as the following:
>  
> <connectionStrings>
>     <add name="MySqlConnectionStr"
> connectionString="server=localhost;database=dbmy;password=123456;user=root;port=3306;"/>
> </connectionStrings>
>  
> And I want to get the connection string in program, using
> "ConfigurationManager.ConnectionStrings["MySqlConnectionStr"]".
> It fail! And I find that
> ConfigurationManager.ConnectionStrings["MySqlConnectionStr"] is NULL. So
> I can't get the connection string.
>  
> The program is written in .net2.0, and run well on Windows and MS .Net
> framework. But on CentOS6.2 and Mono, there is the problem above.
> I test Mono2.6.7, Mono 2.8, Mono2.10.6, there is the same problem.
>  
> I try many way to solve the problem, but fail!
>  
> Anyone kind to help me! Any suggestion is welcome!

Mono 2.x is very old, upgrade please.

If you still hit the problem in Mono 3.2.x, then maybe you're hitting a
similar (or same) bug as https://bugzilla.xamarin.com/show_bug.cgi?id=11972




More information about the Mono-list mailing list