title: Setting property value with no setter using PrivateObject
body: <p>Using a <code>PrivateObject</code>, I'm trying to create an instance of the <code>ItemChange</code> class (found <a href="http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.itemchange_members%28v=exchg.80%29.aspx" rel="nofollow">here</a>). Looking through the debugger as well as the object browser in Visual Studio 2008 I can't seem to find <em>anything</em> related to the <code>ItemId</code> property other than a setter. Below is the code I am using.</p>
  
  <pre><code>var itemChange = new PrivateObject(typeof(ItemChange));
  
  itemChange.SetFieldOrProperty("ChangeType", _fixture.CreateAnonymous&lt;ChangeType&gt;());
  itemChange.SetFieldOrProperty("ItemId", _fixture.CreateAnonymous&lt;ItemId&gt;());
  </code></pre>
  
  <p>The error I receive is:</p>
  
  <pre><code>System.MissingMethodException : Method 'Microsoft.Exchange.WebServices.Data.ItemChange.ItemId' not found.
  </code></pre>
  
  <p>I've tried variations of <code>BindingFlags</code>, however nothing seems to help. How can I set a property that has no setter and only a getter?</p>
  
  <h3>Edit</h3>
  
  <p>Regarding my comments, the other inline class that I can create a <code>PrivateObject</code> object instance and set the <code>ItemId</code> is the <code>ItemEvent</code> class (found <a href="http://msdn.microsoft.com/en-us/library/microsoft.exchange.webservices.data.itemevent_members%28v=exchg.80%29.aspx" rel="nofollow">here</a>). This class was easy because when I was debugging and added the class to my watch list I could see <code>itemId</code> as a private variable. However, performing the same steps on the <code>ItemChange</code> class I <em>cannot</em> find <em>any</em> traces of an <code>ItemId</code> field other than the property itself that <em>only</em> has a setter. This is where I'm stumped on how to set this property.</p>
  
  <p>Lastly, I don't have access to a tool that would allow me to decompile the class and see what is what.</p>