Yes that works on a mono-free machine! Good job!

By the way, if you need some more live testing

MSN: gagnonje at hotmail.com
Gmail gagnonje at gmail.com

Jérôme
[EMAIL PROTECTED]




On 08-08-11, at 15:16, Laurent Etiemble wrote:

Hello,

I have added the capacity to embed a machine to the <mkbundle/> task.
I have done a quick test and it seems ok (I don't have access right
now to a Mono-free Mac for further testing).

I have attached an interim version of the NAnt.Monobjc.dll assembly,
so let me know if it solves the problem.

Here is how to use the <mkbundle/> with a machine config:

   <mkbundle exe="${build.dir}/${app.name}.exe"
       todir="${build.dir}"
       target="MACOSX_10_4"
       universal="true"
machine-config="/Library/Frameworks/Mono.framework/Versions/ 1.9.1/etc/mono/2.0/machine.config">
     <search-in basedir="${lib.dir}"/>
   </mkbundle>

Regards, Laurent Etiemble.

2008/8/11 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:
Sorry for the delay. We were trying to track the problem.
So we decided to make a test application. All we put inside was that line
(inside awakeFromNib)
object o = Activator.GetObject(typeof(ISecurityManager),
"https://XXX/ISynchronizationManager.rem";);
(ISecurityManager is an interface from one of our DLLs)
And we got this error message:
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.IO.DirectoryNotFoundException: Could not find a part of the path "/Library/Frameworks/Mono.framework/Versions/1.9.1/etc/mono/2.0/ machine.config". Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions
options) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess
access, FileShare share) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
(wrapper remoting-invoke-with-check) System.IO.FileStream:.ctor
(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.IO.File.OpenRead (System.String path) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding
encoding, Boolean detect_encoding_from_bytemarks, Int32 buffer_size)
[0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.IO.StreamReader..ctor (System.String path) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at (wrapper remoting-invoke-with-check) System.IO.StreamReader:.ctor (string) Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System .Runtime.Remoting.RemotingConfiguration.LoadDefaultDelayedChannels ()
[0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System .Runtime .Remoting.Channels.ChannelServices.CreateClientChannelSinkChain
(System.String url, System.Object remoteChannelData, System.String&
objectUri) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.Runtime.Remoting.RemotingServices.GetClientChannelSinkChain
(System.String url, System.Object channelData, System.String& objectUri)
[0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.Runtime.Remoting.RemotingServices.GetOrCreateClientIdentity
(System.Runtime.Remoting.ObjRef objRef, System.Type proxyType,
System.Object& clientProxy) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.Runtime.Remoting.RemotingServices.GetRemoteObject
(System.Runtime.Remoting.ObjRef objRef, System.Type proxyType) [0x00000] Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.Runtime.Remoting.RemotingServices.Connect (System.Type classToProxy,
System.String url) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.Activator.GetObject (System.Type type, System.String url) [0x00000] Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
Monobjc.Shufl.HelloController.AwakeFromNib () [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at Monobjc.Dynamic.Proxies.Monobjc.Shufl.HelloController.AwakeFromNib (IntPtr
receiver, IntPtr selector) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
(wrapper native-to-managed)
Monobjc.Dynamic.Proxies.Monobjc.Shufl.HelloController:AwakeFromNib
(intptr,intptr)
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
(wrapper managed-to-native) Monobjc.Dynamic.Messaging.OBJC_MSGSEND
[System_Boolean] (Monobjc_Cocoa_NSString,Monobjc_Cocoa_NSApplication):__native_call
(intptr,intptr,intptr,intptr)
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
Monobjc.Dynamic.Messaging.OBJC_MSGSEND
[System_Boolean] (Monobjc_Cocoa_NSString,Monobjc_Cocoa_NSApplication).objc_msgSend
(IntPtr receiver, IntPtr selector, Monobjc.Cocoa.NSString ,
Monobjc.Cocoa.NSApplication ) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[])
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] --- End of inner
exception stack trace ---
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[]
parameters) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at Monobjc.Generation.MessagingGenerator.SendMessage[Boolean] (System.String message, IntPtr receiver, IntPtr selector, System.Object[] parameters)
[0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at Monobjc.ObjectiveCRuntime.SendMessage[Boolean] (IManagedWrapper receiver,
System.String selector, System.Object[] parameters) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at Monobjc.Cocoa.NSBundle.LoadNibNamedOwner (Monobjc.Cocoa.NSString aNibName,
Monobjc.Id owner) [0x00000]
Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at Monobjc.Cocoa.NSApplication.LoadNib (System.String filename) [0x00000] Aug 10 18:36:25 Indian [0x0-0x12012].net.monobjc.samples.Shufl[120]: at
Monobjc.Shufl.Program.Main (System.String[] args) [0x00000]
Aug 10 18:36:25 Indian com.apple.launchd[83]
([0x0-0x12012].net.monobjc.samples.Shufl[120]): Exited with exit code: 1


So it seems that it's looking for a file inside the normal Mono.Framework, but since I'm running from "nant native" on a machine without Mono, it doesn't find it. It's working perfectly fine on a Mac with mono installed.

Thanks a lot for your help again.

Jérôme

[EMAIL PROTECTED]



On 08-08-05, at 00:51, Laurent Etiemble wrote:

Hello,

It is very strange. The log only indicates that the bridge has loaded
a new assembly for parsing (parsing means searching for Objective-C
wrappers). This should not cause any problem, as a lot of assemblies
are parsed.

You should be aware that the native application generation has some
limitations:
- runtime loaded assemblies are not seen (and there is no way for the
moment to declare them)
- runtime bound library are not seen (and there is no way for the
moment to declare them)

So, the questions are:
- Do you have any assemblies or native libraries that are loaded at
runtime (think reflection but also P/Invoke) ?
- Can compare the behavior on different machines with and without Mono
installed ?

You can check this link in order to debug the native library loading:
- http://developer.apple.com/technotes/tn2004/tn2124.html#SECDYLD

Regards, Laurent Etiemble.

2008/8/4 Jérôme Gagnon-Voyer <[EMAIL PROTECTED]>:

Hi

I'm having problem with nant native, when I run on a machine without Mono.

The application just seems to hang there (I have to force quit after a

"beach ball of the death" ) when I click to login, it's hard to know what's

going on but it seems that it's a problem with System.Runtime.Remoting

633534550301397090 [DEBUG] NSApplication - Running Application

633534550324178340 [DEBUG] MessagingGenerator - Generating Messaging Method

: Monobjc.Dynamic.Messaging.OBJC_MSGSEND [Monobjc_Cocoa_NSDictionary]()

633534550346850040 [DEBUG] ObjectiveCRuntime - Domain has loaded the

'System.Runtime.Remoting, Version=2.0.0.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089' assembly

Terminated

That's the log I get when I enable debugging.

Is that enough information or you want me to write a test- application?

Thanks.


Jérôme

[EMAIL PROTECTED]






<NAnt.Monobjc.dll>

Reply via email to