app.config and probing

G

Guest

I have a mixed mode application that uses several dlls, which most are native
and my new one is mixed. My new dll uses several dependent .NET assemblies.
I wanted to place these dependent .NET assemblies in a subdirectory, rather
than placing them all in the main directory. I added an app config file to
the main exe in the following form:

<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com.asm.v1">
<probing privatePath="subdir" />
</assemblyBinding>
</runtime>
</configuration>

But when I try to load the dll, the app config subdir seems to be ignored.
Do mixed mode C++/CLI applications honor the probing privatePath? I was
going to use AppendPrivate path, but I see they are now depricating that
call. I would really like a general solution because I know I will be adding
more .NET assemblies in the future.
 
J

Jeffrey Tan[MSFT]

Hi Juan,

This looks like a bug of CLR. Is your problematic machine Win2003? In
Windows Server 2003, if the application has the following SxS manifest,
then CLR will not use the application config file even if it exists. See
the blog entry below for more details and workaround:
"Application config file is not used if the application has certain SxS
manifest"
http://blogs.msdn.com/junfeng/archive/2006/08/09/692996.aspx

Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

We were actually testing this on XP. But in VS 2005, it automatically adds
SxS manifest entries for the C runtime and MFC dlls and I add to the manifest
with the comctrl information so themes will work too. So I am beginning to
think the CLR has an issue in general that causes it to not read the app
config file. I think I will be forced to use the obsolete call for now and
hopefully by the time they remove the call they will have the bug fixed.
 
G

Guest

I figured out what was going on. I had an assembly identity in my additional
manifest, BUT I noticed the version number did not match that of my exe.
When I changed them to match, the config file then was magically used with
success.
 
J

Jeffrey Tan[MSFT]

Hi Juan,

Thank you for sharing the result. If you need further help, please feel
free to post, thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top