473,651 Members | 2,742 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

app.config for DLL

I am calling a C# method/DLL from Reporting Services. In the DLL, I am
referencing ConfigurationSe ttings.AppSetti ngs["DBConnectionSt ring"].
This should go in app.config in the caller's folder. This is fine when
the caller is a regular .NET application, but I don't know where to put
the app.config for Reporting Services.

Jul 21 '05 #1
2 3274
1. During runtime the report is generated under the Report Server host
process so the <appSetting> section in web.config file should work. Try
rendering a report from the Report which has a textbox with the following
expression:
= System.Configur ation.Configura tion.AppSetting s(<your config value>)
Please note that the web.config file already has a configuration section
so you need to add only the <appSettings> element. You should have the same
result when calling this from your DLL since it will be loaded in the RS
application domain.

2. During design time it is a bit trickier. Unfortunately, the current
configuration handler of the Report Designer doesn't seem to recognize
<appSettings> . However, you can render the report in debug mode by hitting
F5. This renders the report under ReportHost.exe. To get the config settings
working, create a ReportHost.exe. config in C:\Program Files\Microsoft SQL
Server\80\Tools \Report Designer and place your configuration section there
(the <configuratio n> element should be spelled with small "c"), e.g.:
<?xml version="1.0" encoding="utf-8" ?><configuratio n>
<appSettings>

<add key="serverUrl" value="http://localhost/reportserver" />
</appSettings>
</configuration>

b) To get the Preview tab working you could either check for Nothing and
replace that with a default value, or wrap the ConfigSettings. AppSettings
call to default to some default constant values. Once again, this is only
needed during design time. Your runtime report generation shouldn't need
this hack.

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

"Bucky" <uw********@mai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I am calling a C# method/DLL from Reporting Services. In the DLL, I am
referencing ConfigurationSe ttings.AppSetti ngs["DBConnectionSt ring"].
This should go in app.config in the caller's folder. This is fine when
the caller is a regular .NET application, but I don't know where to put
the app.config for Reporting Services.

Jul 21 '05 #2
Just to clarify...by web.config I meant the Report Server web.config file
located in C:\Program Files\Microsoft SQL Server\MSSQL\Re porting
Services\Report Server if default setup settings have been accepted.

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

"Teo Lachev [MVP]" <te********@nos pam.prologika.c om> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
1. During runtime the report is generated under the Report Server host
process so the <appSetting> section in web.config file should work. Try
rendering a report from the Report which has a textbox with the following
expression:
= System.Configur ation.Configura tion.AppSetting s(<your config value>)
Please note that the web.config file already has a configuration section
so you need to add only the <appSettings> element. You should have the
same result when calling this from your DLL since it will be loaded in the
RS application domain.

2. During design time it is a bit trickier. Unfortunately, the current
configuration handler of the Report Designer doesn't seem to recognize
<appSettings> . However, you can render the report in debug mode by hitting
F5. This renders the report under ReportHost.exe. To get the config
settings
working, create a ReportHost.exe. config in C:\Program Files\Microsoft SQL
Server\80\Tools \Report Designer and place your configuration section there
(the <configuratio n> element should be spelled with small "c"), e.g.:
<?xml version="1.0" encoding="utf-8" ?><configuratio n>
<appSettings>

<add key="serverUrl" value="http://localhost/reportserver" />
</appSettings>
</configuration>

b) To get the Preview tab working you could either check for Nothing and
replace that with a default value, or wrap the ConfigSettings. AppSettings
call to default to some default constant values. Once again, this is only
needed during design time. Your runtime report generation shouldn't need
this hack.

--
Hope this helps.

---------------------------------------------
Teo Lachev, MVP [SQL Server], MCSD, MCT
Author: "Microsoft Reporting Services in Action"
Publisher website: http://www.manning.com/lachev
Buy it from Amazon.com: http://shrinkster.com/eq
Home page and blog: http://www.prologika.com/
---------------------------------------------

"Bucky" <uw********@mai l.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
I am calling a C# method/DLL from Reporting Services. In the DLL, I am
referencing ConfigurationSe ttings.AppSetti ngs["DBConnectionSt ring"].
This should go in app.config in the caller's folder. This is fine when
the caller is a regular .NET application, but I don't know where to put
the app.config for Reporting Services.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
3012
by: Maxim Khesin | last post by:
I want to have a config file with my python proggie, satisfying the following requirements: 1) support key->(value, default) 2) simple and intuitive to read and edit 3) easyly readable into a python datastructure (a dictionary?) 4) not requiring any heavy libraries needed (I am distributing my proggie as a py2exe executable and do not want to bloat the size) can you guys suggest some format for this? thanks, max
4
3821
by: Fuzzyman | last post by:
There have been a couple of config file 'systems' announced recently, that focus on building more powerful and complex configuration files. ConfigObj is a module to enable you to much more *simply* access config files. This is version 3, which is a big overhaul. It extends ConfigObj to reading config files with sections and various other simplifications. I find ConfigObj extremely easy to use and use it for reading config files and data...
3
3811
by: Richard Lewis Haggard | last post by:
I have a test application that is calling an assembly that reads some strings out of a config file. Normally, this assembly supports a web application and the information can be read just fine. Then I created a C# test application and ran the function. The function fails because the configuration read is failing to find a key. I created an application config and copied the keys over to the app config file but the app is still failing to...
13
507
by: Khodr | last post by:
Hello, I am using VS.NET 2003 and vb. I build my application MyApp and it generates MyApp.exe.config. So now MyApp.exe reads parameters from MyApp.exe.config. Great and no problem! I need to run the same program but with different configuration data. So I made a copy of MyApp.exe and MyApp.exe.config to put them in another folder and renamed the copy to MyApp2.exe and MyApp2.exe.config respectively. I ran it but it did not read from...
20
2607
by: tomerfiliba | last post by:
hey i've been seeing lots of config-file-readers for python. be it ConfigObj (http://www.voidspace.org.uk/python/configobj.html) or the like. seems like a trend to me. i came to this conclusion a long time ago: YOU DON'T NEED CONFIG FILES FOR PYTHON. why re-invent stuff and parse text by yourself, why the interpreter can do it for you? and anyway, i find this a very ugly format:...
11
3438
by: TARUN | last post by:
Hello All I need to ask about the configuration file in .NET, There are Two config File 1. Web Config 2. Machine config I understand the the usage of Web config , but not able to understand the usage of Machine config. I read in the article that you can also write your database connection string in Machine Config
12
13426
by: dbuchanan | last post by:
Hello, (Is this the proper newsgroup?) === Background === I am building a solution with two projects. One project is my data access layer which contains my DataSet as an xsd file. The XSD file was built by draging tables from the Data Sources pane. Auto-generated code created the files associated wtih the XSD file (xss,
5
7845
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based setting is of course stored in the app.exe.config file located in the same directory as the exe. Upon closing the form, I save the user setting which then creates a user.config file in the appdata directory in my profile. This is all well and good....
10
2045
by: eagle | last post by:
I have a web.config in my application that contains the connection strings to all my datasources. I want to move these connection strings to another web config up the folder hierarchy so that all my apps can use the same connection strings. That is supposed to be how it's done, no? Instead of the web.config being in c:\inetpub\wwwroot\myApp\web.config, I have it in c:\inetpub\wwwroot\web.config. However, I get an "Object reference not...
5
2854
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a app that uses several membership/role providers. I can list these Providers with the code: Dim rootWebConfig1 As Configuration rootWebConfig1 = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath) Dim section As New MembershipSection section = rootWebConfig1.GetSection("system.web/membership")
0
8357
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8277
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8803
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8581
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7298
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.