简体   繁体   English

LINQ设计时间错误从VS2010升级到VS2013

[英]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: 这是我尝试过的:

  • Building the project. 建立项目。 It builds successfully and hides the errors temporarily until the code is edited. 它会成功构建并暂时隐藏错误,直到代码被编辑为止。
  • Removing the LINQ reference and re-adding. 删除LINQ参考并重新添加。 Unsuccessful. 不成功。
  • Checking that the target framework was still 4.0. 检查目标框架是否仍为4.0。 It is. 它是。
  • Checked the migration log from 2010 to 2013, which showed a successful migration. 检查了从2010年到2013年的迁移日志,该迁移日志显示迁移成功。
  • Upgrading to VS2013 Update 1: In progress right now... 升级到VS2013 Update 1:正在进行中...

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全面问题但又能够成功构建的其他任何人:

  • Visual Studio 2013 is not compatible with MVC3, which is what was causing all of the errors in our UI projects. Visual Studio 2013与MVC3不兼容,这是导致我们的UI项目中出现所有错误的原因。
  • Also incompatibilities with Entity Framework 4 were occurring, which is what I was specifically seeing above. 同时也发生了与Entity Framework 4的不兼容,这是我在上面具体看到的。

I hope that this helps out someone somewhere. 我希望这可以帮助某人。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将.NET Web应用程序从VS2010升级到2013并没有将图标更改为VS2013 - Upgrade .NET web application from VS2010 TO 2013 did not change the icon to VS2013 设计视图中的VS2010许可错误 - VS2010 License Error in Design View 在项目开发过程中从VS2010升级到VS2012会有任何风险吗? - Is there any risk in upgrading from VS2010 to VS2012 in the middle of project development? 从VS2012迁移到VS2013或VS 2015 - Moving from VS2012 to VS2013 or VS 2015 从Vs2013删除扩展 - Remove An Extension From Vs2013 每当我在VS2013中更改项目时,构建都会失败且不会出现错误 - Any time I change a project in VS2013, the build fails with no errors 从vs2013升级到vs2017后无法加载文件或程序集&#39;System.Web.Http,Version = 4.0.0.0&#39; - Could not load file or assembly 'System.Web.Http, Version=4.0.0.0' after upgrading from vs2013 to vs2017 从VS2010升级到VS2012后,Linq到EF加入“索引超出范围” - Linq to EF Join throws “Index was out of range” after upgrade from VS2010 to VS2012 VS2010请求时间很长 - Very long request time VS2010 该项目与vs2013 Express中针对vs2013 Ultimate的当前版本的Visual Studio不兼容 - This project is incompatible with the current version of Visual Studio for vs2013 ultimate from vs2013 express
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM