本文介绍了MVC-ControllerTypeCache.xml在MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调试ASP.NET MVC源,我发现的MVC-ControllerTypeCache.xml使用文件。
但我无法理解使用这种file.I的意思是保存这个文件在哪里?
如何asp.net MVC利用这个文件呢?
请帮助。

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.

推荐答案

该文件用于高速缓存控制器类型,以避免昂贵的反思查找。它是动态生成并存储在 C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\临时ASP.NET文件\\ NAMEOFYOURAPP \\ XXXXX \\ XXXXXXXX \\ UserCache \\ 文件夹中。

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.

它是由 TypeCacheUtil 内部类,你可以找到在ASP.NET MVC源$ C ​​$ c中的TypeCacheUtil.cs处理。

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=2.0.0.0, Culture=neutral, PublicKeyToken=null">
    <module versionId="0bd9573a-7a89-4eab-b33d-cc92573fc2ba">
      <type>APPNAME.Controllers.BaseController</type>
    </module>
  </assembly>
  <assembly name="APPNAME.BusinessLogic, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
    <module versionId="3fb0cce6-10dd-43d3-a44c-00046017b574">
      <type>APPNAME.BusinessLogic.Controllers.AssetsController</type>
      <type>APPNAME.BusinessLogic.Controllers.HomeController</type>
    </module>
  </assembly>
  <assembly name="MvcContrib, Version=2.0.36.0, Culture=neutral, PublicKeyToken=null">
    <module versionId="889dd733-c7a0-4ae6-8f50-934f417174ea">
      <type>MvcContrib.PortableAreas.EmbeddedResourceController</type>
      <type>MvcContrib.SubController</type>
    </module>
  </assembly>
</typeCache>

另外还有用来缓存区 MVC-AreaRegistrationTypeCache.xml

这篇关于MVC-ControllerTypeCache.xml在MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 23:09