ASP.NET 中的 System.Linq 命名空间出现 CS0234 错误
在我的公司,我们为 Web 应用程序(开发、登台、生产)提供分层环境。 我对我的一个应用程序进行了一系列更改,并将它们部署到开发环境(带有 IIS 6.0 的 Windows 2003)。 我还必须立即更改需要修复当前生产应用程序问题的用户控制文件之一。
我刚刚将一个文件部署到临时环境(带有 IIS 6.0 的 Windows 2003),该文件是生产环境的精确副本,但出现以下 ASP.NET 2.0 编译错误。
异常类型:HttpCompileException 异常消息: d:\inetpub\myapp\BaseControl.cs(3): 错误 CS0234:类型或命名空间 名称“Linq”不存在于 命名空间“System”(您是否缺少 装配参考?)
我将原始文件从生产环境(Windows 2003 w/ IIS 6.0)复制回临时文件,并得到了相同的错误。 我还回收并重新启动了应用程序池。 我仍然得到相同的结果。
大家都经历过这个问题并且知道如何解决吗?
更新:
.NET 3.5 框架安装在开发和登台服务器上。 每个环境都托管在同一服务器上。 开发环境运行良好。
At my company, we have tiered environment for our web applications (development, staging, production). I made a bunch of changes to one of my applications and deployed them to the development environment (Windows 2003 w/ IIS 6.0). I also had to make an immediate change to one of the user control files that needs to fix issue with the current production application.
I just deployed the one file to the staging environment (Windows 2003 w/ IIS 6.0), which is an exact copy of production on got the following ASP.NET 2.0 compilation error.
Exception type: HttpCompileException
Exception message:
d:\inetpub\myapp\BaseControl.cs(3):
error CS0234: The type or namespace
name 'Linq' does not exist in the
namespace 'System' (are you missing an
assembly reference?)
I copied the original file from production (Windows 2003 w/ IIS 6.0) back down to staging and got the same error. I also recycled and restarted the application pool. I still get the same result.
Has everyone experienced this issue and know how to resolve it?
UPDATE:
The .NET 3.5 framework is installed on the development and staging server. Each environment is hosted on the same server. The development environment is working just fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的暂存环境中缺少 web.config 文件。 我从生产环境复制了 web.config,一切正常...
My web.config file was missing from my staging environment. I copied the web.config from the production environment and everything is working...
确保 System.Core 可用,因为这是 System.Linq 所在的位置。 您的环境中是否安装了.NET 3.5?
Make sure you have System.Core available, as this is where System.Linq lives. Do you have .NET 3.5 installed on the environment?
您需要 .net 3.5 才能使用 System.Linq 或与 linq 相关的任何内容
you need .net 3.5 to use System.Linq or anything related to linq