I guess it is examining the IL; and genuinely - that IL does not ever contain a new MyPrivateClass
instruction - because that statement is presumably running against IQueryable<T>
, hence that lambda is an expression tree. It will contain some Expression.New
, and some typeof(MyPrivateClass)
- but no new MyPrivateClass
.
In this case, the error is misleading. Simply suppress it.