[英]Strange linq exception on Visual Studio for Mac
我有一個非常古老的項目,它是用Xamarin(現在是Visual Studio for Mac)編寫的。
該項目適用於mysql數據庫和entityframework。
當我嘗試做一個非常基本的查詢時
using (myentities db = myentities())
{
customer.where(c => ... any filter ...)
}
我得到這個例外:
System.MethodAccessException
Method `System.Data.DataView.get_RowPredicate()' is inaccessible from method `System.Data.LinqDataView.get_RowFilter()'
請注意-該表為空,我也不例外。 -2年前在同一台計算機上運行良好!
任何想法 ?
謝謝
LinqDataView
正在使用DataView
(通過繼承和使用DataView
RowPredicate
)
看來LinqDataView
和DataView
是不兼容的版本,因此LinqDataView調用的DataView在編譯時具有RowPredicate,但是您正在使用的DLL中的DataView沒有(可訪問的)RowPredicate
LinqDataView
在System.Data.DataSetExtensions dll中,而DataView
在System.Data dll中。
因此,System.Data.DataSetExtensions dll與System.Data dll之間存在不兼容性。
仔細檢查這些dll /軟件包是否已正確更新/安裝。 (也許還清除obj / bin文件夾並檢查.configs的版本)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.