Ask Your Question
0

How can the copying of PDB and XML files of a referenced assembly to the output be avoided?

asked 2023-05-10 08:21:53 +0000

djk gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-05-10 08:39:01 +0000

woof gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-10 08:21:53 +0000

Seen: 15 times

Last updated: May 10 '23