The type or namespace name 'Caching' does not exist in the namespace 'System.Runtime'

江枫思渺然 提交于 2020-01-23 04:45:17

问题


I know there is usually a simple solution to this which is reference the dll in add references. But I have added the reference and system.runtime.caching appears in my references list but the error still displays.

The error displays in the browser in runtime so it does compile.

I have removed and re added the reference but still no luck. I have restarted VS 2012 and restarted.

Visual Studio 2012 .net framework 4.5

Screen shot:


回答1:


I had the same issue, and I found out that I manually had to add:

<assemblies>
  <add assembly="System.Runtime.Caching, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>

to my web.config file.




回答2:


The most likely cause of this error is that you are using a Client Profile version of the .Net framework.




回答3:


I had a similar issue and it went away when I changed the target framework of the from .NET Framework 4 Client Profile to .Net Framework 4



来源:https://stackoverflow.com/questions/14200018/the-type-or-namespace-name-caching-does-not-exist-in-the-namespace-system-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!