Assembly.GetExecutingAssembly().CodeBase problem in RS Custom Assembly

  • Hi,

    I am using a custom assembly. My assembly has to read a particular file and take some values from it. I set the required permissions and everything works good. However I dont want to hardcode the location of my text file. I decided to put the text file in the same location as dll file i.e in ..\Program Files\Reporting Services\ReportServer\bin folder and thought of finding the path in my class library using something like

    String pathval=System.Reflection.Assembly.GetExecutingAssembly().CodeBase;

    But this method always gives me #Error in my report expression. I also tried by removing all other code and just returning the path. Also if I try to return System.Reflection.Assembly.GetExecutingAssembly().FullName; it works good. I am totally confused as how one property will work and another one does not. Is there anything I am missing like setting some reference or changing some permission etc.

    All I would like to know is the location of the dll i.e windows path(C:\Program Files\Reporting Services\ReportServer\bin) using c# code.

    Any help is appreciated.

    Thanks and Regards,

    SrideviSriraman

     

     

     

     

Viewing post 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply