问题
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