473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

App.Config from a different EXE

We have an executable that uses an App.Config file to hold things such
as database connection strings etc.

We now want to write a wrapper DLL around that executable to expose
functionality to integrate with another app.

Therefore we aim to have one new executable talking to the wrapper DLL
that in turn talks to the original app. Although the original app is
an executable, it can be treated like a DLL.

Ideally what I want is for the new executable to use the keys in the
App.config from the original application that is somehow set from the
wrapper DLL.

ie in the new application it will call something like:

WrapperDLL.Init();
The method Init() in wrapper DLL will in turn get the App.Config from
the original application and set it for the new executable:

ie something like:

class WrapperDLL
{
void Init()
{
Configuration c =
ConfigurationManager.OpenExeConfiguration("test.ex e");
// Then somehow use this configuration as the current App.Config ??
This is where I am lost
}
}
How best can I achieve this?

Jun 27 '08 #1
2 1603
On Apr 27, 7:14*am, PromisedOyster <PromisedOys...@hotmail.comwrote:
We have an executable that uses an App.Config file to hold things such
as database connection strings etc.

We now want to write a wrapper DLL around that executable to expose
functionality to integrate with another app.
How are you planning to do this?
Jun 27 '08 #2
On Apr 30, 1:21*am, "Ignacio Machin ( .NET/ C# MVP )"
<ignacio.mac...@gmail.comwrote:
On Apr 27, 7:14*am,PromisedOyster<PromisedOys...@hotmail.comw rote:
We have an executable that uses an App.Config file to hold things such
as database connection strings etc.
We now want to write a wrapper DLL around that executable to expose
functionality to integrate with another app.

How are you planning to do this?
What we have is as follows:

- OtherApplication.exe - this is a third party product that needs to
access functionality in our application
- Wrapper.DLL - this is a wrapper around our application and only
exposes certain classes and methods that are of interest to the
OtherApplication.
- OurApplication.exe - this is our application that contains an
app.config which contains info such as database connection strings

The wrapper DLL is simply another .NET assembly that has a reference
to OurApplication .NET assembly (which happens to be an executable).
Only a handful of new classes and methods are in the wrapper DLL and
are more in-tune with the functionality that the other application
requires rather than giving them details on accessing the main
executable.

The issue is that OurApplication.exe has the app.config that contains
things such as the database connection strings. This app.config needs
to be accessed from the wrapper DLL and then used as the app.config
for the OtherApplication that is accessing our application via the
warapper.

Was this the sort of information you were after?
Jun 27 '08 #3

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

Similar topics

4
by: Metaljock | last post by:
Please forgive me if this question is not clear. I am not a .Net developer, I am just trying to get a .Net app to work with Citrix. I have a .Net app that runs on Terminal Services 2003 with...
3
by: Mustaq | last post by:
Hi, How to read same config file from different application? I have 4 application in VB.NET, all are using different app.config files. NOW I need all to read only one config file, how can I do...
3
by: Frank Rizzo | last post by:
How can I force an .EXE to use a different app.config file? For instance, I have an MyApp.exe which by default uses MyApp.exe.config file. Can I force it to use ThatApp.exe.config? Thanks
5
by: George | last post by:
Hi, Is it possible to specify the location of a web.config file in an ASP.NET application? I have one ASP.NET application which is to be hosted on 2 web sites in the same web server. I want...
16
by: Timm | last post by:
I'm trying to use ASP objects (basically formed and populated based on Web.Config settings) and I want to use them in a different non-asp program with minimal reprogramming. So, my question is how...
13
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...
12
by: Ben | last post by:
I have a group of settings that I'd like to have inherited by multiple sites. I'm trying this, but it's not working. wwwroot\group\web.config wwwroot\group\site1\web.config...
4
by: Peter | last post by:
Hello I created a dll assembly unsing the settings (only application settings). I read a lot a lot about the new settings concept, but I still don't understand it. The settings are in two...
8
by: aabdis | last post by:
Hello All.... I have a question... i have two Windows apps (one UI, and one service) which use a common DLL that hands out database results and such to the two apps. The DLL always connects to...
2
by: Spam Catcher | last post by:
Is there a way to script VS.NET to copy different app.config along with different build configurations? In fact, it would be great if I could dynamically substitute app.config values for...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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,...

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.