Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道在发布模式下构建代码时会进行优化,因此应该始终将其部署到生产环境中,但我想知道是否有办法确定您的代码是使用调试版本还是发布版本部署的.
PowerShell cmdlet 是否会成为此类查询的潜在途径?
尝试这样的功能:
function Test-DebugAssembly($path) { $assembly = [Reflection.Assembly]::LoadFile("$path") $attr = $assembly.GetCustomAttributes([Diagnostics.DebuggableAttribute], $false) if (!$attr) { $false } else { $attr.IsJITTrackingEnabled } }