[英]LINQ Design Time Errors Upgrading From VS2010 to VS2013
After upgrading to Visual Studio 2013, I am seeing errors throughout one of my WCF Framework 4.0 projects. 升级到Visual Studio 2013之后,我在整个WCF Framework 4.0项目之一中看到错误。 Wherever there is a LINQ entity query I am seeing this error upon using any LINQ function such as Any(), Single(), SingleOrDefault(), OrderBy() etc:
每当有LINQ实体查询时,使用任何LINQ函数(例如Any(),Single(),SingleOrDefault(),OrderBy()等)时,都会看到此错误:
Error 3 The type arguments for method
'System.Linq.Enumerable.OrderBy<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>,
System.Func<TSource,TKey>)' cannot be inferred from the usage. Try
specifying the type arguments explicitly.
Example line of code generating the error: 产生错误的示例代码行:
xxxxXXXXXXStatusList = xxxXXXXXContainer.XXXXXXXStatus.OrderBy(a => a.Status).ToList();
As well as: 以及:
Error 42 Delegate
'System.Func<BusinessAccess.Entities.XXXPortal.XXXXXXXXInfo, int,
bool>' does not take 1 arguments
With example: 带有示例:
xxxxxxInfo = xxxXXXXXContainer.XXXXXList.Where(c => c.xxxxxxid.Equals(xxxxxxid)).Single();
Here is what I have tried: 这是我尝试过的:
Any ideas greatly appreciated. 任何想法表示赞赏。 Clearly it's a referencing/compile configuration issue, but it's currently eluding me.
显然,这是一个引用/编译配置问题,但目前使我难以理解。
Many thanks for your time. 非常感谢您的宝贵时间。
We found it internally. 我们在内部找到它。 For anyone else seeing blanket problems with Intellisense, yet able to build successfully:
对于看到Intellisense全面问题但又能够成功构建的其他任何人:
I hope that this helps out someone somewhere. 我希望这可以帮助某人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.