名称空间中不存在System.Web.Helpers:WebImage

时间:2012-07-12 21:55:32

标签: asp.net-mvc-3 .net-assembly

虽然我知道这已被“回答”了大约5000万次,但我还没有找到解决问题的答案,所以我觉得我别无选择,只能再问一次。

以前的建议: Razor pages in MVC are giving a compile error with System.Web.Helpers not being found

<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

我已将此添加到我的web.config中,但问题仍然存在。

Type or namespace name does not exist

我只有一个项目,而targetFramework是4.0。

我安装了Microsoft.Web.Helpers 1.15(2.0与MVC3不兼容。)Microsoft.Web.Helpers.dll位于我的bin文件夹中。

奇怪的是,有Microsoft.Web.Helpers和System.Web.Helpers。在这种情况下我需要System.Web.Helpers,因为我在我的代码中使用了WebImage。

1 个答案:

答案 0 :(得分:5)

正如我一直告诉别人的,当我寻求帮助时,我找到了答案。在我的情况下,通过升级到Microsoft ASP.NET Helper Library 2.0然后尝试撤消该操作,以某种方式在早期销毁我的解决方案的过程中,System.Web.Helpers在我的项目中停止成为引用的程序集。简单修复!

当然,修复导致我出现下一个Assembly Reference错误。我想我会在这里过夜。