'Why is Visual Studio 2022 building my project in Release build when settings are set for Debug build?
I am trying to debug an assembly in a web project. The web project has a reference to the assembly. I have the code for the assembly. I have set the assembly project whose target framework is .Net Standatd 2.0 to Debug build as shown below. I copied the generated .dll and .pdb files to the \bin\debug\net50 folder of the web project (targets .NET 5.0). During debugging the web project, I noticed in the modules window that Visual Studio loaded the assembly as Optimized and Skipped loading symbols. The dll and .pdb files have the same timestamps. I am not sure why the assembly's symbols are not being loaded.
Then I used this Assembly Information tool and it showed the dll as Release and optimized. So that explains why VS is loading it as such?
My question is why is it being built as Release and optimized? My goal is getting VS to load it where I can set breakpoints and single step through the assembly code.
Solution 1:[1]
There was an Optimize property set to true in the csproj file. Changed it to false.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Tony_Henrich |


