One way to avoid copying PDB and XML files of a referenced assembly to the output is to set the "Copy Local" property of the reference to "False".
To do this in Visual Studio, right-click on the referenced assembly in the Solution Explorer and select "Properties". In the Properties window, change the "Copy Local" property to "False". This will prevent the PDB and XML files from being copied to the output directory when the project is built.
Alternatively, you can use a post-build event to delete the PDB and XML files from the output directory after the build is complete. To do this, go to the project properties and select the "Build Events" tab. In the "Post-build event command line" field, enter a command to delete the PDB and XML files. For example:
del $(TargetDir).pdb del $(TargetDir).xml
This will delete all PDB and XML files in the output directory after the build is complete.
Asked: 2023-05-10 08:21:53 +0000
Seen: 16 times
Last updated: May 10 '23