Welcome to MSDN Blogs Sign in | Join | Help

Reading the web.config file in SQL Reporting Services

The .NET Framework v2.0 gives us the ability to (easily) read the web.config file of our applications for information like <appSettings> using the System.Configuration and System.Web.Configuration namespaces: This probably isn't news to most of you.

Will this work with Reporting Services? Yes, with a caveat around security. Remember that you'll be writing custom code to do this work...and custom code (whether embedded code behind your report or in an custom assembly) won't have the necessary permissions to run under SSRS unless you first grant them in rssvrpolicy.config.

 How do you do this, you ask? See this article:

 http://support.microsoft.com/kb/842419

Published Tuesday, October 17, 2006 1:12 PM by russch

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Reading the web.config file in SQL Reporting Services

Thursday, November 16, 2006 11:08 AM by Rachit Patel

Do you know how to add your appSettings for your Custom Data Extension when you add a new reference for CDE in ReportingServices (as per your article)?

i.e I've my setting to reference to some xml file. I tried to add a new appSetting section under ReportServer's web.config, it killed the whole app. How do I add the reference and where?

Thx.

# re: Reading the web.config file in SQL Reporting Services

Wednesday, November 22, 2006 6:01 AM by russch

I had to fight this myself and didn't come up with a good answer...I think I ended up just being lame and using machine.config.

# re: Reading the web.config file in SQL Reporting Services

Sunday, January 28, 2007 9:33 PM by Justin Wong

I just configured SQL 2005 reporting services today and I'm running into a problem which I hope you can help:

The web.config of my site has the following section:

       <codeSubDirectories>

         <add directoryName="VB"></add>

         <add directoryName="CS"></add>

       </codeSubDirectories>

The site works absolutely fine, except when I try to access Reporting Services by typing http://mySite/Reports.

The error I received is:  The code subdirectory '/Reports/App_Code/VB/' does not exist.

Well, obviously that directory does not exist, because the subdirectory is under my website (D:/MySite/App_Code/VB) and NOT under the vitual report manager directory.  So, I'm wondering what I need to do to overcome this error.

Thanks for your help!

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker