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'开发者_Go百科 (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.
精彩评论