<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Deserialized &#187; Gotcha</title>
	<atom:link href="http://deserialized.com/category/gotcha/feed/" rel="self" type="application/rss+xml" />
	<link>http://deserialized.com</link>
	<description>The Ramblings of a Web Architect</description>
	<lastBuildDate>Mon, 23 Jan 2012 16:33:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ObjectID’s with MongoDB and the mongodb-csharp driver</title>
		<link>http://deserialized.com/c-sharp/objectids-with-mongodb-and-the-mongodb-csharp-driver/</link>
		<comments>http://deserialized.com/c-sharp/objectids-with-mongodb-and-the-mongodb-csharp-driver/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 17:06:38 +0000</pubDate>
		<dc:creator>Bryan Migliorisi</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Gotcha]]></category>
		<category><![CDATA[mongodb]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://deserialized.com/objectids-with-mongodb-and-the-mongodb-csharp-driver/</guid>
		<description><![CDATA[I mist say, the latest release of mongodb-csharp is rather awesome.  Typed collections and LINQ support mean I can worry more about my application than about the data layer. Here is an example of using typed collections: public class Customer { public Oid Id { get; set; } public string Name { get; set; } [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdeserialized.com%2Fc-sharp%2Fobjectids-with-mongodb-and-the-mongodb-csharp-driver%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdeserialized.com%2Fc-sharp%2Fobjectids-with-mongodb-and-the-mongodb-csharp-driver%2F&amp;source=Deserialized&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I mist say, the latest release of <a title="MongoDB C# Driver" href="http://github.com/samus/mongodb-csharp">mongodb-csharp</a> is rather awesome.  Typed collections and LINQ support mean I can worry more about my application than about the data layer.</p>
<p>Here is an example of using typed collections:</p>
<pre class="brush: csharp">public class Customer
{
	public Oid Id { get; set; }
	public string Name { get; set; }
	public CustomerBillingInfo Billing { get; set; }
	public List Depts { get; set; }
}

public void AddCustomer(Customer customer) {
	...(code removed for simplicity)...
	IMongoCollection collection = database.GetCollection();
	collection.Save(customer);
}</pre>
<h2>Gotcha: Beware of the ID property!</h2>
<p>One thing that threw me off when I began using the typed collections was that I had defined my ID property as “<span style="font-family: 'Courier New';">_id</span>” because That is what <a title="MongoDB" href="http://www.mongodb.org/">MongoDB</a> uses internally.  While this made sense to me, the <span style="font-family: 'Courier New';">mongod</span> process kept throwing errors whenever I tried the following:</p>
<pre class="brush: csharp">...(code removed for simplicity)...
IMongoCollection&lt;customer&gt; collection = database.GetCollection&lt;customer&gt;();
Customer customer = collection.Linq().First(c =&gt; c.Name == "test customer");
customer.Name = "A new name!";
collection.Save(customer);</pre>
<p>The error looked something like this:</p>
<pre class="brush: csharp">Fri Jun 25 10:43:14 Exception 11000:E11000 duplicate key error index: test06.Customer.$_id_  dup key: { : ObjId(4c24c07a189cf31bd4000002) }
Fri Jun 25 10:43:14    Caught Assertion in insert , continuing
Fri Jun 25 10:43:14 insert test06.Customer exception userassert:E11000 duplicate key error index: test06.Customer.$_id_  dup key: { : ObjId(4c24c07a189cf31bd4000002) } 21ms</pre>
<p>It was driving me crazy for days before I realized that the driver was doing some magic – the POCO object needed its ID to be named “Id” instead of “_id” an as soon as I changed that – it started working properly.</p>
]]></content:encoded>
			<wfw:commentRss>http://deserialized.com/c-sharp/objectids-with-mongodb-and-the-mongodb-csharp-driver/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gotcha: 32-bit applications may not be able to see files on 64-bit Windows</title>
		<link>http://deserialized.com/gotcha/gotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows/</link>
		<comments>http://deserialized.com/gotcha/gotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 04:29:12 +0000</pubDate>
		<dc:creator>Bryan Migliorisi</dc:creator>
				<category><![CDATA[Gotcha]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[iis7]]></category>

		<guid isPermaLink="false">http://deserialized.com/gotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows/</guid>
		<description><![CDATA[This one really threw me off tonight.&#160; I am running Windows Server 2008 on one of my boxes and I was trying to set up some advanced URL Routing on IIS7.&#160; IIS7 Manager has a very nice easy to use GUI interface, but I prefer working directly in the configuration files. I fire up my [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdeserialized.com%2Fgotcha%2Fgotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdeserialized.com%2Fgotcha%2Fgotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows%2F&amp;source=Deserialized&amp;style=normal&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img style="border-bottom: 0px; border-left: 0px; margin: 0px 40px 0px 0px; display: inline; border-top: 0px; border-right: 0px" title="winlogo-300x265" border="0" alt="winlogo-300x265" align="left" src="http://deserialized.com/wp-content/uploads/2009/11/winlogo300x265.jpg" width="123" height="145" /> This one really threw me off tonight.&#160; I am running Windows Server 2008 on one of my boxes and I was trying to set up some advanced URL Routing on IIS7.&#160; IIS7 Manager has a very nice easy to use GUI interface, but I prefer working directly in the configuration files.</p>
<p>I fire up my Notepad++ and attempt to open a file through the file browser.&#160; I navigate to the IIS config folder (c:\windows\system32\inetsrv\config\) and I see an empty directory.&#160; Huh? How is that possible?!</p>
<p>Now I switch over to Windows Explorer and go to the same folder as above and to my disbelief… there are all the config files.&#160; Ok now I am truly confused!</p>
<h2>Conclusion</h2>
<p>While I cannot seem to find anything from Microsoft about this issue, my findings are that 32-bit applications cannot see the entire file system!&#160; I installed a few applications that I know are only 32-bit to verify this and sure enough they all suffered from the exact same issue.&#160; </p>
<p>Files simply do not show up and if you attempt to open the file (because you do know the full path &amp; filename), it simply tells you that the file does not exist.</p>
]]></content:encoded>
			<wfw:commentRss>http://deserialized.com/gotcha/gotcha-32-bit-applications-may-not-be-able-to-see-files-on-64-bit-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

