<?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>Oliver's Place &#187; .Net</title>
	<atom:link href="http://weichhold.com/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://weichhold.com</link>
	<description></description>
	<lastBuildDate>Fri, 10 Sep 2010 08:21:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MongoDb LINQPad Driver</title>
		<link>http://weichhold.com/2010/09/10/mongodb-linqpad-driver/</link>
		<comments>http://weichhold.com/2010/09/10/mongodb-linqpad-driver/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 08:21:56 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[LINQPAD]]></category>

		<guid isPermaLink="false">http://weichhold.com/?p=178</guid>
		<description><![CDATA[I&#8217;ve recently switched the persistence layer of one of my pet projects from Amazon SimpleDb to MongoDb. As a big proponent of LINQ I was delighted to realize that with NoRM there is an excellent LINQ based .Net Driver for MongoDb. Since am also an avid LINQPad user I wanted the same level of easy of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently switched the persistence layer of one of my pet projects from <a href="http://aws.amazon.com/simpledb/" target="_blank">Amazon SimpleDb</a> to <a href="http://www.mongodb.org/" target="_blank">MongoDb</a>. As a big proponent of LINQ I was delighted to realize that with <a href="http://normproject.org/" target="_blank">NoRM</a> there is an excellent LINQ based .Net Driver for MongoDb.</p>
<p>Since am also an avid <a href="http://www.linqpad.net/" target="_blank">LINQPad</a> user I wanted the same level of easy of use and integration for MongoDb as there is with Linq To SQL. So I invested an evening and wrote a LINQPad DynamicDataContextDriver.</p>
<p>The purpose of the driver is to provide the glue between  three involved parties:</p>
<ol>
<li>LINQPad</li>
<li><a href="http://normproject.org/" target="_blank">NoRM</a></li>
<li>and finally the Entites (or Domain Classes) defined by your Project(s)</li>
</ol>
<p><span id="more-178"></span></p>
<p>After the driver has been installed, LINQPad&#8217;s <em>Add Connection</em> Dialog contains a new type of connection:</p>

<a href="http://weichhold.com/wp-content/gallery/misc/linqpad1.png" title="" class="thickbox" rel="singlepic9" >
	<img class="ngg-singlepic" src="http://weichhold.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=9&amp;width=500&amp;height=&amp;mode=" alt="linqpad1" title="linqpad1" />
</a>

<p>To add a new Connection, select the <em>MongoDb</em> Driver, click <em>Next </em>and you are greeted with the Driver&#8217;s Connection Configuration Dialog:</p>

<a href="http://weichhold.com/wp-content/gallery/misc/linqpad2_0.png" title="" class="thickbox" rel="singlepic11" >
	<img class="ngg-singlepic" src="http://weichhold.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=11&amp;width=500&amp;height=&amp;mode=" alt="linqpad2_0" title="linqpad2_0" />
</a>

<p>The Connection String should be pretty self explanatory but the <em>Entity Assembly </em>and <em>Entity Namespaces(s)</em><em> </em>field might need some explanation. The Entity Assembly is supposed to contain the entity or domain classes of your project. Since NoRM does not define any marker interfaces, base classes or attributes for those classes I opted to identify them within the assembly by namespace which you can specify in the third field of the configuration dialog (separate multiple namespaces with semicolon).</p>
<p>Please refer to the <a href="http://normlinqpaddriver.codeplex.com/">Driver&#8217;s Project Page</a> for Installation Instructions and Source Code.</p>
<img src="http://weichhold.com/?ak_action=api_record_view&id=178&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://weichhold.com/2010/09/10/mongodb-linqpad-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Mercurial over SSH with Private Key in TeamCity CI</title>
		<link>http://weichhold.com/2010/08/12/using-mercurial-over-ssh-with-private-key-in-teamcity-ci/</link>
		<comments>http://weichhold.com/2010/08/12/using-mercurial-over-ssh-with-private-key-in-teamcity-ci/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 15:52:56 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Continous Integration]]></category>
		<category><![CDATA[Mercurial]]></category>
		<category><![CDATA[TeamCity]]></category>

		<guid isPermaLink="false">http://weichhold.com/?p=161</guid>
		<description><![CDATA[Due to the much better Visual Studio and Windows integration of Mercurial I&#8217;ve recently switched from Git to Mercurial for my .Net based projects. After setting up a Windows Server 2008 R2 instance on my VMWare vSphere Box I&#8217;ve switched from Hudson to TeamCity for Continuous Integration and I&#8217;m pretty satisfied with the outcome. I [...]]]></description>
			<content:encoded><![CDATA[<p>Due to the much better Visual Studio and Windows integration of Mercurial I&#8217;ve recently switched from Git to Mercurial for my .Net based projects. After setting up a Windows Server 2008 R2 instance on my <a href="http://www.vmware.com/products/vsphere/">VMWare vSphere Box</a> I&#8217;ve switched from Hudson to TeamCity for Continuous Integration and I&#8217;m pretty satisfied with the outcome. I can finally handle both Java and .Net Projects on a single CI Server.</p>
<p>There was one issue that was causing me a major headache during the setup phase and that was getting Mercurial talk to my private repository server over SSH using private key authentication from within TeamCity&#8217;s Windows Service running under the SYSTEM account (I&#8217;d rather have it run under a non-privileged user but that doesn&#8217;t seem to be supported).<br />
<span id="more-161"></span><br />
The first problem was getting Mercurial to use Putty&#8217;s plink.exe while running under the system account. Normally you would just create a file named mercurial.ini in the user&#8217;s home directory containing something like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code5'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1615"><td class="code" id="p161code5"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>ui<span style="">&#93;</span></span>
<span style="color: #000099;">ssh</span> <span style="color: #000066; font-weight:bold;">=</span> <span style="color: #933;">&quot;C:\Program Files\putty\plink.exe&quot;</span> -i <span style="color: #933;">&quot;c:\your.ppk&quot;</span></pre></td></tr></table></div>

<p>But where do you put this file in the case of the system account? Some Googling on that matter turned out that it should go to \System32\config\systemprofile. I&#8217;ve tried that to no avail. Mercurial would still try to invoke ssh.exe which is obviously nowhere to be found on a Windows box. I realized that the Mercurial Executable is 32-Bit which meant that the home directory of the SYSTEM account had to be located somewhere under \SysWoW64 and indeed there is a \SysWoW64\config\systemprofile directory. After moving my mercurial.ini to that directory the &#8220;Test Connection&#8221; button in TeamCity would *drumroll* &#8230; HANG!</p>
<p>The reason for this behavior was that plink.exe prompted the user to accept the new ssh host key &#8211; in an invisible shell window. To overcome this hurdle I shutdown the TeamCity Web Service and opened a new shell window running under the SYSTEM Account using the <a href="http://technet.microsoft.com/de-de/sysinternals/bb897553.aspx">psExec Utility</a> by Mark Russinovich:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code6'); return false;">View Code</a> SHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1616"><td class="code" id="p161code6"><pre class="shell" style="font-family:monospace;">psexec.exe -s cmd.exe</pre></td></tr></table></div>

<p>Now that I had a shell running under the system account I could connect to my server and accept the host key:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code7'); return false;">View Code</a> SHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1617"><td class="code" id="p161code7"><pre class="shell" style="font-family:monospace;">plink 192.168.230.1</pre></td></tr></table></div>

<p>Low and behold clicking the &#8220;Test Connection&#8221; button in TeamCity would now give me a different error:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p161code8'); return false;">View Code</a> SHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1618"><td class="code" id="p161code8"><pre class="shell" style="font-family:monospace;">&quot;C:\Program Files (x86)\Mercurial\hg.exe&quot; identify ssh://git@192.168.230.1/usr/local/hg/testproject' command failed.
stderr: abort: no suitable response from remote hg!
&nbsp;
stdout: remote: abort: There is no Mercurial repository here (.hg not found)!</pre></td></tr></table></div>

<p>Fiddling around with the settings for another hour turned out that there was a problem with my SSH Url in TeamCity: ssh://git@192.168.230.1/usr/local/hg/testproject</p>
<ol>
<li>The ssh URL contained the user name</li>
<li>The path needs to contain a second / at the beginning otherwise the server will see it as &#8220;usr/local/hg/testproject&#8221;</li>
<li>The user name must not be part of the SSH Url but needs be entered in Teamcity&#8217;s &#8220;User name:&#8221; field under &#8220;Authorization Settings&#8221;</li>
</ol>
<p>After changing the SSH Url to: ssh://192.168.230.1//usr/local/hg/testproject (please note the double slash after the host), I could finally connect, pull the sources and build my project.</p>
<p>Please keep in mind that your private key may <b>not</b> be protected by a passphrase!</p>
<img src="http://weichhold.com/?ak_action=api_record_view&id=161&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://weichhold.com/2010/08/12/using-mercurial-over-ssh-with-private-key-in-teamcity-ci/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio &#8211; The Descent</title>
		<link>http://weichhold.com/2008/07/05/visual-studio-the-descent/</link>
		<comments>http://weichhold.com/2008/07/05/visual-studio-the-descent/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 23:19:20 +0000</pubDate>
		<dc:creator>oliver</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[IntelliJ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Resharper]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://weichhold.com/?p=12</guid>
		<description><![CDATA[Sometimes I can&#8217;t help but getting nostalgic when I think about the old days when Microsoft Visual Studio was the benchmark for Integrated Development Environments. Back then when I used Visual C++ 2.0 the first time, I immediately fell in love with it. The IDE ran under Windows NT (I refused to use Windows 3.1 [...]]]></description>
			<content:encoded><![CDATA[
<a href="http://weichhold.com/wp-content/gallery/misc/vc6_0.png" title="VC++" class="thickbox" rel="singlepic6" >
	<img class="ngg-singlepic ngg-left" src="http://weichhold.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=6&amp;width=&amp;height=100&amp;mode=" alt="vc6.png" title="vc6.png" />
</a>
 Sometimes I can&#8217;t help but getting nostalgic when I think about the old days when Microsoft Visual Studio was the benchmark for Integrated Development Environments. Back then when I used Visual C++ 2.0 the first time, I immediately fell in love with it. The IDE ran under Windows NT (I refused to use Windows 3.1 and 95 for anything productive), had an excellent editor and kick-ass debugger, was fast, and just did what it was supposed to do without getting in my way. The following releases improved on that foundation and introduced features such as IntelliSense, incremental Compilation and minimal Rebuild. Everything was good in Developer Land.</p>
<p>Unfortunately, all of that ended with the release of Visual Studio .Net 2002. This was the first release which introduced support for the .Net Framework in the IDE. Don’t get me wrong. I still regard the .Net Framework as one of Microsoft’s better products, but this post is about Visual Studio and the impact the framework plus other contributing factors had on the quality of IDE.  Visual Studio .Net 2002 took approximately two hours to install on my relatively powerful workstation. After that, when I was allowed to launch the IDE, the greatly increased startup time was immediately noticeable. But hey that’s the price you got to pay for all those shiny new features right?</p>
<p><span id="more-12"></span>During the following months it turned out that studio had not only gotten much slower but also much less stable – especially when working with .Net applications. The debugger was freezing on me so often that I became afraid of using it at all. The same applied to the Winforms GUI Builder which just did not seem to be stable enough for complex projects. At the time when the successor product Visual Studio 2003 was released, I got more and more into ASP.Net web development and this is where things got nasty.</p>
<p>Open source and commercial Java IDE’s like <a href="http://www.eclipse.org/" target="_blank">Eclipse</a> and <a href="http://www.jetbrains.com/idea/" target="_blank">IntelliJ</a> have caught up with Studio a long time ago, but unlike Visual Studio, they kept pushing forward with excellent productivity and refactoring features while Microsoft in turn introduced feature after feature which no experienced developer really cares about (new Ctrl+Tab feature in Visual Studio 2008 anyone?), consuming even more resources for eye candy and useless stuff.</p>
<p>The project I am currently involved in is a large scale ASP.Net based CRM Web Application consisting of a couple thousand C# source files and approximately 400 ASPX pages with associated ASCX web controls. Just opening the solution takes 2 minutes and a 3 GHz workstation. Opening the first Web Control takes another 2 minutes, changing anything inside the file incurs another 1 minute penalty. Why? I have NO idea. I suspect that there’s a ton of costly object marshalling between the managed and non-managed parts of the IDE going on under the hood, combined with a healthy amount of various workarounds and hacks to ensure compatibility with stuff that should have been abandoned a long time ago.
<a href="http://weichhold.com/wp-content/gallery/misc/teasersharpdevelop2onvista.png" title="SharpDevelop - the Open Source .Net IDE - running on Windows Vista." class="thickbox" rel="singlepic7" >
	<img class="ngg-singlepic ngg-right" src="http://weichhold.com/wp-content/plugins/nextgen-gallery/nggshow.php?pid=7&amp;width=&amp;height=100&amp;mode=" alt="teasersharpdevelop2onvista.png" title="teasersharpdevelop2onvista.png" />
</a>

<p>Sure, I could de-install <a title="Resharper" href="http://www.jetbrains.com/resharper/" target="_blank">Resharper</a> and by doing that cut the waiting time in half, but let’s face it: Resharper is currently the only serious option to turn Visual Studio into something that remotely resembles a modern IDE after you’ve used one of the aforementioned Java IDEs. Unfortunately, Resharper comes with a double price tag: first it’s quite expensive for an addon (you almost get a license for IntellJ for the same money) and it makes Visual Studio even slower and more prone to crashes.</p>
<p>Out of desperation I recently tried out <a href="http://sharpdevelop.net/OpenSource/SD/" target="_blank">SharpDevelop</a> – the Open Source Development Environment for .NET. It opened our solution in under ten seconds. Bummer! If I was Microsoft’s Developer Products manager I’d pay the SharpDevelop team a visit with a suitcase full of cash, lock them up in a room with unlimited resources let them take over the development. But that will probably never happen because Microsoft has lost its focus on all fronts including the developers. And realizing this has converted another Microsoft Developer into a Java and Rails Developer.</p>
<img src="http://weichhold.com/?ak_action=api_record_view&id=12&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://weichhold.com/2008/07/05/visual-studio-the-descent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
