Showing posts with label basedirectory. Show all posts
Showing posts with label basedirectory. Show all posts

Wednesday, March 21, 2012

How to get the application directory

I need to get the application directory from report server. I wrote System.AppDomain.CurrentDomain().BaseDirectory() in the expression. It works when I click preview in IDE. But it doesn't work when I deploy on the server. How come?

Because BaseDirectory requires CAS FileIOPermission. Try creating an utility assembly and registering it in rssrvpolicy.config. You may need to assert FileIOPermission as well.

sql