有谁知道导致以下错误的原因是什么?
The type or namespace name 'ObservableCollection' does not exist in the namespace 'System.Collections.ObjectModel' (are you missing an assembly reference?) c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\myweb\ea5ddc82\99690bad\App_WebReferences.7f8qgamu.0.cs
事实证明,我的IIS虚拟目录存在冲突。 所以我所做的就是删除IIS中的应用程序。
答案 0 :(得分:1)
您需要在项目中引用使用ObservableCllection的正确程序集。在ObservableCollection的情况下,这个dll从.Net 3.5更改为.Net 4。
在.NET 4之前,ObservableCollection在WindowsBase.dll中,从.Net 4开始,它在System.dll中。所以我想这取决于你编译的框架版本。