asp.net C#操作可能破坏运行 [英] asp.net C# Operation could destabilize the runtime
问题描述
我有以我们正在做的ASP.NET C#MVC项目有问题。
I'm having a problem in an ASP.NET C# MVC project that we're doing.
我们正在使用的.NET Framework 4.0的开发,最近我升级我的Visual Studio 2012(其他人在使用2010),现在它停止工作。现在有些地方我得到的错误:
We're using .NET Framework 4.0 for the development, and recently I upgraded my Visual Studio to 2012 (everyone else is using 2010), and now it stopped working. Now in some places I get the error:
Operation could destabilize the runtime.
我发现一些人说,这与.NET 4.5做安装与Visual Studio 2012,但我没有找到我的问题的解决方案呢。它抱怨在code左右就行看起来是这样的:
I've found some people saying that this has to do with .NET 4.5 being installed with Visual Studio 2012, but I didnt find a solution for my problem yet. The line in code it complains about looks like this:
var companyModel = from c in db.Company select c;
return View(companyModel.ToPagedList(page, 10));
哪些错误这个code? companyModel成为
Whats wrong about this code? companyModel become a
System.Linq.IQueryable<Company>
我尝试添加
companyModel.OfType<Company>();
这两条线之间,但它没有工作从操作是(的想法可能会破坏运行? )
一切工作只是与Visual Studio 2010精谢谢!
Everything works just fine with Visual Studio 2010. Thanks!
推荐答案
获取最新版本PagedList的,这应该修复它。我有同样的问题。
Get the latest version of PagedList, that should fix it. I had the same problem.
这篇关于asp.net C#操作可能破坏运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!