[Mono-dev] [Patch] ConfigurationFile should be relative to the ApplicationBase

Jamie Cansdale jamie.cansdale at testdriven.net
Thu Feb 22 08:28:11 EST 2007


I recently hit an issue with Mono not being able to find my .config
files. My application was developed using .NET so this is a
discrepancy between Mono and .NET. AFAIK this behavior isn't
documented anywhere.

AppDomainSetup setup = new AppDomainSetup();
setup.ApplicationBase = "app_base";
setup.ConfigurationFile = "blar.config";

.NET would look for the .config file at 'app_base\blar.config'. Mono
looks for the .config file in the current directory. If the
ApplicationBase isn't specified in .NET a MemberAccessException is
thrown when the ConfigurationFile property is accessed (assuming it
isn't an absolute path).

I've attached patches for unit tests and a "fix" for this. This is my
first patch so please let me know if I'm doing it right.

Thanks, Jamie.

--
http://www.testdriven.net
http://weblogs.asp.net/nunitaddin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ConfigRelativeToAppBase.patch
Type: application/octet-stream
Size: 665 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070222/859c7f36/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ConfigRelativeToAppBaseTests.patch
Type: application/octet-stream
Size: 3345 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070222/859c7f36/attachment-0001.obj 


More information about the Mono-devel-list mailing list