-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DebugSymbols is ignored if DebugType is set. #2169
Comments
related #2170 |
If you modify "VS/project properties/Build/Advanced/Debugging information" then it creates (if necessary) and sets the value of So, if I've understood correctly, it's probably worth noting here that project files generated by Visual Studio rely on the behaviour under discussion. |
As of Feburary 2024, long after the introduction of
In actuality, in the .NET SDK version 7.0 (and also likely 5.0, 6.0, and 8.0, I haven't thoroughly checked those) the actual behavior is:
So, if I were writing the documentation, I'd change the text to something like:
So yes - quite the difference... Furthermore, the documentation on Optimization is incorrect, it says So currently, my default
If it helps, I've put together this table:
|
- use embedded debug information instead of portable pdbs - always emit debug symbols. The `DebugSymbols` property is kind of bugged (see dotnet/msbuild#2169), but it does have advantages when set
@daiplusplus Many thanks for the deep dive! These properties have been confusing me lately as well. Out of curiosity, in your "default |
Whatever is "preferable" for any given situation is subjective; in my case, it is demonstrably not preferable (c.f.: arguments above), but I appreciate that in yours it might be. |
@daiplusplus Thanks for the thoughtful response. I guess the reverse engineering concern is a bit overblown; I too would be flattered if somebody actually cared about my software enough to try that lol, and security through obscurity is not real security anyway, plus most of what I write is open-source anyway. 🤷♂️ I guess a bigger concern about |
I don't think that's the right way of thinking about it, regardless of public/private types and methods, the assembly contains all of the definitions. The PDB contains local variable names, info about scopes, and metadata about methods, importantly the IL offsets to source code mapping. So it's generally proportional to how big the assembly is, and that's around 15%. |
The Fody project recently had an issue where debug symbols were not being processed properly in release mode.
Fody/Fody#360
It turns out that the value of
DebugSymbols
is completely ignored ifDebugType
is set.https://github.com/Microsoft/msbuild/blob/master/src/Tasks/Microsoft.Common.CurrentVersion.targets#L145-L151
But according to the documentation DebugSymbol should control the output of the symbol file.
https://msdn.microsoft.com/en-us/library/bb629394.aspx
Is this a bug?
The text was updated successfully, but these errors were encountered: