Bug 10002 - System.Reactive.* assemblies do not appear to be anywhere the assembly loader can find it by default
Summary: System.Reactive.* assemblies do not appear to be anywhere the assembly loader...
Status: RESOLVED FEATURE
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2013-02-03 10:36 UTC by Brandon Wallace
Modified: 2013-05-01 00:30 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FEATURE

Description Brandon Wallace 2013-02-03 10:36:20 UTC
Mono 3.0.3 beta has Reactive Extensions bundled with it.  However they have a different public key token than the Reactive Extensions 2.0 assemblies available through NuGet.

This means that a .NET assembly compiled on Windows against the NuGet version of System.Reactive.*.dll cannot be run on the Mono runtime without recompiling.

Can this be resolved?
Comment 1 Brandon Wallace 2013-02-03 12:48:41 UTC
Actually through more experimentation the above isn't true.  The problem just seems to be the assembly loader cannot find the assemblies by default.

When I run my program, the assembly loader tries to find it in the GAC but uses the wrong name and so cannot find it.

If I add <monodir>/lib/mono/4.5 to "MONO_PATH" then the assembly loader can find the Reactive Extensions assemblies and my program runs successfully.  But I was under the impression that one shouldn't usually set MONO_PATH.
Comment 2 Atsushi Eno 2013-03-05 10:44:52 UTC
Hopefully this fixes the issue by adding explicit version number and make it loadable from the gac:  https://github.com/mono/mono/commit/cd6dc32e0b936645bf2f89e1bf61c6ae04c3258a

If not please reopen it.
Comment 3 Brandon Wallace 2013-04-11 09:43:01 UTC
Hi,

I've just tested this on mono 3.0.8 by removing my "MONO_OPTIONS" env variable.  The problem remains.  I've included the mono assembly loading log messages:

Launching Program Thu Apr 11 08:35:44 CDT 2013 on houic-n-c01501

Unhandled Exception:
System.TypeInitializationException: An exception was thrown by the type initializer for Utilities.NLogUtilities ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reactive.Interfaces, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3' or one of its dependencies.
File name: 'System.Reactive.Interfaces, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'
  at Utilities.NLogUtilities..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Program.Main () [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Utilities.NLogUtilities ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Reactive.Interfaces, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3' or one of its dependencies.
File name: 'System.Reactive.Interfaces, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3'
  at Utilities.NLogUtilities..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Program.Main () [0x00000] in <filename unknown>:0
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/4.5/mscorlib.dll'.
Mono: Image addref mscorlib[0x1167280] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/4.5/mscorlib.dll[0x11664e0]: 2
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/4.5/mscorlib.dll'.
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/4.5/mscorlib.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/4.5/mscorlib.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/mscorlib/mscorlib.config'.
Mono: Assembly mscorlib[0x1167280] added to domain Program.exe, ref_count=1
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/config'.
Mono: Config attempting to parse: '/glb/home/usbwao/.mono/config'.
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe'.
Mono: Image addref Program[0x11a7b00] -> /glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe[0x1165350]: 3
Mono: Assembly Program[0x11a7b00] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe'.
Mono: Config attempting to parse: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/Program/Program.config'.
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe'.
Mono: Assembly Ref addref Program[0x11a7b00] -> mscorlib[0x1167280]: 2
Mono: Config attempting to parse: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Program.exe.config'.
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/NLog.dll'.
Mono: Image addref NLog[0x11af300] -> /glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/NLog.dll[0x11aa350]: 2
Mono: Assembly NLog[0x11af300] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/NLog.dll'.
Mono: Config attempting to parse: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/NLog.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/NLog/NLog.config'.
Mono: Assembly Ref addref Program[0x11a7b00] -> NLog[0x11af300]: 2
Mono: Assembly Ref addref NLog[0x11af300] -> mscorlib[0x1167280]: 3
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/.dll'.
Mono: Image addref [0x11b39a0] -> /glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/.dll[0x11b2ac0]: 2
Mono: Assembly [0x11b39a0] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/.dll'.
Mono: Config attempting to parse: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies//.config'.
Mono: Assembly Ref addref Program[0x11a7b00] -> [0x11b39a0]: 2
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Utilities.dll'.
Mono: Image addref Utilities[0x11b5320] -> /glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Utilities.dll[0x11b4460]: 2
Mono: Assembly Utilities[0x11b5320] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Utilities.dll'.
Mono: Config attempting to parse: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Utilities.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/Utilities/Utilities.config'.
Mono: Assembly Ref addref [0x11b39a0] -> Utilities[0x11b5320]: 2
Mono: Assembly Ref addref Utilities[0x11b5320] -> mscorlib[0x1167280]: 4
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll'.
Mono: Image addref System.Core[0x11c27c0] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll[0x11c1650]: 2
Mono: Assembly System.Core[0x11c27c0] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Core/4.0.0.0__b77a5c561934e089/System.Core.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System.Core/System.Core.config'.
Mono: Assembly Ref addref NLog[0x11af300] -> System.Core[0x11c27c0]: 2
Mono: Assembly Ref addref System.Core[0x11c27c0] -> mscorlib[0x1167280]: 5
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll'.
Mono: Image addref System[0x11dd950] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll[0x11dc9f0]: 2
Mono: Assembly System[0x11dd950] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System/System.config'.
Mono: Assembly Ref addref NLog[0x11af300] -> System[0x11dd950]: 2
Mono: Assembly Ref addref System[0x11dd950] -> mscorlib[0x1167280]: 6
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll'.
Mono: Image addref System.Configuration[0x1219450] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll[0x1212290]: 2
Mono: Assembly System.Configuration[0x1219450] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Configuration/4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System.Configuration/System.Configuration.config'.
Mono: Assembly Ref addref NLog[0x11af300] -> System.Configuration[0x1219450]: 2
Mono: Assembly Ref addref System.Configuration[0x1219450] -> mscorlib[0x1167280]: 7
Mono: Assembly Ref addref System.Configuration[0x1219450] -> System[0x11dd950]: 3
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll'.
Mono: Image addref System.Xml[0x12100f0] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll[0x120f190]: 2
Mono: Assembly System.Xml[0x12100f0] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Xml/4.0.0.0__b77a5c561934e089/System.Xml.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System.Xml/System.Xml.config'.
Mono: Assembly Ref addref System.Configuration[0x1219450] -> System.Xml[0x12100f0]: 2
Mono: Assembly Ref addref System.Xml[0x12100f0] -> mscorlib[0x1167280]: 8
Mono: Assembly Ref addref System.Xml[0x12100f0] -> System[0x11dd950]: 4
Mono: Assembly Ref addref NLog[0x11af300] -> System.Xml[0x12100f0]: 3
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll'.
Mono: Image addref System.ServiceModel[0x1380f10] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll[0x137ffc0]: 2
Mono: Assembly System.ServiceModel[0x1380f10] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.ServiceModel/4.0.0.0__b77a5c561934e089/System.ServiceModel.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System.ServiceModel/System.ServiceModel.config'.
Mono: Assembly Ref addref NLog[0x11af300] -> System.ServiceModel[0x1380f10]: 2
Mono: Assembly Ref addref System.ServiceModel[0x1380f10] -> mscorlib[0x1167280]: 9
Mono: Assembly Ref addref System.ServiceModel[0x1380f10] -> System[0x11dd950]: 5
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll'.
Mono: Image addref System.Runtime.Serialization[0x13affe0] -> /glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll[0x13acc60]: 2
Mono: Assembly System.Runtime.Serialization[0x13affe0] added to domain Program.exe, ref_count=1
Mono: Assembly Loader loaded assembly from location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Runtime.Serialization/4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll.config'.
Mono: Config attempting to parse: '/glb/data/SHARE/mono/mono-3.0.8/etc/mono/assemblies/System.Runtime.Serialization/System.Runtime.Serialization.config'.
Mono: Assembly Ref addref NLog[0x11af300] -> System.Runtime.Serialization[0x13affe0]: 2
Mono: Assembly Ref addref System.Runtime.Serialization[0x13affe0] -> mscorlib[0x1167280]: 10
Mono: Assembly Ref addref Program[0x11a7b00] -> Utilities[0x11b5320]: 3
Mono: Assembly Ref addref Utilities[0x11b5320] -> NLog[0x11af300]: 3
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Reactive.Interfaces/2.0.20823.0__f300afd708cefcd3/System.Reactive.Interfaces.dll'.
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/System.Reactive.Interfaces.dll'.
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/System.Reactive.Interfaces.dll'.
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/mono/gac/System.Reactive.Interfaces/2.0.20823.0__f300afd708cefcd3/System.Reactive.Interfaces.exe'.
Mono: Assembly Loader probing location: '/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/System.Reactive.Interfaces.exe'.
Mono: Assembly Loader probing location: '/glb/data/SHARE/mono/mono-3.0.8/lib/System.Reactive.Interfaces.exe'.
Mono: The following assembly referenced from /glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/Utilities.dll could not be loaded:
     Assembly:   System.Reactive.Interfaces    (assemblyref_index=1)
     Version:    2.0.20823.0
     Public Key: f300afd708cefcd3
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/glb/home/usbwao/dev/x/SHARE/src/bin/DebugNoStaticAnalysis/).

Mono: Failed to load assembly Utilities[0x11b5320]

Mono: Could not load file or assembly 'System.Reactive.Interfaces, Version=2.0.20823.0, Culture=neutral, PublicKeyToken=f300afd708cefcd3' or one of its dependencies.
Program pid () exited with code 1
Comment 4 Brandon Wallace 2013-04-11 09:45:11 UTC
I'm sorry.  I meant to say I removed my "MONO_PATH" environment variable.
Comment 5 Atsushi Eno 2013-05-01 00:30:05 UTC
I had some wrong library reference description in pkg-config that prevented Rx assemblies showing up on the Add Reference dialog in MonoDevelop.

But regardless of that, it won't fix your issue. The version we ship is 2.1.30214.0 which does not match your app's expectation.

I confirmed that the Rx assembly is resolved from the GAC when the version matches:

atsushi@atsushi-U24A:~/tests$ cat rx.cs
using System;
using System.Reactive.Linq;

public class Test
{
	public static void Main ()
	{
		Observable.Range (0, 3).Subscribe (Console.WriteLine);
	}
}

atsushi@atsushi-U24A:~/tests$ LC_ALL=en_US ls *Reactive*
ls: cannot access *Reactive*: No such file or directory
atsushi@atsushi-U24A:~/tests$ mcs rx.cs -pkg:reactive
atsushi@atsushi-U24A:~/tests$ mono rx.exe
0
1
2
atsushi@atsushi-U24A:~/tests$ env | grep MONO_PATH
atsushi@atsushi-U24A:~/tests$