How ro reduce .pdb file size when packaging project?

Hello. This is probably the closest forum category for this kind of question so I’ll ask it here. Basically, I have my project nativized and it has 1620 .cpp modules being generated during nativization. The problem is that the .pdb for that many modules is 4.41GB in size and then the linker throws an error saying:

LINK : fatal error LNK1201: error writing to program database “PathHere” check for insufficient disk space, invalid path, or insufficient privilege

And I’ve already figured out that it’s the size of .pdb causing this because when there were less modules, deleting it helped resolve the issue. Now it doesn’t. Is there a way to make it smaller?

Modifying your .Target.cs file with these options can help make the pdb size smaller.

WindowsPlatform.PdbPageSize = 8192; // allows for PDBs greater than 4gb
WindowsPlatform.bStripUnreferencedSymbols = true;
WindowsPlatform.bMergeIdenticalCOMDATs = true; // we need the pdb space and have to pay the extra link time cost
bDisableDebugInfoForGeneratedCode = true;
// make sure PDBs are always regenerated.
bSupportEditAndContinue = false;
bAdaptiveUnityEnablesEditAndContinue = false;
bUseIncrementalLinking = false;

Another option could be to use:

bUsePDBFiles = false;

which puts the debug information in the .obj file. For more information on what these are doing you can take a look at:

Which is a great microsoft blog post on the topic