[Mono-list] ConfigurationManager.ConnectionStrings is NULL

weng nanshan nsweng at gmail.com
Fri Mar 28 14:50:57 UTC 2014


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:

    <add name="MySqlConnectionStr" connectionString="server=localhost;database=dbmy;password=123456;user=root;port=3306;"/>

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!

Thanks very much!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20140328/76b7f3f4/attachment.html>

More information about the Mono-list mailing list