I'm looking to squeeze some more speed out of my build and was wondering if I could instruct msbuild to not generate PDB files. I'm passing the Configuration=Release
and DebugSymbols=false
property with no luck.
If you really want to turn them off, that's always an option. In your project's Properties window, set the "Debug Info" option to "none" for any configuration you want to change. Do note, however, that the "Debug" and "Release" configurations do by default use different settings for emitting debug information.
No, you don't have to deploy the . pdb file. To quote from MSDN, "A PDB file is created when you build with /debug (Visual Basic/C#).", so it shouldn't be creating the debug database when compiling for release.
The executive summary answer: no, generating PDB files will have no impact on performance whatsoever.
A PDB file is typically created from source files during compilation. It stores a list of all symbols in a module with their addresses and possibly the name of the file and the line on which the symbol was declared. This symbol information is not stored in the module itself, because it takes up a lot of space.
If a project having static library output is compiled in Visual Studio 2022, pdb file is generated in static library output path even if different pdb path is given in C/C++->OutputFiles->ProgramDatabaseFileName.
The ErrorOnDuplicatePublishOutputFiles property relates to whether the SDK generates error NETSDK1148 when MSBuild detects duplicate files in the publish output, but can't determine which files to remove. Set the ErrorOnDuplicatePublishOutputFiles property to false if you don't want the error to be generated.
In .NET Core 3.0 and later versions, a framework-dependent executable is created by default. Set the UseAppHost property to false to disable generation of the executable. For more information about deployment, see .NET application deployment. The following MSBuild properties are documented in this section:
You can configure some run-time behaviors by specifying MSBuild properties in the project file of the app. For information about other ways of configuring run-time behavior, see Runtime configuration settings. The ConcurrentGarbageCollection property configures whether background (concurrent) garbage collection is enabled.
You may have PDB generation in your release configuration. Add this to your release settings:
<DebugSymbols>false</DebugSymbols> <DebugType>None</DebugType>
You can also, do this in your project configuration inside visual studio. Disable PDB Generation
Also, if running MSBuild from the command line, the command line arguments would be
MSBuild.exe YourProject.csproj /p:DebugSymbols=false /p:DebugType=None
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With