Click to Download C# Example CachingFileDependencyInCSharp.zip
Click to Download VB.NET Example CachingFileDependencyInVBNet.zip
Before .Net 4.0 we are using System.Web.Caching.Cache object. Now in .Net 4.0 introduce same system.web.caching functionality in System.Runtime.Caching.dll everything was rebuilt into the new namespace of System.Runtime.Caching.
The reason for this is that the System.Web.Caching.Cache object was so useful that other application developers like Windows Forms, Windows Presentation Foundation apps, and more were need to bring the System.Web namespace into their projects to make use of this cache object. So, to remove this dependency this was all extracted out and extended with the System.Runtime.Caching namespace.
As an ASP.NET developer, we can still use of the System.Web.Caching.Cache object just as we did in all the earlier versions of ASP.NET. It isn’t going away. However, it is important to note that as the .NET Framework evolves, the .NET team will be making its investments into the System.Runtime.Caching namespace rather than System.Web.Caching.
This means that over time, we will most likely see additional enhancements in the System.Runtime.Caching version that changes does not appear in the System.Web.Caching namespace as you might expect. it does not also mean that we need to move everything over to the new System.Runtime.Caching namespace to make sure we are following the strategic path of Microsoft, because the two caches are managed together under the covers.
Here is example for this.
Click to Download VB.NET Example CachingFileDependencyInVBNet.zip
Before .Net 4.0 we are using System.Web.Caching.Cache object. Now in .Net 4.0 introduce same system.web.caching functionality in System.Runtime.Caching.dll everything was rebuilt into the new namespace of System.Runtime.Caching.
The reason for this is that the System.Web.Caching.Cache object was so useful that other application developers like Windows Forms, Windows Presentation Foundation apps, and more were need to bring the System.Web namespace into their projects to make use of this cache object. So, to remove this dependency this was all extracted out and extended with the System.Runtime.Caching namespace.
As an ASP.NET developer, we can still use of the System.Web.Caching.Cache object just as we did in all the earlier versions of ASP.NET. It isn’t going away. However, it is important to note that as the .NET Framework evolves, the .NET team will be making its investments into the System.Runtime.Caching namespace rather than System.Web.Caching.
This means that over time, we will most likely see additional enhancements in the System.Runtime.Caching version that changes does not appear in the System.Web.Caching namespace as you might expect. it does not also mean that we need to move everything over to the new System.Runtime.Caching namespace to make sure we are following the strategic path of Microsoft, because the two caches are managed together under the covers.
Here is example for this.