.net:应引用模块System.Core版本3.5.0.0
我有几个可能相关的问题。
首先,在我的 ASP.NET MVC 项目视图中,如下所示的 lambda 表达式语法:
<% =Html.TextBoxFor(x => x.Umi)%>
导致 ReSharper 突出显示该行并显示消息:
Module 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' should be referenced
其次,在 IEnumerable
会导致编译错误,因为找不到扩展方法。Where
扩展方法同一视图中的
在项目中添加对 System.Core 的引用会导致以下结果:
A reference to System.Core could not be added. This component is automatically referenced by the build system.
我认为这些内容与该项目是作为 .NET 4 项目创建的事实有关,但我必须将其更改为目标 3.5,因为服务器不这样做已安装 4 个。
有人帮忙吗?
I have a couple of probably related issues.
Firstly in my ASP.NET MVC project view, lambda expression syntax like this:
<% =Html.TextBoxFor(x => x.Umi)%>
results in ReSharper highlighting the line and displaying the message :
Module 'System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' should be referenced
Secondly, using the Where
extension method on an IEnumerable<T>
in the same view causes a compilation error because the extension method cannot be found.
Adding a reference in the project to System.Core results in this:
A reference to System.Core could not be added. This component is automatically referenced by the build system.
I assume this stuff is related to the fact that the project was created as a .NET 4 project but I had to change it to target 3.5 instead as the server doesn't have 4 installed.
Anyone help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管我仍然不知道是什么导致了问题,但我能够通过修改项目的 .csproj 文件以手动添加引用来修复它。
将 System.Core 的引用直接添加到 .csproj 文件中的代码如下:
Although I still have no idea what caused the problem, I was able to fix it by modifying the project's .csproj file to manually add the reference.
The code to add a reference to System.Core directly into the .csproj file is below: