473,382 Members | 1,238 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,382 software developers and data experts.

Configuration Section not loading with dynamically loaded Assembly

Hi,

I'm trying to gain access to a configuration section from within an
assembly that has been loaded using Assemly.Load(byte[]).
There is one main exe (lets say myApp.exe) and one config file
(myApp.exe.config) which contains the config section. The dll
(myAssembly.dll) is a "plugin" and loaded on request. The reason we
use the byte array version of Assembly.Load is that the dll can remain
unlocked which allows us to overwrite it (and update the plugin with
a
new version via a file watcher without taking down the service).

I have tried
ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None)
and also the same method but passing in a full path to the config
file. Both return a Configuration object that does not contain my
custom config section so a call to GetSection returns null.

If we load the Assembly using Assembly.Load(string) then everything
works perfectly, but the Assembly file is locked and can't be
updated.

Can anyone help me with why these two Load methods result in such
different behaviour, and what the solution might be to get round it?

Currently I am just using "AppSettings" but this is not as clean as
having individual config sections.

Thanks!
Jan 2 '08 #1
4 2532
Hi ,

I have the same problem and can't get around it. Really no idea why the system behaves this way.

Anybody with an answer?
I was hoping that after 10 months there would be an answer here!!

Thanks in advance
Oct 20 '08 #2
Have you tried turning it off and then on again?

Pete
====
http://mrpmorris.blogspot.com
http://www.capableobjects.com


"peter mulder" wrote in message news:20****************@mulder.it...
Hi ,

I have the same problem and can't get around it. Really no idea why the
system behaves this way.

Anybody with an answer?
I was hoping that after 10 months there would be an answer here!!

Thanks in advance
Oct 20 '08 #3
<peter mulderwrote in message news:20****************@mulder.it...
I have the same problem and can't get around it.
Me too. And it hurts when I do "this."

(Today's lesson: learning how to reply to a post instead of starting your
own thread. Tomorrow's lesson: quoting.)
Oct 20 '08 #4
"peter mulder" wrote in message news:20****************@mulder.it...
Hi ,

I have the same problem and can't get around it. Really no idea why the
system behaves this way.

Anybody with an answer?
I was hoping that after 10 months there would be an answer here!!

Thanks in advance

Yes.

Eric B.

Oct 20 '08 #5

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

Similar topics

2
by: Foehammer | last post by:
Hello, I'm trying to load an assembly dynamically using an app domain. This is a proof-of-concept for a larger project, so please excuse the lame class names. TestLib is the dll where all the...
3
by: Florida Coder | last post by:
I have the need to store some application specific configuration data to be used by a class library and or a windows service. I would like to do this in a fashion similar to the way we do with...
1
by: Benjamin | last post by:
Hi, I'm currently writing a Web Services that interacts with a database. To allow me to use not just one database provider (for example, I could use MS Access, SQL Server or MySQL), the Web...
9
by: Ender | last post by:
I have an application that I would like third party developers to be able to create Plug-ins that will be dynamically loaded into our application to extend functionality. I have utilized the...
0
by: CHRIS | last post by:
Isn't it always the case that as soon as you post, you solve the problem? Apparently, adding an extra "space" to a blank line in my web.config file solved this problem. I would be angry that...
4
by: BrianS | last post by:
What is the best strategy for dynamic loading private assemblies in asp.net? I understand, and have confirmed, that any dll placed in the app's /bin dir will get loaded on startup. This is not...
6
by: Jeff Hegedus | last post by:
I have a dll that requires some configuration data. I put the configuration data in a custom configuration section in a config file that is loaded in the installation folder of the dll. If I...
7
by: =?Utf-8?B?RG91Z2llIEJyb3du?= | last post by:
Hi I've written custom configuration section (inherits from System.Configuration.ConfigurationSection) to simplify the contents of the config file and to make life easier when accessing them in...
2
by: Smithers | last post by:
Using 3.5, I am stuck in attempting to: 1. Dynamically load an assembly 2. Instantiate a class from that assembly (the client code is in a different namespace than the namespace of the...
0
by: Paul Buckley | last post by:
Hi, I'm trying to gain access to a configuration section from within an assembly that has been loaded using Assemly.Load(byte). There is one main exe (lets say myApp.exe) and one config file...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.