What does the security.config.cch file do with the CLR?

I had unpleasant locks when debugging under VS2008, SP1 on my machine. I ran ProcMon.exe to try to determine what was going on. One thing I see is 100 or 1000 repeated readings + writing to a file called security.config.cch and security.config.cch.new.

What kind of files are these? Why does my application need to read + write repeatedly to this file?

Thanks Dave

Example:

 2: 18: 14.1421944 PM App.vshost.exe 1152 ReadFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch SUCCESS Offset: 170,397, Length: 208 2: 18: 14.1422854 PM App.vshost.exe 1152 ReadFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch SUCCESS Offset: 170,605, Length: 224 2: 18: 14.1423824 PM App.vshost.exe 1152 WriteFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch.new SUCCESS Offset: 206,817, Length : 208 2: 18: 14.1424843 PM App.vshost.exe 1152 WriteFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch.new SUCCESS Offset: 207,025 , Length: 224 2: 18: 14.1425788 PM App.vshost.exe 1152 WriteFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch.new SUCCESS Offset : 207,249 Le  ngth: 12 2: 18: 14.1426746 PM App.vshost.exe 1152 ReadFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch SUCCESS Offset: 170,841, Length: 220 2: 18: 14.1427679 PM App.vshost.exe 1152 ReadFile C: \ Documents and Settings \ myuser \ Application Data \ Microsoft \ CLR Security Config \ v2.0.50727.42 \ security.config.cch SUCCESS Offset: 171,061, Length: 224 
+4
source share
1 answer

security.config.cch files and their variants ( security.config.cch.new , security.config.cch.[random numbers] , etc.) are security cache files .

These files are essentially the CAS (Code Access Security) cache of the requirements of your application code. They allow the CLR embedded security system to respond more quickly to the security requirements of your code.

You can safely delete these files, and this will cause your initial performance to be a little slower next time, however, the CLR security engine will eventually generate these files.

A known issue that may occur as a result of this process is, "FIX: error message when trying to start a web application that was created using the .NET Framework 2.0:" Sudden changes occurred " , however this applies to the .NET Framework 2.0 and may or cannot be applied to the .NET Framework 3.5 SP1 (which you use with VS2008 SP1).

It is perfectly normal if there are a lot of reads / writes in these files, if the reads / writes seem excessive and until you encounter locks, I would consider either analyzing your code (if you have many calls, require specific security actions or the equivalent) or examine the configuration Runtime Security Policy installed in the .NET Framework Configuration Tool (Mscorcfg.msc) .

+7
source

All Articles