[Mono-osx] ServicePointManager using 2.0
Duane Wandless
duane at wandless.net
Wed Nov 19 07:12:06 EST 2008
I no longer get this issue but as I indicated and you tried the EXE is
required. All of my searching pointed to the DLL not initializing the
environment correctly. And I tried to set some of the variables manually
that the code appeared to need, that never worked. Maybe the call to
mono_domain_assembly_open is required.
Here again is how I currently init the 2.0.1 mono environment from within my
Cocoa app:
NSString *libraryPath = [[[NSBundle mainBundle] bundlePath]
stringByAppendingPathComponent:@"Contents/Libraries"];
NSString *sampleAssemblyPath = [libraryPath
stringByAppendingPathComponent:@"MacMonoClient.exe"];
NSLog(@"libraryPath: %@", sampleAssemblyPath);
mono_config_parse ("config");
domain = mono_jit_init ([sampleAssemblyPath UTF8String]);
MonoAssembly *monoAssembly = mono_domain_assembly_open(domain,
[sampleAssemblyPath UTF8String]);
NSLog(@"sample assembly: %p", monoAssembly);
mono_jit_exec (domain, monoAssembly, 1, argv);
On Wed, Nov 19, 2008 at 6:04 AM, silver83 <silver83 at gmail.com> wrote:
>
> I'm experiencing a similar issue with 2.0, with a stack trace leading to
> the
> same exception at
> System.Configuration.ConfigurationManager.OpenExeConfigurationInternal
> (starting around the ctor for Socket, but that's irrelevant. )
>
> Anyway - I DID switch my assembly to be an EXE, and trying to perform :
> MonoDomain *domain;
> domain = mono_jit_init (file_name);
> mono_jit_exec (domain, assembly, argc - 1, argv + 1);
>
> Results in the same exception.
> Trying to revert to 1.9.1 and test.
>
> Is there a workaround for this in the api ? What is the configuration file
> it's missing ? Maybe I can supply a dummy or something of that form...
>
> Thanks.
>
>
> duanew wrote:
> >
> > "Random assembly"? What are you referring to? There is nothing random.
> >
> > In 1.9 mono I had a working program loading a DLL from an ObjC embedded
> > envrionment. In 2.0 this broke. I traced the issue to
> > ConfigurationManager.cs. When invoked from an embedded DLL the required
> > configuration values are not being set. A lot of changes happened in and
> > around this file between 1.9 and 2.0. One of those changes broke the
> > ability for a DLL to be setup correctly from an embedded environment.
> >
> > If you can provide an example of a DLL being invoked from an ObjC
> embedded
> > environment and having it initialize correctly then I'd happily switch
> > back
> > to a DLL. As it is I must workaround the issue by compiling my C# code
> > into
> > an EXE.
> >
> > On Mon, Oct 27, 2008 at 11:11 AM, Paolo Molaro <lupus at ximian.com> wrote:
> >
> >> On 10/24/08 Duane Wandless wrote:
> >> > Thanks for the reply. I did call mono_jit_exec. But I'm using a DLL
> >> ...
> >> > not an executable. I get a message back after calling mono_jit_exec
> on
> >> my
> >> > DLL:
> >> > doesn't have an entry point
> >> >
> >> > And it fails as described in my first posts. Now maybe the entry
> point
> >> is a
> >> > different signature for the DLL. I did not pursue this since it is
> not
> >> > required that my C# code be in a DLL. So I changed to an EXE and call
> >> > mono_jit_exec which allows my C# code to work as expected.
> >>
> >> Sure, mono_jit_exec() needs an assembly with an entrypoint to execute,
> >> if you throw it a random assembly how do you expect it to work?
> >>
> >> lupus
> >>
> >> --
> >> -----------------------------------------------------------------
> >> lupus at debian.org debian/rules
> >> lupus at ximian.com Monkeys do it better
> >> _______________________________________________
> >> Mono-osx mailing list
> >> Mono-osx at lists.ximian.com
> >> http://lists.ximian.com/mailman/listinfo/mono-osx
> >>
> >
> > _______________________________________________
> > Mono-osx mailing list
> > Mono-osx at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-osx
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/ServicePointManager-using-2.0-tp20081227p20577602.html
> Sent from the Mono - OSX mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-osx mailing list
> Mono-osx at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-osx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20081119/d7bff676/attachment-0001.html
More information about the Mono-osx
mailing list