<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>LifeCycle Solutions, LLC - Weblog</title>
  <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/" />
  <link rel="self" href="http://blog.lifecycle-solutions.com/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2008-07-11T13:44:20.671875-05:00</updated>
  <author>
    <name>LifeCycle Solutions, LLC</name>
  </author>
  <subtitle>Technical Writing</subtitle>
  <id>http://blog.lifecycle-solutions.com/</id>
  <generator uri="http://www.dasblog.net" version="1.8.5223.2">DasBlog</generator>
  <entry>
    <title>NArrange - Take 2</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/NArrange++Take+2.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,9b6813e5-35e1-4246-8735-7d235617fa9a.aspx</id>
    <published>2008-07-11T13:44:20.671875-05:00</published>
    <updated>2008-07-11T13:44:20.671875-05:00</updated>
    <category term="C#" label="C#" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I blogged about <a href="http://www.codeproject.com/KB/codegen/narrange.aspx">NArrange</a> a
      while back, but there's a new version out that makes it even better.  It adds
      support for organizing code <em>without</em> adding #region directives, which I'm
      beginning to <a href="http://www.codinghorror.com/blog/archives/001147.html">agree
      are evil</a>.  The end result is a code file organized by member type and access
      level (ie fields, properties, private, public, etc), and then alphabetically. 
      It includes a configuration tool which lets you set up a configuration file with all
      of the rules you want it to follow.  To turn off #region directives open a configuration
      file in narrange-config, and change Formatting -&gt; Regions -&gt; Region Style to
      'NoDirective'.
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=9b6813e5-35e1-4246-8735-7d235617fa9a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>If You Only Learn One VS Shortcut</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/If+You+Only+Learn+One+VS+Shortcut.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,958a41f4-7785-4004-b376-be10563101d5.aspx</id>
    <published>2008-06-26T12:51:09.109375-05:00</published>
    <updated>2008-06-26T12:51:09.109375-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I'm a visual person.  I've tried to join the keyboard-shortcut-cult.  I've
      tried Enso, Live Desktop, Google Desktop, and just about any productivity-promising
      app Hanselman recommends.  I love the idea, but somehow never end up using them. 
      I never can remember the shortcuts, or even that they are there.  But then again,
      it is <strong><em>Visual</em></strong> Studio, right?  We do have <strong><em>Graphical</em></strong> User
      Interfaces for a reason.  I'd just about given up on trying, until I learned
      one humble little keyboard shortcut that all by itself has saved me tons of time in
      VS:
   </p>
        <h2 align="center">CTRL + .
   </h2>
        <p>
      Any time you see the VS smart tag on some code, press that.  Don't <em>think</em>,
      just do it.  It will do your bidding, before you even know you bid it. 
      Need to implement an interface?  : &lt;interface&gt; Ctrl + . &lt;enter&gt;.
      Add a using namespace? &lt;class name&gt; Ctrl + . &lt;enter&gt;.  Rename a variable? 
      &lt;rename&gt; Ctrl + . &lt;enter&gt;.
   </p>
        <p>
      If you need pictures, here's more: <a title="http://haacked.com/archive/2008/06/23/visual-studio-smart-tag-expansion-tip.aspx" href="http://haacked.com/archive/2008/06/23/visual-studio-smart-tag-expansion-tip.aspx">http://haacked.com/archive/2008/06/23/visual-studio-smart-tag-expansion-tip.aspx</a></p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=958a41f4-7785-4004-b376-be10563101d5" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Cleaning Utilities That Actually Work</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Cleaning+Utilities+That+Actually+Work.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,2240fe62-d686-4ef7-ab15-b201ff711e9f.aspx</id>
    <published>2008-06-25T10:42:50.328125-05:00</published>
    <updated>2008-06-25T10:42:50.328125-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I was all about CleanSweep and DiskDoubler way back when I was 15 and they promised
      to double my disk to a whopping 40MB.  Nowadays I usually shy away from these
      3rd party clean up utilities.  Partly because they tend to be spammy and questionable
      themselves, and partly out of principal - shouldn't the OS handle keeping itself tidy? 
      But recently, with less than a GB left on my disk, and my system crawling, I decided
      to try out a few.  Here are some winners I found:
   </p>
        <ul>
          <li>
            <a href="http://www.kessels.com/Jkdefrag/">JkDefrag</a> - a free, faster, smarter
         defrag utility.  It still uses the windows defrag API, but can be scheduled,
         run as a screensaver, etc.  It also does some additional optimizations.</li>
          <li>
            <a href="http://www.sixty-five.cc/sm/">SpaceMonger</a> - a disk usage analyzer with
         a brilliant UI.  Not free, but worth it.</li>
          <li>
            <a href="http://www.ccleaner.com/">CCleaner</a> - a free clean-up-everything utility. 
         Temp folders, cache, registry, and all of that stuff the OS _should_ do, but doesn't
         (or at least doesn't do it all in one convenient UI).  Unlike similar apps, this
         one is adware free (if you uncheck the 'yahoo toolbar' on setup) and has a clean,
         simple UI.</li>
        </ul>
        <p>
      Between those, I managed to free up 10+ GB!
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=2240fe62-d686-4ef7-ab15-b201ff711e9f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>How To: Configure Virtual PC Network To Allow Inbound and Outbound Connections</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/How+To+Configure+Virtual+PC+Network+To+Allow+Inbound+And+Outbound+Connections.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,329c7315-b8de-4b84-ae88-75d64e901f98.aspx</id>
    <published>2008-05-23T09:23:14.828125-05:00</published>
    <updated>2008-05-23T09:27:37.59375-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Configuring Virtual PCs' network adapters can be confusing.  If you think about
      it, you're taking a network card, which typically has one IP address and one MAC address,
      and making it work for two computers.  Add to that security issues - you may
      not always <em>want</em> a virtual pc getting out over your network- and things get
      complex quickly.   Recently, though, I wanted to set up a SharePoint demo
      on a virtual machine, and wanted a setup that:
   </p>
        <ul>
          <li>
         Allowed my host pc to connect to the web server on the virtual pc.</li>
          <li>
         Allowed the virtual pc to connect to the internet.</li>
          <li>
         Allowed the virtual pc to connect to my host pc</li>
        </ul>
        <p>
      After a little digging, I came across <a href="http://blogs.msdn.com/virtual_pc_guy/archive/2005/10/04/477195.aspx">this
      post on Ben Armstrong's blog</a> that spelled out how to install the 'Microsoft Loopback
      Adapter' and wire it up to a host network adapter.  It worked as advertised,
      but I had to reboot and forgot to set the loopback adapter in the virtual machine
      network settings.   In retrospect, both pretty obvious steps, but, for posterity,
      here are full instructions for the above scenario (Most of these are straight from
      his post - be sure to check his blog out for much more Virtual PC info): 
   </p>
        <p>
      Install Microsoft Loopback Adapter: 
   </p>
        <ul>
          <li>
         On the host operating system go to 'Control Panel' 
      </li>
          <li>
         Go to 'Add Hardware' 
      </li>
          <li>
         In the 'Add Hardware' wizard, click 'Next' 
      </li>
          <li>
         When the 'Is the hardware connected?' page appears, select 'Yes, I have already connected
         the hardware', and then click 'Next' 
      </li>
          <li>
         In the 'Installed hardware' list, select 'Add a new hardware device' and then click
         'Next' 
      </li>
          <li>
         In the 'What do you want the wizard to do?' list, select 'Install the hardware that
         I manually select from a list (Advanced)', and then click 'Next' 
      </li>
          <li>
         In the 'Common hardware types' list, click 'Network adapters', and then click 'Next' 
      </li>
          <li>
         In 'Manufacturer' list, select 'Microsoft' 
      </li>
          <li>
         In the 'Network Adapter' list, select 'Microsoft Loopback Adapter', and then click
         'Next' twice 
      </li>
          <li>
         In the 'Completing the Add Hardware Wizard' page, click 'Finish'</li>
        </ul>
        <p>
      Turn Internet Connection Sharing on, on the adapter that you want to share, NOT on
      the loopback adapter.  Typically this is your Wifi or LAN adapter.
   </p>
        <ul>
          <li>
         On the host operating system go to 'Control Panel' 
      </li>
          <li>
         Go to 'Network Connections' 
      </li>
          <li>
         Right click on the network connection that you use for Internet connectivity and select
         'Properties'  
      </li>
          <li>
         Click on the 'Advanced' tab 
      </li>
          <li>
         Check the option to 'Allow other network users to connect through this computer's
         Internet connection' 
      </li>
          <li>
         If you have multiple network adapters you will need to also specify that you are sharing
         the Internet connection with the Microsoft Loopback Adapter. 
      </li>
          <li>
         Click 'OK'</li>
        </ul>
        <p>
      At this point, I had to reboot.  Your mileage may vary. 
   </p>
        <p>
      Finally, in the virtual machine's settings, change the network adapter to use the
      loopback adapter: 
   </p>
        <ul>
          <li>
         In Virtual PC, go to Settings -&gt; Networking for the machine</li>
          <li>
         Set Adapter 1 to 'Microsoft Loopback Adapter'</li>
          <li>
         Click 'OK'</li>
        </ul>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=329c7315-b8de-4b84-ae88-75d64e901f98" />
      </div>
    </content>
  </entry>
  <entry>
    <title>&amp;quot;Mesh&amp;quot; is the New &amp;quot;Matrix&amp;quot;.</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/quotMeshquot+Is+The+New+QuotMatrixquot.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,9d45f222-c562-4b0b-b473-5e1d95cd6a08.aspx</id>
    <published>2008-04-24T22:56:40.03125-05:00</published>
    <updated>2008-04-24T22:56:40.03125-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I got my beta invite today and tried out <a href="https://www.mesh.com">Windows Live
      Mesh</a>.   There a are a couple similar services out there, not the least
      of which is Microsoft's own FolderShare.  But what makes Mesh interesting is
      the promise of true, seamless synchronization between PCs, mobile devices, and the
      web.  Your data just appears everywhere you want it to.  In theory, there's
      no need to use ActiveSync or any other tool to sync up.  Add to that a sharp,
      clean UI and this is an interesting new product (Excuse me, Technology Preview).
   </p>
        <p>
      By sheer coincidence, I also played with Peer-to-Peer binding in Windows Communication
      Framework.  This lets you very easily expose your services in a P2P manner, and
      also uses the term "mesh" to describe the "cloud" into which your application is connecting. 
      I haven't quite figured out when I could use it in a typical line-of-business app,
      but there's something fun about being able to dress up your services in P2P, Message
      Queuing, or any of the other suits WCF offers, just by adjusting configuration.
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=9d45f222-c562-4b0b-b473-5e1d95cd6a08" />
      </div>
    </content>
  </entry>
  <entry>
    <title>&amp;quot;Hidden&amp;quot; Code Gen Tool in VS2008</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/quotHiddenquot+Code+Gen+Tool+In+VS2008.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,fa790adc-090c-44fb-99fd-2730fb082129.aspx</id>
    <published>2008-04-08T10:18:14.25-05:00</published>
    <updated>2008-04-08T10:18:14.25-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Did you know there was a "hidden" code-generation feature in VS2008?  Text Templating
      Transformation Toolkit  (aka T4) actually debuted in VS2005 Guidance Automation
      Toolkit, but shipped baked into VS2008.  This gives you CodeSmith-style code-generation
      templates that can be used in your projects to generate code from any source. 
      Simply add a text file with the extension ".tt", and VS will add a "Transform Templates"
      button to the solution explorer window.  
   </p>
        <p>
      Here's a video that shows some of the basics:<br /><a title="http://msdn2.microsoft.com/en-us/vs2008/cc308634.aspx" href="http://msdn2.microsoft.com/en-us/vs2008/cc308634.aspx">http://msdn2.microsoft.com/en-us/vs2008/cc308634.aspx</a></p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=fa790adc-090c-44fb-99fd-2730fb082129" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Microsoft Vision of Healthcare</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Microsoft+Vision+Of+Healthcare.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,9eae7fb4-ebdd-44af-a688-819ecad49005.aspx</id>
    <published>2008-03-27T18:08:13.75-05:00</published>
    <updated>2008-03-27T18:08:13.75-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      There are all sorts of jokes that could be made about this, but this is a really cool
      extension of the Surface concept to things like medical charts, wallets, and prescriptions. 
      I just hope they can bring these ideas to market soon!
   </p>
        <p>
          <embed src="http://www.youtube.com/v/6F1u36Y-qlE&amp;hl=en" width="425" height="355" type="application/x-shockwave-flash" wmode="transparent">
          </embed>
        </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=9eae7fb4-ebdd-44af-a688-819ecad49005" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Prevent Multiple Web Server Instances when Debugging</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Prevent+Multiple+Web+Server+Instances+When+Debugging.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,3d119b8f-61d8-41d5-a1f2-4d55f63eeeb3.aspx</id>
    <published>2008-03-25T13:31:43.734375-05:00</published>
    <updated>2008-03-25T13:31:43.734375-05:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      VS 2008 has what I think is a very annoying bug and Redmond thinks is a useful feature. 
      If you create multiple web applications within a single solution, then when you run
      the solution, by default VS will launch a "Cassini" WebServer for each web application
      project.  The rational Microsoft gives for this being a "by design" feature is
      that you may want this behavior when, say, debugging a web app that connects to a
      separate web-hosted WCF service.  Sounds reasonable, except there <em><strong>already
      exists functionality just for this purpose</strong></em>: Solution -&gt; Properties
      -&gt; Multiple Startup Projects!  If I check "Single startup project" here, then
      under no circumstances should multiple projects start up!  This is especially
      annoying when developing solutions with several web projects - each spins up a little
      web server icon in the task tray, with an annoying "pop" and balloon telling you where
      it's running.  In addition, each takes up memory and slows down the build-and-run.
   </p>
        <p>
          <a href="http://blog.lifecycle-solutions.com/images/PreventMultipleWebServerInstanceswhenDeb_BBDC/image.png">
            <img style="border-right: 0px; border-top: 0px; margin: 0px 5px 0px 0px; border-left: 0px; border-bottom: 0px" height="58" alt="image" src="http://blog.lifecycle-solutions.com/images/PreventMultipleWebServerInstanceswhenDeb_BBDC/image_thumb.png" width="244" align="left" border="0" />
          </a>I
      scoured Google and the forums and got nothing on this, but this afternoon I happened
      on the simple workaround.  With a solution explorer and properties window open,
      select each web application project.  In the properties tab, set "Always Start
      When Debugging" to false.  Next time you run, only the projects specified in
      Startup Projects will be run!  Note that this "properties window" is NOT the
      same as the "Project Properties" that you get to from Project -&gt; Properties.
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=3d119b8f-61d8-41d5-a1f2-4d55f63eeeb3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Cool Stuff From Microsoft</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Cool+Stuff+From+Microsoft.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,f50db787-3fde-43e4-bebc-7d37c55cce7b.aspx</id>
    <published>2008-03-05T15:18:29.703125-06:00</published>
    <updated>2008-03-05T15:19:19.546875-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Microsoft at Mix08 announced today some very cool new bits:
   </p>
        <ul>
          <li>
            <a href="http://silverlight.net/learn/mobile.aspx">Silverlight for Windows Mobile
         and Nokia S60</a>
          </li>
          <li>
            <a href="http://silverlight.net/GetStarted/#betajump">Silverlight 2.0 for Windows
         and OSX</a>
          </li>
          <li>
            <a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/readiness/Install.htm">Internet
         Explorer 8 Beta 1</a>
          </li>
          <li>
            <a href="http://www.microsoft.com/downloads/details.aspx?familyid=38cc4cf1-773a-47e1-8125-ba3369bf54a3&amp;displaylang=en&amp;tm">ASP.NET
         MVC Preview 2</a>
          </li>
        </ul>
        <p>
      All fun stuff to poke around with!  Also, at another conference, they announced <a href="http://msdn2.microsoft.com/en-us/embedded/bb267253.aspx">.NET
      Micro Framework v2.5</a>, which now <a href="http://blogs.msdn.com/netmfteam/archive/2008/01/09/microsoft-net-micro-framework-newsletter-vol-1-no-2.aspx">supports
      TCP\IP and web services</a>. 
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=f50db787-3fde-43e4-bebc-7d37c55cce7b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Eric Sink's Source Control Howto</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Eric+Sinks+Source+Control+Howto.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,817f8159-a90f-4ac3-a822-5e1958d9f5ec.aspx</id>
    <published>2008-03-05T15:18:05.375-06:00</published>
    <updated>2008-03-05T15:18:05.375-06:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      We've been having some weirdness going on with our source control.  Nothing major-
      (Note to our clients: your code is safe and backed up daily!) - but little things
      like files getting out of sync, or appearing checked in in the IDE, but not in the
      source control server.   While searching about it, I ran across this <a href="http://www.ericsink.com/scm/source_control.html">definitive
      guide to source control</a>  by none less than Mr. Source Control himself, Eric
      Sink- founder of SourceGear.   This mini e-book is very well-written and
      covers a broad spectrum of source control concepts and tools - not just Vault. 
      In addition to explaining the concepts in laymen's terms, he peppers best practice
      side-bars through out the text, distilling the concepts into concrete guidance developers
      can use.   It's old - started in Aug 2004- so I'm surprised I'm just now
      coming across this, but it's definitely a must-read for any developer working in a
      team &gt; 1.
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=817f8159-a90f-4ac3-a822-5e1958d9f5ec" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Obscure Error: Method 'nnn' in type 'nnn' from assembly 'nnn' does not have an implementation</title>
    <link rel="alternate" type="text/html" href="http://blog.lifecycle-solutions.com/Obscure+Error+Method+Nnn+In+Type+Nnn+From+Assembly+Nnn+Does+Not+Have+An+Implementation.aspx" />
    <id>http://blog.lifecycle-solutions.com/PermaLink,guid,f3b61d4a-4aac-4654-9d0c-3d39b2884429.aspx</id>
    <published>2008-02-28T09:41:42.90625-06:00</published>
    <updated>2008-02-28T09:41:42.90625-06:00</updated>
    <category term="C#" label="C#" scheme="dasBlog" />
    <category term="Reflection" label="Reflection" scheme="dasBlog" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I've been experimenting with the idea of using System.Reflection.Emit to generate
      code from interfaces.  If you're not familiar with this namespace, it contains
      classes to generate compiled assemblies programmatically.   Regex uses this
      when compiling a regular expression for faster execution.  Instead of parsing
      the expression each time, it generates on-the-fly a class that can be used to execute
      the expression.  This namespace is also used by Mock Type frameworks such as
      RhinoMocks and TypeMock.  Given a base class or interface, these generate on-the-fly
      a class that can mimic the base enough to use when unit testing.  I'm sure there
      are other places this is used, but suffice it to say this is one of those obscure
      corners of the framework that us Morts rarely dig into.  So it's not surprising
      that I would run into an obscure error that stumped even Google.
   </p>
        <p>
      I religiously studied the MSDN examples and wrote code to let me do something like
      this:
   </p>
        <p>
      ICustomer concreteType = CodeGenerator&lt;ICustomer&gt;.GetInstance();
   </p>
        <p>
      You can see how freaking awesome this could be for component development- I get, at
      runtime, a class that implements my interface, but I don't have to wire up goo like
      INotifyPropertyChanged, IDataError, property getter/setters, etc.   Depending
      on how my tinkering goes, more on the awesomeness later.  The error I was getting
      whenever I called typeBuilder.CreateType() was:
   </p>
        <p>
      System.TypeLoadException: Method 'get_Id' in type 'Customer' from assembly 'TypeAssembly,
      Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation
   </p>
        <p>
      Except I WAS implementing 'get_Id'.  I copied the code to do it straight from
      MSDN! See:
   </p>
        <p>
      MethodAttributes getSetAttributes = MethodAttributes.Public | 
      <br />
      MethodAttributes.SpecialName | 
      <br />
      MethodAttributes.HideBySig;<br />
      var getMethodBuilder = typeBuilder.DefineMethod("get_" + propertyOnInterface.Name,<br />
                                                     
      getSetAttributes,<br />
                                                    
      propertyOnInterface.PropertyType,<br />
                                                    
      Type.EmptyTypes); 
   </p>
        <p>
      ILGenerator getMethodIl = getMethodBuilder.GetILGenerator();<br />
      getMethodIl.Emit(OpCodes.Ldarg_0);<br />
      getMethodIl.Emit(OpCodes.Ldfld, fieldBuilder);<br />
      getMethodIl.Emit(OpCodes.Ret); 
   </p>
        <p>
      propBuilder.SetGetMethod(getMethodBuilder);
   </p>
        <p>
      Much googling turned up only a few unrelated posts.  After testing, I discovered
      that removing a call to 'AddInterfaceImplementation' fixed the issue- though the resulting
      class no longer implemented my interface.  Clearly the interface was generating
      some sort of code.  Some more digging, and I figured out the solution:
   </p>
        <p>
      MethodAttributes getSetAttributes = MethodAttributes.Public | 
      <br />
      MethodAttributes.SpecialName | 
      <br />
      MethodAttributes.HideBySig;| <strong>MethodAttributes.Virtual</strong>;
   </p>
        <p>
      I could be flawed in my understanding here, but apparently, when adding an interface,
      .NET treats property get and set accessors sort of like abstract methods.  The
      code I was generating <em>did</em> implement 'get_Id', but did not mark it as overriding
      the interface's definition.  So, when creating the type, there was the interfaces'
      unfinished implementation of 'get_Id', and my completely unrelated 'get_Id'.  
   </p>
        <p>
      So anyway, hopefully this post will make it into Google and help some other poor guy
      who, late one night, finds themselves turning over parts of the framework better left
      alone.
   </p>
        <img width="0" height="0" src="http://blog.lifecycle-solutions.com/aggbug.ashx?id=f3b61d4a-4aac-4654-9d0c-3d39b2884429" />
      </div>
    </content>
  </entry>
</feed>