CMS Snapshot Analysis - Run Analyzer - DOTNet - Information - How to split the DOTNet class file

Purpose

This page provides you with information on how to split the dotnet class file, if the size of the file is more than 2 MB and leads to memory issue during the analysis process.   This is rarely required anymore with improvements to the .NET analyzer.

Applicable in CAST Version


Release
Yes/No
8.3.x (tick)
Applicable RDBMS
RDBMS
Yes/No
CSS (tick)
Details

To split the class file whose size is more than 2 MB and causes the memory issue while running the analysis, you need to edit the class file to partial class files.


1. Take the backup of the file which need to be split.
2. Copy the usings and namespace of the class in each of the new file and then copy and paste the lines of code (as required considering the size of the new file) in this file from the original one.

3.The class declaration should be as mentioned below:

Original file: <access specifier> class <class name>
New file: <access specifier> partial class <class name>

4. The braces should be closed equally, which means every open brace should have its closed brace.

5. Add the reference of the new files in the project file where Original.cs was previously referred, please find the screen shot below:

While splitting the file you need to keep in mind that the new partial class file size should be around 1MB and should not exceed 1MB.

6.Copy and paste all the new file in the same location, where the original file was there and add the reference of the new files in the project file, where original cs file was previously referred.

 

Note: Please find the attached files which has been split using the above steps.


Notes/comments


Related Pages