config中如下配置:
<connectionStrings>
<add name="SQLConnString" connectionString="Data Source=192.168.1.16;Initial Catalog=***;User ID=***;Password=***" providerName="System.Data.SqlClient"/>
</connectionStrings>
CS代码:(DAL层)
ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString;
用WEB 页面调用程序可以正常运行,但用单元测试的时候,ConfigurationManager.ConnectionStrings["SQLConnString"].ConnectionString获取的值为NULL,哪个大哥给小弟指教下!谢谢了
泛舟湖上清波郎朗