Reputation: 809
I am converting an existing .Net 4.5 MVC 5 project to a new ASP.NET 5 project. One of my files is referencing the System.Runtime.Caching namespace but on moving this file to the new project this namespace cannot be found.
I have added System.Runtime as a dependency in the new project, but the .Caching bit seems to be missing from this. Has anybody experienced a similar problem?
Upvotes: 4
Views: 1877
Reputation: 6379
You need to bring in 'Microsoft.Extensions.Caching.Memory' using the following line in your project JSON.
"dependencies": {
"Microsoft.Extensions.Caching.Memory": "1.0.0"
}
Current documentation can be found here.
https://docs.asp.net/en/latest/performance/caching/memory.html
Upvotes: 3
Reputation: 2890
To use the System.Runtime.Caching
namespace in an ASP.NET application, you must add a reference to the namespace.
To add a reference to the Website
Ref: https://msdn.microsoft.com/en-us/library/ff477235(v=vs.110).aspx#Anchor_2
Upvotes: 1