简体   繁体   中英

System.IObserver'1<T0> is defined in an assembly that is not referenced. You must add a reference to assembly

I have checked some code out of source control and am getting the following error when I try to build:

The type 'System.IObserver`1' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Observable, Version=1.0.0.204, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

So first port of call was to Google. Looks like I need the Rx Framework. So I downloaded the Reactive Extensions experimental release . I installed it completely, closed VS2010 SP1, and then went back in. Getting the same error.

What else could I need to do?

As the message says, your project needs to reference the System.Observable assembly. Simply installing the Rx framework doesn't add a reference to your project...

In Visual Studio

  • Right-click the References folder of your project
  • Click Add reference...
  • In the Add Reference window, choose from Assemblies >> Extensions
  • Click System.Observable from the list
  • Click Add

Problem solved

您已经安装了所需的扩展,但您仍需要将其添加为项目中的参考。

Try downloading from NuGet. Right click, "Manage NuGet"... Search Online for "Rx_Exper.."

http://nuget.org/packages/Rx_Experimental-Silverlight/1.1.11111

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

Related Question The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard The type 'System.Data.Common.DbTransaction' is defined in an assembly that is not referenced. You must add a reference to assembly The type 'Component' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ComponentModel.Primitives' NSubstitute -3.x 'ValueType' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, The type 'MarshalByRefObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0 Why am I getting: The type 'IThirdParty' is defined in an assembly that is not referenced. You must add a reference to assembly 'ThirdPartyAssembly'? The type 'DbConnection' is defined in an assembly that is not referenced. I cannot add the reference? The type 'System.Linq.IQueryable`1<T0>' is defined in an assembly that is not referenced The type 'IEnumerable<>' is defined in an assembly that is not referenced. System.Runtime type 'IReportServerCredentials' is defined in an assembly that is not referenced.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM