[Mono-bugs] [Bug 467214] Setting $LD_LIBRARY_PATH using SetEnvironmentVariable does not affect search path used by PInvoke

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Mar 15 10:35:10 EDT 2009


User robertj at gmx.net added comment

Robert Jordan <robertj at gmx.net> changed:

           What    |Removed                     |Added
                 CC|                            |robertj at gmx.net

--- Comment #3 from Robert Jordan <robertj at gmx.net>  2009-03-15 08:35:07 MST ---
They are both using LoadLibrary on Windows.

I believe that the problem is related to the point in time when mono is trying
to load the library. If you put these statements in the same method, mono will
not notice the path change, because "SomePinvokeFunc" is resolved at JIT
compile time while SetEnvironmentVariable is called later at runtime:

void Foo ()
    Environment.SetEnvironmentVariable ("PATH", "blah");
    SomePinvokeFunc ();

You may want to try to set the path as early as possible outside the method
that performs the pinvoke call.

Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list