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()