user1809104
user1809104

Reputation: 717

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

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:

Screen shot

Upvotes: 17

Views: 12230

Answers (4)

Rodrigo
Rodrigo

Reputation: 1

Go to Solution Explorer, right-click on References and "Add Reference." Select "Assemblies", if it's not already highlighted, and start searching for "System.Runtime.Cashing". Before you finish typing you should see it listed.

Check the box to the left and click ok.

Upvotes: -1

Liknes
Liknes

Reputation: 195

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.

Upvotes: 4

Ashim
Ashim

Reputation: 33

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

Upvotes: 0

competent_tech
competent_tech

Reputation: 44941

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

Upvotes: 0

Related Questions