Azure / Azure-Functions

1.11k stars 195 forks source link

Azure Functions SDK is shipping with Embedded PDB #2126

Open chuckries opened 2 years ago

chuckries commented 2 years ago

Azure Functions SDK is shipping release built, optimized binaries with Embedded PDBs. Embedded PDBs are not expected to be used for release distribution, and bloat the size of the binaries packages. The presence of the embedded pdb also causes issues with the VS Debugger, as embedded PDBs are loaded even when Just My Code is enabled, causing non-user exceptions within the Azure Functions SDK to appear to the user.

I am adding a fix for this embedded pdb load behavior in VS, but I still think it incorrect that Azure is shipping embedded PDB's in the SDK.

At least one known example of this is Microsoft.Azure.WebJobs.Host.dll which is part of the Microsoft.Azure.WebJobs package. It is a release built, optimized binary but still contains an embedded pdb. I imagine there are others within the SDK.

v-bbalaiagar commented 2 years ago

Hi @pragnagopa / @fabiocav, Can you please suggest how to proceed here

davide-bergamini-sevenit commented 1 year ago

This is still a problem

chuckries commented 1 year ago

@davide-bergamini-sevenit what is your scenario and what is the issue you are seeing? This has been mitigated in Visual Studio 2022, as embedded PDB's will follow rules for Just My Code. If you have Tools > Options > Debugging > General > Just My Code enabled, the symbols should no longer load for these assemblies.

davide-bergamini-sevenit commented 1 year ago

image You are right, it seems it's still happening because some SDK modules are compiled "not optimized" (like in Debug), and VS use this as a signal they're part of user code.