Friday, February 17, 2012

Custom Assembly config file and named instances of Reporting Services

We have a custom assembly that is using a config file. We park the config
file in the instance folder of RS along with the dll. We look in the
registry to find the instance. When there are multiple instances of RS I am
not identifying the correct instance to locate the correct custom assembly
config file. I think what I need to do is use Reflection or Process
libraries to identify the running instance, but haven't been able to figure
this out yet. Anyone using config files for their custom assemblies? We
are using a resource file and could place the config information in there
but that seems wrong. I could use the RS web.config...maybe but don't know
how to do that yet and what the security issues will be.
Thanks for helping,
Steve MunLeeuwI could do two things that I can think of.
1. bad: Pass in the ReportServerURL and loop through the RS instances to
find the one the custom assembly is loaded in and use that to find the
config file.
2. good: Just add the settings to the RS web.config instance. I still need
to test if this will work when running reports from rs.exe utility.
Add the following to web.config:
<appSettings>
<add key="connString" value="connection string" />
</appSettings>
Add the following to custom assembly:
using System.Configuration;
ConfigurationSettings.AppSettings["connString"]
Steve MunLeeuw
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:e$ys4gs9GHA.4224@.TK2MSFTNGP02.phx.gbl...
> We have a custom assembly that is using a config file. We park the config
> file in the instance folder of RS along with the dll. We look in the
> registry to find the instance. When there are multiple instances of RS I
> am not identifying the correct instance to locate the correct custom
> assembly config file. I think what I need to do is use Reflection or
> Process libraries to identify the running instance, but haven't been able
> to figure this out yet. Anyone using config files for their custom
> assemblies? We are using a resource file and could place the config
> information in there but that seems wrong. I could use the RS
> web.config...maybe but don't know how to do that yet and what the security
> issues will be.
> Thanks for helping,
> Steve MunLeeuw
>|||Ooops, used deprecated method. Here's the updated code:
http://smunson.blogspot.com/
Steve MunLeeuw
"Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
news:%23QsUD%23t9GHA.4408@.TK2MSFTNGP02.phx.gbl...
>I could do two things that I can think of.
> 1. bad: Pass in the ReportServerURL and loop through the RS instances to
> find the one the custom assembly is loaded in and use that to find the
> config file.
> 2. good: Just add the settings to the RS web.config instance. I still
> need to test if this will work when running reports from rs.exe utility.
> Add the following to web.config:
> <appSettings>
> <add key="connString" value="connection string" />
> </appSettings>
> Add the following to custom assembly:
> using System.Configuration;
> ConfigurationSettings.AppSettings["connString"]
>
> Steve MunLeeuw
>
> "Steve MunLeeuw" <smunson@.clearwire.net> wrote in message
> news:e$ys4gs9GHA.4224@.TK2MSFTNGP02.phx.gbl...
>> We have a custom assembly that is using a config file. We park the
>> config file in the instance folder of RS along with the dll. We look in
>> the registry to find the instance. When there are multiple instances of
>> RS I am not identifying the correct instance to locate the correct custom
>> assembly config file. I think what I need to do is use Reflection or
>> Process libraries to identify the running instance, but haven't been able
>> to figure this out yet. Anyone using config files for their custom
>> assemblies? We are using a resource file and could place the config
>> information in there but that seems wrong. I could use the RS
>> web.config...maybe but don't know how to do that yet and what the
>> security issues will be.
>> Thanks for helping,
>> Steve MunLeeuw
>

No comments:

Post a Comment