<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>jaredpar's WebLog : CLR</title><link>http://blogs.msdn.com/jaredpar/archive/tags/CLR/default.aspx</link><description>Tags: CLR</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Disabling JIT optimizations while debugging</title><link>http://blogs.msdn.com/jaredpar/archive/2008/08/29/disabling-jit-optimizations-while-debugging.aspx</link><pubDate>Fri, 29 Aug 2008 15:00:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8896637</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/8896637.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=8896637</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=8896637</wfw:comment><description>&lt;p&gt;If you've ever been debugging a managed app, only to be unable to evaluate any of the locals or parameters because the code was &amp;quot;optimized&amp;quot;, check out the article below.&amp;#160; It shows a quick trick to disable optimizations by way of a .ini file.&amp;#160; This is great because it doesn't force you to recompile the application and takes only seconds to implement. &lt;/p&gt;  &lt;p&gt;The short version is create an .ini file (i.e. myapp.ini) with the following contents. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;pre&gt;[.NET Framework Debugging Control]
GenerateTrackingInfo=1
AllowOptimize=0&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;This has really saved me time debugging recently.&amp;#160; It's been blogged about by several others but given that I've had to search for this solution 3 times in as many weeks, I figured blogging about it would make it easier to find next time :)&lt;/p&gt;

&lt;p&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx" href="http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx"&gt;http://msdn.microsoft.com/en-us/library/9dd8z24x.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8896637" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/CLR/default.aspx">CLR</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Debugging/default.aspx">Debugging</category></item><item><title>CLR Changes in 3.5 SP1</title><link>http://blogs.msdn.com/jaredpar/archive/2008/08/22/clr-changes-in-3-5-sp1.aspx</link><pubDate>Fri, 22 Aug 2008 15:00:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8881444</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/8881444.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=8881444</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=8881444</wfw:comment><description>&lt;p&gt;If you haven't come across this post yet about inlining changes in 3.5 SP1 it's a good read.&amp;nbsp; The short version is, value types will have better performance.&lt;/p&gt; &lt;p&gt;&lt;a title="http://blogs.msdn.com/clrcodegeneration/archive/2007/11/02/how-are-value-types-implemented-in-the-32-bit-clr-what-has-been-done-to-improve-their-performance.aspx" href="http://blogs.msdn.com/clrcodegeneration/archive/2007/11/02/how-are-value-types-implemented-in-the-32-bit-clr-what-has-been-done-to-improve-their-performance.aspx"&gt;http://blogs.msdn.com/clrcodegeneration/archive/2007/11/02/how-are-value-types-implemented-in-the-32-bit-clr-what-has-been-done-to-improve-their-performance.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8881444" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/CLR/default.aspx">CLR</category></item><item><title>CLR Memory Model</title><link>http://blogs.msdn.com/jaredpar/archive/2008/01/17/clr-memory-model.aspx</link><pubDate>Thu, 17 Jan 2008 20:16:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7142582</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/7142582.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=7142582</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=7142582</wfw:comment><description>&lt;p&gt;Internally and externally I see a lot of questions about the .Net Memory Model.&amp;nbsp; I think a lot of the confusion comes from the specs.&amp;nbsp; Mainly that there are really two of them.&lt;/p&gt; &lt;p&gt;The first is the &lt;a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-335.pdf"&gt;ECMA CLI Memory Model&lt;/a&gt; (Partition 1, Section 12).&amp;nbsp; This standard introduces a relaxed memory model which, IMHO, makes multi-threading program a bit difficult.&amp;nbsp; For instance it allows for write reordering which can be quite confusing to programmers (and result in very hard to track bugs). &lt;/p&gt; &lt;p&gt;The CLR 2.0 Memory Model is a stricter version of the EMCA model.&amp;nbsp; There are two excellent sources of information on the more strict version.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a title="http://msdn.microsoft.com/msdnmag/issues/05/10/MemoryModels/" href="http://msdn.microsoft.com/msdnmag/issues/05/10/MemoryModels/"&gt;http://msdn.microsoft.com/msdnmag/issues/05/10/MemoryModels/&lt;/a&gt;&amp;nbsp; - Vance Morrison's detailed article on multi-threaded apps and locking techniques.&amp;nbsp; He goes into a bit of detail on how the ECMA and CLR 2.0 models differ and the justification for making them do so.&amp;nbsp; &lt;/li&gt; &lt;li&gt;&lt;a title="http://www.bluebytesoftware.com/blog/2007/11/10/CLR20MemoryModel.aspx" href="http://www.bluebytesoftware.com/blog/2007/11/10/CLR20MemoryModel.aspx"&gt;http://www.bluebytesoftware.com/blog/2007/11/10/CLR20MemoryModel.aspx&lt;/a&gt; - Joe Duffy sums up Vance's article and defines a set of 6 simple rules to the memory model.&amp;nbsp; &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;For anyone doing multi-threaded programming in .Net, both of these articles are a must read.&amp;nbsp; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7142582" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/CLR/default.aspx">CLR</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/Threading/default.aspx">Threading</category></item><item><title>IMetaDataImport::GetParamForMethodIndex</title><link>http://blogs.msdn.com/jaredpar/archive/2007/07/30/imetadataimport-getparamformethodindex.aspx</link><pubDate>Mon, 30 Jul 2007 20:09:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4134295</guid><dc:creator>Jared Parsons</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jaredpar/comments/4134295.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaredpar/commentrss.aspx?PostID=4134295</wfw:commentRss><wfw:comment>http://blogs.msdn.com/jaredpar/rsscomments.aspx?PostID=4134295</wfw:comment><description>&lt;p&gt;While investigating a recent bug I found about an interesting return for GetParamForMethodIndex.&amp;nbsp; On a perfectly verifiable assembly, a call to GetParamForMethodIndex was returning a failure code.&amp;nbsp;After some searching I found the return code was&amp;nbsp;CLDB_E_RECORD_NOTFOUND. I was surprised at first because it's a verifiable assembly so how could the record for a parameter I knew existed not be there?&lt;/p&gt; &lt;p&gt;It turns out this is legal.&amp;nbsp; GetParamForMethodIndex returns a mdParamDef token by which you can query for information about a parameter with GetParamProps.&amp;nbsp; This will return the following information about a parameter.&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;Name of the parameter&lt;/li&gt; &lt;li&gt;Attributes about the param (ByRef, Marshal, etc ...)&lt;/li&gt; &lt;li&gt;Default value&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;In this particular case the assembly was generated without a parameter name.&amp;nbsp; As it also had none of the information the parameter row was omitted from the metadata.&amp;nbsp; The reason is adding an empty row takes up space and provides no data.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Note you can't reproduce this behavior with ILASM.exe.&amp;nbsp; If you omit a parameter name, ILASM.exe will add one for you and hence generate a parameter row. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4134295" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaredpar/archive/tags/DotNet/default.aspx">DotNet</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/CLR/default.aspx">CLR</category><category domain="http://blogs.msdn.com/jaredpar/archive/tags/IMetaDataImport/default.aspx">IMetaDataImport</category></item></channel></rss>