Last post Feb 02, 2012 07:01 PM by satajl
Feb 02, 2012 12:38 AM|satajl|LINK
Could any one of you please help me out in finding the root cause for an issue that I faced very recently. The issue is explained below:
I have a web application. And in the web.config for this application I have included a key called "idpssourl" and assigned it a value. Now I am adding a class library(dll) reference in this web application. In that dll I am trying to read the value for "idpssourl"
using the below statement:
This was working fine sometimes. But very often the statement returns a NULL value and because of that when I try to load a page, I got HTTP 403 forbidden error.
I changed the above statement as below:
and the issue got solved. Any idea on why this happened? It would be helpful for me if I find the root cause. I spent almost a weeks time in getting this issue fixed.
Feb 02, 2012 12:53 AM|N_EvilScott|LINK
The WebConfigurationManager provides access to be able to edit the web.config file at design time, where as ConfigurationManager is generally just read-only.
Also its worth noting that using the WebConfigurationManager generally requires higher permissions due to it requesting Write Access, and not just Read Access. This is sometimes an issue developers come accross that can make it fail.
Feb 02, 2012 07:01 PM|satajl|LINK
@N_EvilScott...Buddy...I completely agree with you as that was my thought too. We can finalize that this was the root cause unless and until we find some other member coming out with a different explanation. Thanks buddy :)