简体   繁体   中英

asp.net Web Reference build error

Anyone knows what causes the following error?

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

It turned out the there was a conflict with my IIS Virtual Directory. So what I did was remove the application in my IIS.

You need to reference the correct assembly in your project that uses the ObservableCllection. In the case of ObservableCollection this dll was changed from.Net 3.5 to.Net 4.

Prior to .NET 4, ObservableCollection was in WindowsBase.dll and since.Net 4 it is in System.dll. So I guess it depends on the framework version you compile against.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM