Re: AppDomain & finding assemblies [.NET 2.0]
- From: "Greg Young" <DruckDruckGoose@xxxxxxxxxxx>
- Date: Mon, 1 May 2006 03:23:57 -0400
Have you tried a codebase definition in your config file?
http://www.codeproject.com/dotnet/assemblydeployment.asp gives an example of
a file based codebase towards the end.
I believe you could also use the ResolveAssembly event for this
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemappdomainclassassemblyresolvetopic.asp
if you really have to. I have used this event a few times (doing things like
keeping assemblies in a database)
Cheers,
Greg
"Alexander van Doormalen" <avdoormalen@xxxxxxxxx> wrote in message
news:1146167320.655198.22190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a windows service which calls extensions. In 1 of those
extensions I want to load a config file (extension.dll.config). In that
config file I defined some ConfigurationSection's. For example:
<section name="somename" type="sonenamespace.someclassname,
someassembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
The loading part is done using
ConfigurationManager.OpenMappedExeConfiguration(ExeConfigurationFileMap,
ConfigurationUserLevel). So far so good.
Then from the Configuration instance I get, I want to get a
ConfigurationSection using the GetSection method. Now I get an error
saying it cannot find the assembly that contains the class which
represents this section.
I think this is because
1) The service (host), which created a seperate appdomain to load the
extensions in, is located in <installdir>\Bin\service.exe
2) The extensions are located in a dir <installdir>\Extensions.
You see this is 1 dir up and. If I copy the extension to the bin
directory where the service.exe is located everything can be found
perfectly. But this is not what I want and not how this product works
(its Microsoft MIIS btw.)
Anybody has some ideas how to get this to work. I played a bit with the
assemblyBinding config element but never got it to work. Probably
because you can't got outside the base dir (which is where the
service.exe is located).
I hope someone can help me with this because I'm pulling hears right
now.
.
- Follow-Ups:
- Re: AppDomain & finding assemblies [.NET 2.0]
- From: Alexander van Doormalen
- Re: AppDomain & finding assemblies [.NET 2.0]
- Prev by Date: Re: Synchronized Collection<T> Recommendation
- Next by Date: Re: asp and c#
- Previous by thread: asp and c#
- Next by thread: Re: AppDomain & finding assemblies [.NET 2.0]
- Index(es):
Relevant Pages
|
Loading