Home > DeveloperSection > Forums > what is MVC-ControllerTypeCache.xml in MVC
Elena Glibart
Elena Glibart

Total Post:42

Posted on    January-22-2015 10:26 PM

 ASP.Net ASP.NET MVC  Mvc4  Controller 

 1 Reply(s)
 900  View(s)
Rate this:

While debugging ASP.NET MVC source i found "MVC-ControllerTypeCache.xml" file is used. But i am not able to understand the use of this file.I mean where is this file stored? How asp.net MVc makes use of this file? Please help.

Lillian Martin

Total Post:27

Posted on    January-22-2015 10:59 PM

The file is used to cache controller types to avoid expensive reflection lookups. It is dynamically generated and stored in the c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\NAMEOFYOURAPP\xxxxx\xxxxxxxx\UserCache\ folder.

It's handled by the TypeCacheUtil internal class that you could find in the TypeCacheUtil.cs in the ASP.NET MVC source code.

Here's an example of how this file might look like:

<?xml version="1.0" encoding="utf-8"?>

<!--This file is automatically generated. Please do not modify the contents of this file.-->

<typeCache lastModified="04/01/2012 16:35:03" mvcVersionId="3cff62e5-ef21-4e58-897f-d0f1eafd3beb">

  <assembly name="Custom.Web.Mvc, Version=, Culture=neutral, PublicKeyToken=null">

    <module versionId="0bd9573a-7a89-4eab-b33d-cc92573fc2ba">




  <assembly name="APPNAME.BusinessLogic, Version=, Culture=neutral, PublicKeyToken=null">

    <module versionId="3fb0cce6-10dd-43d3-a44c-00046017b574">





  <assembly name="MvcContrib, Version=, Culture=neutral, PublicKeyToken=null">

    <module versionId="889dd733-c7a0-4ae6-8f50-934f417174ea">






There's also the MVC-AreaRegistrationTypeCache.xml which is used to cache areas.

Don't want to miss updates? Please click the below button!

Follow MindStick