views:

51

answers:

2

I've various versions of the .NET Framework (versions 1.1 thru 4.0) installed on a remote machine running XP Professional. I've installed Reactive Extension too for good measure.

I also have an application which works on my machine because it references System.Threading found here: C:\Program Files\Microsoft Reactive Extensions\redist\desktopV2\System.Threading.dll

I have two versions of the DLL in the GAC also.

Two questions:

i) Why did Visual Studio decide that this is the version (instance) to reference when I chose from the list rather than browsing to to the file?

ii) Why does System.Threading not exist on the remote machine? (I thought it was a core part of the Framework)

Thanks

A: 

i) The reference list should show all versions of registered components, you either selected that particular version, or if it is not in the list, it must have been unregistered or removed.

ii) System.Threading existed since framework 1, and if it's not on the machine, it must have been unregistered or removed.

I don't know Reactive Extensions, and after some searching I can't find much info whether it does remove System.Threading.dll

Wez
i) I agreeii) I'm ~90% certain this DLL wasn't unregistered or removed. I can't think why it'd happen.
sarfeast
+2  A: 

System.Threading.dll was added in .NET 4.0 (though the namespace System.Threading has been around since v1). Rx includes a version of System.Threading.dll that was backported to .NET 3.5 SP1.

It sounds like you're targeting .NET 3.5. In this case, the runtime won't load a 4.0-only System.Threading.dll (obviously). Your loading would fail unless you included the Rx version of System.Threading.dll along with your program.

To answer the questions directly:

  1. Rx registers its own private directories as framework extensions. This is how it's found by VS.
  2. System.Threading.dll is only included in .NET 4.0, so if you are targeting an earlier framework, it won't be found.

To solve your problem, either have your program target .NET 4.0 or include Rx's System.Threading.dll along with your program.

P.S. I recommend upgrading to the latest version of Rx. The desktopV2 folder hasn't been used for the last few releases. When upgrading, uninstall the old version first - it works better that way.

Stephen Cleary
+1: Just beat me.
Joe Doyle
+1 for the cute baby. :)
Stephen Cleary
Steady. Picture changes may take up to 24 hours. Also, how about some help with the missing dll?
sarfeast
@sarfeast: If you target .NET 4.0, then the DLL will be correctly loaded from the GAC. If you target .NET 3.5, then include the Rx version of the DLL.
Stephen Cleary