Web.config - ConnectionString property has not been initialized

大兔子大兔子 提交于 2019-12-23 18:04:16

问题


I have a number of ASP.NET applications which run fine for months, then stop dead with the message: "....ConnectionString property has not been initialized". The application uses strongly typed datasets, with the connection string stored in the web.config file. If you just search the web for the message in the subject, you get all sorts of answers relating to incorrectly configured web.config files. In this case, however, the connection works - then randomly stops working.

The resolution, I have found, is to open the web.config file in Notepad and Save the file (without making any changes), or rebooting the server (the customer's IT dept did this). Once you save the file or reboot, the website continues to run normally.

I have seen this behaviour at several sites with several of our applications, but can't seem to find a resolution. Are there any Microsoft KBs about this? Is it a bug in the ASP.NET stack, or is there a problem with the way I am using the DAL?


回答1:


Is there maybe some server environmental factor such as permissions being randomly applied across your web root folder?



来源:https://stackoverflow.com/questions/6827035/web-config-connectionstring-property-has-not-been-initialized

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!