Near Shore Consulting Ltd.
View Yves Rochon's profile on LinkedIn
Our Blog
Our Blog
Reading the Compilation debug at run-time
Location: BlogsNear Shore Blog    
Posted by: admin 10/13/2006 5:56 AM

To achieve 100% code coverage while writing unit tests for a project, I needed to look at the value of the debug attribute of the /system.web/compilation element in the web.config file.

Here are a couple of lines of code you can use to load the value from a web method in a web service class at run-time:

Dim section As CompilationSection = CType( WebConfigurationManager.GetWebApplicationSection("system.web/compilation"), CompilationSection)
Dim debugstatus As String = section.Debug.ToString()

Permalink |  Trackback
Blog
Near Shore Consulting  |  Terms Of Use  |  Privacy Statement