{"id":1925,"date":"2017-03-21T11:12:57","date_gmt":"2017-03-21T10:12:57","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/lavanack\/?p=1925"},"modified":"2022-05-30T13:52:36","modified_gmt":"2022-05-30T11:52:36","slug":"lister-les-attributs-de-debug-de-vos-dll-list-the-debuggable-attributes-of-your-dll","status":"publish","type":"post","link":"https:\/\/laurentvanacker.com\/index.php\/2017\/03\/21\/lister-les-attributs-de-debug-de-vos-dll-list-the-debuggable-attributes-of-your-dll\/","title":{"rendered":"Lister les attributs de debug de vos DLL \/ List the debuggable attributes of your DLL"},"content":{"rendered":"<p><a href=\"#en-us\" name=\"fr-fr\">Go to English version<\/a><\/p>\n<p>L\u2019article <a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/33961718-64c4-4986-a092-5cfad7c8e414\/isjittrackingenabled-and-other-debugging-flags-explained?forum=vsdebug\">suivant<\/a> explique en d\u00e9tail les attributs <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjittrackingenabled(v=vs.110).aspx\">IsJITTrackingEnabled<\/a> (\u00c0 partir de .NET Framework 2.0, les informations de suivi JIT sont toujours activ\u00e9es pendant le d\u00e9bogage et cette valeur de propri\u00e9t\u00e9 est ignor\u00e9e) et <a title=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjitoptimizerdisabled(v=vs.110).aspx\" href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjitoptimizerdisabled(v=vs.110).aspx\">IsJITOptimizerDisabled<\/a> d\u2019une DLL. Dans le cadre d\u2019une application Web, de nombreuses DLL peuvent \u00eatre utilis\u00e9es et il serait fastidieux de devoir les tester une \u00e0 une avec <a href=\"https:\/\/msdn.microsoft.com\/fr-fr\/library\/f7dy01k1(v=vs.110).aspx\">ILDasm.exe<\/a>. Je vous propose donc un script Powershell qui listera ces attributs sur les DLL d\u2019un r\u00e9pertoire ou d\u2019un site Web donn\u00e9. Le resultat sera similaire \u00e0 la capture d\u2019\u00e9cran ci-dessous pour chaque DLL.<\/p>\n<p><a href=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/03\/image462-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; margin-right: auto; margin-left: auto; float: none;\" title=\"image\" src=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/03\/image_thumb438-1.png\" alt=\"image\" width=\"826\" height=\"131\" border=\"0\" \/><\/a><\/p>\n<p>Le but est d&rsquo;avoir les deux propri\u00e9t\u00e9s \u00e0 false.<\/p>\n<p>Le script est disponible <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Windows%20Powershell\/IIS\/Get-DebuggableAttribute.ps1\">ici<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/01\/012717_1333_Fusionnerde1.png\" alt=\"\" \/><\/p>\n<p><a href=\"#fr-FR\" name=\"en-us\">Aller \u00e0 la version fran\u00e7aise<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>The following <a href=\"https:\/\/social.msdn.microsoft.com\/Forums\/vstudio\/en-US\/33961718-64c4-4986-a092-5cfad7c8e414\/isjittrackingenabled-and-other-debugging-flags-explained?forum=vsdebug\">article<\/a> explained the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjittrackingenabled(v=vs.110).aspx\">IsJITTrackingEnabled<\/a> (Starting with the .NET Framework 2.0, JIT tracking information is always enabled during debugging, and this property value is ignored) and <a title=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjitoptimizerdisabled(v=vs.110).aspx\" href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.diagnostics.debuggableattribute.isjitoptimizerdisabled(v=vs.110).aspx\">IsJITOptimizerDisabled<\/a> of a DLL. In the context of a web application, a great number of DLL can be used and an individual processing (one DLL at at time) with <a href=\"https:\/\/msdn.microsoft.com\/fr-fr\/library\/f7dy01k1(v=vs.110).aspx\">ILDasm.exe<\/a>. could be painful. So I propose a PowerShell script which will list these attributes for all DLL inside a specified directory or a web site. The result will be similar to the screenshot below pour each DLL.<\/p>\n<p><a href=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/03\/image463-1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"border-width: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; margin-right: auto; margin-left: auto; float: none;\" title=\"image\" src=\"http:\/\/laurentvanacker.com\/wp-content\/uploads\/2017\/03\/image_thumb439-1.png\" alt=\"image\" width=\"826\" height=\"120\" border=\"0\" \/><\/a><\/p>\n<div>\n<p>The purpose is to have both properties set to false.<\/p>\n<p>The script is available <a href=\"https:\/\/github.com\/lavanack\/laurentvanacker.com\/blob\/master\/Windows%20Powershell\/IIS\/Get-DebuggableAttribute.ps1\">here<\/a>.<\/p>\n<p>Laurent.<\/p>\n<\/div>\n<div>\n<p><!--\n\n<\/div>\n\n\n<\/DIV>\n<\/DIV>\n<\/DIV>\n<\/DIV>\n<\/DIV>\n<\/DIV><\/BODY><\/HTML>--><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Go to English version L\u2019article suivant explique en d\u00e9tail les attributs IsJITTrackingEnabled (\u00c0 partir de .NET Framework 2.0, les informations de suivi JIT sont toujours [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":2472,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,4,7,19],"tags":[20,25,39],"class_list":["post-1925","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-net","category-developpement","category-iis","category-powershell","tag-net","tag-iis","tag-powershell"],"_links":{"self":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/1925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/comments?post=1925"}],"version-history":[{"count":33,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/1925\/revisions"}],"predecessor-version":[{"id":2971,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/posts\/1925\/revisions\/2971"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media\/2472"}],"wp:attachment":[{"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/media?parent=1925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/categories?post=1925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentvanacker.com\/index.php\/wp-json\/wp\/v2\/tags?post=1925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}