Hello Jeff,
From your description, you're getting "could not find file or assembly ..."
error when try launch an .net application which read some custom
configuration sectino data from app.config file, correct?
As the error message indicate, the problem here is that the .net runtime
can not correctly find the assembly for your custom configuration section.
And based on my previous description, I think the cause here is that you
did not put the custom configuration section assembly in the .NET runtime's
expected searching path. For .net framework application, its runtime
host(CLR runtime) has a regular rule of how to search for dependency
assemblies. Generally, when an .net application need to locate a certain
assembly it references, it will go through the following steps:
**if the referenced assembly is strong-named, lookup the GAC first
**if GAC not exists, look into Application configureation file(App.config)
to see whether there is codebase setting indicate a specfiic location of
the assembly(on file system or over internet)
**Perform local assembly probing under the application's root folder(you
can configure which sub folders to probing in app.config file).
Here is the MSDN refernce that detailedly describe this:
#How the Runtime Locates Assemblies
http://msdn2.microsoft.com/en-us/library/yx7xezcf.aspx
For your scenario, I think you can consider the following options to deploy
the assembly of your custom configuration section:
1. strong-named your assembly and put it into machine's GAC so that any
..net application running on that machine can locate it(if it has referenced
your assembly).
2. Use <codebasesetting to specify a particular location(such as file
system path or http web url) for your assembly, you can put the <codebase>
setting in the certain application(which want to reference that custom
assembly)'s app.config file. For syntax setting, you can refer to the
following document:
#Specifying an Assembly's Location
http://msdn2.microsoft.com/en-us/library/4191fzwb.aspx
#<codeBaseElement
http://msdn2.microsoft.com/en-us/library/efs781xb.aspx
BTW, you should not put file path in the "type" attribute of the <section
element(only assembly name is necessary), searching path is determined by
the .NET's CLR searching rules as described above.
3. Put the assembly in same directory with the .net application(exe) which
reference that certain assembly.
Hope this helps. If you have anything unclear or any further questions on
this, please feel free to let me know.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.