Hello,

I have made more searches about the problem. Unfortunately, I think
that there is a problem within the Mono runtime (something about name
mangling).

To be sure, I have made cross-test with the mkbundle2 command that
comes with Mono. I am trying to trace the problem deep down the Mono
code in order to prepare a bug report for the Mono team with more
details and test cases.

Regards, Laurent Etiemble.

2008/8/6 Laurent Etiemble <[EMAIL PROTECTED]>:
> Hello,
>
> Here are the results of my ongoing investigations:
> - The embedding seems to be fine. A quick check of the Mono functions
> shows that both assemblies and their config files are correctly
> stored.
> - I came across the following bug report
> (https://bugzilla.novell.com/show_bug.cgi?id=MONO80305) that is
> related. So, everything seems to be fine in Mono API.
> - At runtime, the application behaves as it should EXCEPT that when
> the app.config is queried, nothing seems to be returned.
>
> I will continue my investigations to find out why is missing or what
> is broken. Let me know if you find something.
>
> Note: I have not checked that DLL config can be accessed. Can you take
> a look at this ?
>
> Regards, Laurent Etiemble.
>
> 2008/8/4 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
>> Yes, now it is embedded, at least it looks like it.
>>  [mkbundle] Generating native sources...
>>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe
>>  [mkbundle]   Embedding /ShuflMac/build/Shufl.exe.config
>> But the .config file still seems not to be read (specific variables
>> specified in that file are not read)
>> And when I write this in AwakeFromNib
>> Console.Write(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
>> I get this in the console:
>> Aug  4 12:41:14 Indian [0x0-0x2c02c].net.monobjc.samples.Shufl[712]:
>> /data-0x2010.config
>> Any idea?
>> Thanks!
>>
>> Jérôme
>>
>> [EMAIL PROTECTED]
>>
>>
>>
>> On 08-08-01, at 23:30, Laurent Etiemble wrote:
>>
>> Hello,
>>
>> The config file to embed should be in the same folder as the corresponding
>> assembly (see what happens to System.Drawing). So if you build your exe in
>> the dir 'foo' folder, you should place a copy of your config file in the
>> 'foo' folder, so it is properly pick up by the <mkbundle/> task. This can be
>> achieved with a <copy/> task.
>>
>> Regards, Laurent Etiemble.
>>
>> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>>>
>>> Hi!
>>> It seems it doesn't get embedded. But I'm not sure how I should add the
>>> .config file inside the nant.build file.
>>>
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>>> [...]
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>>  [mkbundle]   Reference found
>>> file:///Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>>> [...]
>>>
>>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/build/Shufl.exe
>>> [...]
>>>
>>>  [mkbundle]   Embedding
>>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Client.dll
>>>  [mkbundle]   Embedding
>>> /Users/gagnonje/Shufl/ShuflMac/lib/Shufl.Common.dll
>>>  [mkbundle]   Embedding /Users/gagnonje/Shufl/ShuflMac/lib/log4net.dll
>>>
>>>
>>> Finally what I did
>>> I looked at this variable:
>>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile
>>> What I got for native was:
>>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/data-0x3020.config
>>> So I added this line to AwakeFromNib
>>> AppDomain.CurrentDomain.SetupInformation.ConfigurationFile =
>>> "Shufl.exe.config";
>>> And now the path is:
>>> /Users/gagnonje/Shufl/ShuflMac/dist/Shufl.app/Shufl.exe.config
>>> So I manually move my file over there. It's just a weird place because
>>> there shouldn't be anything in that directory except for the Contents
>>> folder.
>>> If I don't build with native, it just loads it from the Resources folder
>>> (same directory as Shufl.exe)
>>> Jérôme
>>> [EMAIL PROTECTED]
>>>
>>>
>>>
>>> On 08-08-01, at 02:50, Laurent Etiemble wrote:
>>>
>>> Hello,
>>>
>>> I have just looked into the <mkbundle/> task and realized that assembly
>>> config files are treated differently.
>>>
>>> When generating the native executable, the assembly config files are
>>> embedded. This is what happened with the System.Drawing assembly (Excerpt
>>> from the NAnt output) :
>>>
>>>             [mkbundle]   Embedding /Library/Frameworks/Mono.
>>>
>>> framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
>>>             [mkbundle]   Embedding
>>> /Library/Frameworks/Mono.framework/Versions/1.9/lib/mono/gac/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.config
>>>
>>> Can you check the output of your NAnt build file to check that your config
>>> file appear in the list ? In this case, you don't need to copy it elsewhere.
>>> Regards, Laurent Etiemble.
>>>
>>>
>>> 2008/8/1 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>
>>>>
>>>> When I compile my application with a normal "nant" command, and I put my
>>>> application config file (Application.exe.config) into the Resources folder,
>>>> it works well.
>>>> But if I use "nant native", I can't find a way to load my .config file.
>>>> It just doesn't load. What would be the name to use? In what directory?
>>>> Thanks a lot.
>>>>
>>>>
>>>> Jérôme
>>>> [EMAIL PROTECTED]
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>>
>

Reply via email to