<?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>Pearl Tech &#187; Microsoft</title>
	<atom:link href="http://blog.pearltechnology.com/category/microsoft/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.pearltechnology.com</link>
	<description></description>
	<lastBuildDate>Tue, 25 May 2010 14:37:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Enterprise Library Logger.Write Not Working?</title>
		<link>http://blog.pearltechnology.com/enterprise-library-logger-write-not-working/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/enterprise-library-logger-write-not-working/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:29:50 +0000</pubDate>
		<dc:creator>Geer</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Enterprise Library]]></category>
		<category><![CDATA[Logger]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=697</guid>
		<description><![CDATA[Using Logging Application Block provided by Enterprise Library is a common way of logging exceptions in .NET applications.  It&#8217;s easy to setup and to use.  One problem I had a while ago was that it worked while on my development PC, but stopped working once it&#8217;s deployed.
What I was doing was to use it to [...]]]></description>
			<content:encoded><![CDATA[<p>Using Logging Application Block provided by Enterprise Library is a common way of logging exceptions in .NET applications.  It&#8217;s easy to setup and to use.  One problem I had a while ago was that it worked while on my development PC, but stopped working once it&#8217;s deployed.</p>
<p>What I was doing was to use it to write event entries in windows event log as part of the exception handling in an ASP.NET web application.  Nothing fancy.  It worked fine on my PC, but it didn&#8217;t write anything to the event log when Logger.Write is executed. No exception was thrown from that line of code either.  The program just went through as if that line of code was skipped.</p>
<p>It turned out to be a permission issue. When I debug the application in Visual Studio, it was running under my windows account credential which had permission to create Event Source in the system.  However, when the application was deployed to the server, it was running under the default account which was &#8220;NT Authority\Network Service&#8221; in my case.  By default, that account doesn&#8217;t have permission to create new Event Source in the system.  It does have permission to write event entries though.  So, when Logger.Write was executed, it couldn&#8217;t proceed because the Event Source wasn&#8217;t there, and the program didn&#8217;t have permission to create one.  Actually, it makes sense to not throw any exception on this line, because people like me usually use this to log exceptions, and if the logging process itself throws exceptions, there is probably nowhere else we can handle and/or log them.</p>
<p>Now, how this can be resolve?  The solution is quite simple.  As long as the Event Source is created ahead of time, it will be no problem.  What I did was to create required Event Source(s) on server through CMD.exe.  Here is a sample command:</p>
<p><span style="color: #0000ff"><code>eventcreate /ID 1 /L Application /T information /SO "My Event Source" /D "My Event Source is created."</code></span></p>
<p>This command will create an event entry in the Application log.  If the Event Source doesn&#8217;t exist, it will be created during the process.  This is only required when the application is deployed to the server first time.  So, I usually do it manually on server.  However, if that&#8217;s not the case, you can build it into the installation package, and when the application is installed, the Event Source is created as well.  Of course, you can use .NET to create Event Source in your installer too.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/enterprise-library-logger-write-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exception Handling in ASP.NET Web Application</title>
		<link>http://blog.pearltechnology.com/exception-handling-in-asp-net-web-application/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/exception-handling-in-asp-net-web-application/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 22:14:09 +0000</pubDate>
		<dc:creator>Geer</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Exception Handling]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=687</guid>
		<description><![CDATA[In web application development, we should always think about returning some kind of message to users when an exception is raised in the program.  Sometimes, it can be very specific, while in other cases it can be generic.  A common thought is to capture and possibly handle exceptions where they are raised, re-throw exceptions or [...]]]></description>
			<content:encoded><![CDATA[<p>In web application development, we should always think about returning some kind of message to users when an exception is raised in the program.  Sometimes, it can be very specific, while in other cases it can be generic.  A common thought is to capture and possibly handle exceptions where they are raised, re-throw exceptions or raise custom exceptions as needed so they can propagate up to higher level tiers in the application, handle/log exceptions at a central place in the highest tier of the application, and finally display an error message to the end-users or redirect them to a customized error page.</p>
<p>This pattern works, but sometimes it is tricky to generate a meaningful message.  The problem is that the exception can be thrown anywhere in your application, and the exception message may not always be appropriate or meaningful to end-users.  If you blindly display all exception messages you finally get, users may see something like &#8220;Object reference not set to an instance of an object&#8221; which doesn&#8217;t mean much to them.  So, in the final step of exception handling (where the program displays error messages or redirect users to an error page), you will see all kinds of exceptions which include .NET originated exceptions, exceptions raised by the program on purpose, and custom exceptions.  Some of them are appropriate to show to users, while others aren&#8217;t.  So, the question is how you can distinguish among them.</p>
<p>A lot of people suggest that if the original .NET exception message isn&#8217;t meaningful to users, and you can&#8217;t provide more specific message either, then a generic message such as &#8220;An error has occurred&#8230;  Please contact the technical support team for help&#8221; can be used.  I agree too.  You may do this where you know an exception can be thrown, and re-throw the exception with customized message (whether specific or generic) and with the original exception embedded as the inner exception of the new exception.  However, you don&#8217;t want to just put try/catch blocks in every piece of your code, and catch and re-throw every exception the program may possibly encounter.  It&#8217;s labor intensive and inefficient.  Also, there will always be something you can&#8217;t think of or look over, so there are still chances you can get unexpected exceptions in the end.</p>
<p>So, my solution is to let the program only catch and re-throw .NET originated exceptions when they are predictable and additional meaningful information can be provided, and let all other exceptions bubble up to the top tier.  Then in the final step of exception handling, identify the exceptions that are re-thrown, and retrieve the error message directly from these exceptions; use a generic error message for all other exceptions.  The question is how to identify these exceptions that are re-thrown.  For this purpose, I usually create a custom exception class which is inherited from System.Exception.  Use this class whenever I need to throw new exceptions or re-throw .NET originated exceptions.  So, in the final step, I check the type of the exception, and decide whether to use it as the error message or use a generic one instead.</p>
<p>Here is the custom exception class:</p>
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="background: #ddd;overflow: auto">
<ol style="background: #ffffff;margin: 0 0 0 2.5em;padding: 0 0 0 5px">
<li><span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">ExceptionBase</span> : <span style="color:#2b91af">Exception</span></li>
<li>{</li>
<li><span style="color:#0000ff">public</span> ExceptionBase(<span style="color:#0000ff">string</span> msg, <span style="color:#2b91af">Exception</span> innerEx)</li>
<li>: <span style="color:#0000ff">base</span>(msg, innerEx)</li>
<li>{</li>
<li>}</li>
<li><span style="color:#0000ff">public</span> ExceptionBase(<span style="color:#0000ff">string</span> msg)</li>
<li>: <span style="color:#0000ff">base</span>(msg)</li>
<li>{</li>
<li>}</li>
<li>}</li>
</ol>
</div>
</div>
<p>The ExceptionBase class has two constructors which give you the options to create an instance of exception with customized error message and with/without inner exception.</p>
<p>Here is how to use it in code:</p>
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="background: #ddd;overflow: auto">
<ol style="background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px">
<li><span style="color:#0000ff">throw</span> <span style="color:#0000ff">new</span> <span style="color:#2b91af">ExceptionBase</span>(<span style="color:#a31515">&#8220;Error has occurred in accessing database.&#8221;</span>);</li>
</ol>
</div>
</div>
<p>Or</p>
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="background: #ddd;overflow: auto">
<ol style="background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px">
<li><span style="color:#0000ff">try</span></li>
<li>{</li>
<li><span style="color:#008000">// Data access operations</span></li>
<li>}</li>
<li><span style="color:#0000ff">catch</span> (<span style="color:#2b91af">Exception</span> ex)</li>
<li>{</li>
<li><span style="color:#0000ff">throw</span> <span style="color:#0000ff">new</span> <span style="color:#2b91af">ExceptionBase</span>(<span style="color:#a31515">&#8220;Error has occurred in accessing database.&#8221;</span>, ex);</li>
<li>}</li>
</ol>
</div>
</div>
<p>The central location I handle all exceptions is in global.asax, and here is what it looks like:</p>
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="background: #ddd;overflow: auto">
<ol style="background: #ffffff;margin: 0 0 0 2.5em;padding: 0 0 0 5px">
<li><span style="color:#0000ff">protected</span> <span style="color:#0000ff">void</span> Application_Error(<span style="color:#0000ff">object</span> sender, <span style="color:#2b91af">EventArgs</span> e)</li>
<li>{</li>
<li><span style="color:#2b91af">Exception</span> ex = Server.GetLastError();</li>
<li><span style="color:#0000ff">string</span> msg = <span style="color:#a31515">&#8220;Unexpected error has occurred.&#8221;</span>;</li>
<li><span style="color:#0000ff">if</span> (ex != <span style="color:#0000ff">null</span>)</li>
<li>{</li>
<li><span style="color:#2b91af">LoggingUtility</span>.LogException(ex);</li>
<li><span style="color:#008000">// Remove the HttpUnhandledException wrapper if there is one</span></li>
<li><span style="color:#0000ff">if</span> (ex.GetType() == <span style="color:#0000ff">typeof</span>(<span style="color:#2b91af">HttpUnhandledException</span>) &amp;&amp; ex.InnerException != <span style="color:#0000ff">null</span>)</li>
<li>{</li>
<li>ex = ex.InnerException;</li>
<li>}</li>
<li><span style="color:#008000">// If this is a custom exception, change the message.</span></li>
<li><span style="color:#0000ff">if</span> (ex <span style="color:#0000ff">is</span> <span style="color:#2b91af">ExceptionBase</span>)</li>
<li>msg = ex.Message;</li>
<li>Server.ClearError();</li>
<li>}</li>
<li><span style="color:#008000">// Try to redirect user.</span></li>
<li>Response.Redirect(<span style="color:#0000ff">string</span>.Format(<span style="color:#a31515">&#8220;~/Error.htm?aspxerrorpath={0}&amp;error={1}&#8221;</span>, <span style="color:#2b91af">HttpUtility</span>.UrlEncodeUnicode(Request.Url.PathAndQuery), msg), <span style="color:#0000ff">true</span>);</li>
<li>}</li>
</ol>
</div>
</div>
<p>One note for this is that ASP.NET may put a wrapper exception (HttpUnhandledException) around the original exception.  In the code above, it is simply removed because it doesn&#8217;t contain any useful information.</p>
<p>You can also create more custom exception classes based on the ExceptionBase class to improve consistency in your application, and the code above will still work.  One example is:</p>
<div style="border: #000080 1px solid;color: #000;font-family: 'Courier New', Courier, Monospace;font-size: 10pt">
<div style="background: #ddd;overflow: auto">
<ol style="background: #ffffff;margin: 0 0 0 2em;padding: 0 0 0 5px">
<li><span style="color:#0000ff">public</span> <span style="color:#0000ff">class</span> <span style="color:#2b91af">BadUrlException</span> : <span style="color:#2b91af">ExceptionBase</span></li>
<li>{</li>
<li><span style="color:#0000ff">public</span> BadUrlException(<span style="color:#2b91af">Exception</span> innerEx)</li>
<li>: <span style="color:#0000ff">base</span>(<span style="color:#a31515">&#8220;Bad URL has been detected. Request could not be processed.&#8221;</span>, innerEx)</li>
<li>{</li>
<li>}</li>
<li>}</li>
</ol>
</div>
</div>
<p>This way the error messages for one type of exception are consistent across the application.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/exception-handling-in-asp-net-web-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Use Microsoft Device Emulator in VS2008</title>
		<link>http://blog.pearltechnology.com/how-to-use-microsoft-device-emulator-in-vs2008/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/how-to-use-microsoft-device-emulator-in-vs2008/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:37:18 +0000</pubDate>
		<dc:creator>Geer</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Device Emulator]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[visual studio 2008]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=658</guid>
		<description><![CDATA[Microsoft Device Emulator is a great tool for testing your mobile web applications without utilizing any real mobile device.  Because it can use the same network that your computer is on, you can use it to test your mobile web applications hosted on development computers or test servers before the applications are published to the internet.  [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft Device Emulator is a great tool for testing your mobile web applications without utilizing any real mobile device.  Because it can use the same network that your computer is on, you can use it to test your mobile web applications hosted on development computers or test servers before the applications are published to the internet.  It is part of the Visual Studio 2008, so you can set it up with very minimal work, if you already have VS2008 installed.  It can also be installed separately.  In the rest of this post, I will demonstrate how to set it up, to use your local network and access your mobile web applications.</p>
<p>Here are a few things you will need to have on your computer to continue.</p>
<ol>
<li>Windows Virtual PC 2007.  This is required, if you would like to connect the Device Emulator to your local network.  The software can be downloaded from <a title="Download Virutal PC 2007" href="http://www.microsoft.com/windows/virtual-pc/download.aspx" target="_blank">Microsoft website</a>.</li>
<li>Microsoft Visual Studio 2008.</li>
<li>Microsoft Device Emulator (which comes with VS2008).</li>
</ol>
<p>With all the above requirements available on your computer, you can follow the steps below to configure your Device Emulator.</p>
<ol>
<li>Start VS 2008 IDE.</li>
<li>On the menu, go to Tools &gt;&gt; Device Emulator Manager
<div id="attachment_659" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-659" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/IDE1-300x233.jpg" alt="Start Device Emulator Manager" width="300" height="233" /><p class="wp-caption-text">Start Device Emulator Manager</p></div></li>
<li>Right-click on a device you would like to use, and choose Connect option.
<p><div id="attachment_660" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-660" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Connect-to-a-mobile-device-300x222.jpg" alt="Connect to A Mobile Device" width="300" height="222" /><p class="wp-caption-text">Connect to A Mobile Device</p></div></li>
<li>After the device is connected, right-click on the connected device again, and choose Cradle.
<p><div id="attachment_661" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-661" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Cradle-Device-300x214.jpg" alt="Cradle the Connected Device" width="300" height="214" /><p class="wp-caption-text">Cradle the Connected Device</p></div></li>
<li>Go to the device window.  On the menu, choose File &gt;&gt; Configure
<p><div id="attachment_662" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-662" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Configure-Device-300x209.jpg" alt="Configure Device" width="300" height="209" /><p class="wp-caption-text">Configure Device</p></div></li>
<li>Go to the Network tab, and select the options as shown in the screen shot below.  And then click OK to close the window.
<p><div id="attachment_663" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-663" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Choose-Network-Card-300x223.jpg" alt="Choose Network Card" width="300" height="223" /><p class="wp-caption-text">Choose Network Card</p></div></li>
<li>In the device window, on the menu, choose File &gt;&gt; Reset &gt;&gt; Soft.  And wait until the device is restarted.</li>
<li>Now you need to configure the internet connection in the mobile device.  (The process could be different depending on what device you have picked.)  Normally, you would find the Settings option in the main menu, and then go to the Connections section to choose/define an internet connection.  Here below I use the device I chose as an example.</li>
<li>Choose Settings &gt;&gt; Connections &gt;&gt; Advanced &gt;&gt; Select Networks, and then choose My ISP for both Internet and Private Network connections.
<p><div id="attachment_668" class="wp-caption alignnone" style="width: 190px"><img class="size-medium wp-image-668" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Settings-180x300.jpg" alt="Choose Settings" width="180" height="300" /><p class="wp-caption-text">Choose Settings</p></div>
<div id="attachment_667" class="wp-caption alignnone" style="width: 189px"><img class="size-medium wp-image-667" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Connections-179x300.jpg" alt="Choose Connections" width="179" height="300" /><p class="wp-caption-text">Choose Connections</p></div>
<div id="attachment_665" class="wp-caption alignnone" style="width: 190px"><img class="size-medium wp-image-665" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Advanced-Settings-180x300.jpg" alt="Choose Advanced Settings" width="180" height="300" /><p class="wp-caption-text">Choose Advanced Settings</p></div>
<p><div id="attachment_666" class="wp-caption alignnone" style="width: 190px"><img class="size-medium wp-image-666" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Choose-My-ISP-180x300.jpg" alt="Choose My ISP" width="180" height="300" /><p class="wp-caption-text">Choose My ISP</p></div></li>
<li>After confirming all these changes, you can now visit your mobile web application or internet using this Device Emulator.  Task accomplished!
<p><div id="attachment_669" class="wp-caption alignnone" style="width: 190px"><img class="size-medium wp-image-669" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Mobile-Website-180x300.jpg" alt="Your Mobile Website" width="180" height="300" /><p class="wp-caption-text">Your Mobile Website</p></div></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/how-to-use-microsoft-device-emulator-in-vs2008/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Developing with Windows Mobile 7</title>
		<link>http://blog.pearltechnology.com/developing-with-windows-mobile-7/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/developing-with-windows-mobile-7/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 21:27:28 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Mobile Phone]]></category>
		<category><![CDATA[Windows Phone Application]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=618</guid>
		<description><![CDATA[Microsoft recently announced the general availability of developer tools for their Windows mobile platform. This article is a brief introduction to the platform and what the next generation of mobile development for Microsoft looks like.
After you&#8217;ve downloaded the developer tools installer, you will go through a download process&#8230;



After downloading the remaining components, you will install [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft recently announced the general availability of <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2338b5d1-79d8-46af-b828-380b0f854203&amp;displaylang=en">developer tools</a> for their <a href="http://www.microsoft.com/windowsmobile/en-us/default.mspx">Windows mobile platform</a>. This article is a brief introduction to the platform and what the next generation of mobile development for Microsoft looks like.</p>
<p>After you&#8217;ve downloaded the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=2338b5d1-79d8-46af-b828-380b0f854203&amp;displaylang=en">developer tools</a> installer, you will go through a download process&#8230;</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Dev-Tools-Setup.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-619" title="WinMo Dev Tools Setup" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Dev-Tools-Setup-300x267.png" alt="WinMo Dev Tools Setup" width="300" height="267" /></a><br />
</center></p>
<p>After downloading the remaining components, you will install all component resources.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Dev-Tools-Install.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-621" title="WinMo Dev Tools Install" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Dev-Tools-Install-300x271.png" alt="WinMo Dev Tools Install" width="300" height="271" /></a><br />
</center></p>
<p>Once the developer tools have been installed, you can startup <strong>Visual Studio 2010 Express for Windows Phone</strong> which is the IDE used for the mobile development.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Visual-Studio-2010-Express-Splash.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-622" title="Visual Studio 2010 Express Splash" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Visual-Studio-2010-Express-Splash-300x208.png" alt="Visual Studio 2010 Express Splash" width="300" height="208" /></a><br />
</center></p>
<p>We will use the <em>Silverlight for Windows Phone &#8211; Windows Phone Application</em> project template and add some custom XAML and image resource to the base project.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Project-Creation.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-623" title="WinMo Project Creation" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Project-Creation-300x205.png" alt="WinMo Project Creation" width="300" height="205" /></a><br />
</center></p>
<p>In this simple application we&#8217;ve titled <strong>Mobile Portal</strong> just going to add some textblocks, buttons, and use a standard Silverlight grid layout. We first modify <strong>MainPage.xaml</strong> to create our custom view for the mobile application. Here is a view of our coding changes.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-MainPage-XAML.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-630" title="WinMo MainPage XAML" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-MainPage-XAML-300x125.png" alt="WinMo MainPage XAML" width="300" height="125" /></a><br />
</center></p>
<p>Next, we go to our Solution Explorer add our image resource using the context menu on the project and selecting <em>Add -&gt; Existing Item</em>.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Solution-Explorer-Add-Resources.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-631" title="Solution Explorer - Add Resources" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/Solution-Explorer-Add-Resources-223x300.png" alt="Solution Explorer - Add Resources" width="223" height="300" /></a><br />
</center></p>
<p>Finally, we add our custom styles to <strong>App.xaml</strong>. After building the solution and running the emulator, we see the following results.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Pearl-Technology-Issue-Tracker.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-633" title="WinMo Pearl Technology - Issue Tracker" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Pearl-Technology-Issue-Tracker-151x300.png" alt="WinMo Pearl Technology - Issue Tracker" width="151" height="300" /></a><br />
</center></p>
<p>If we rotate the device orientation, we can see how the view shifts to fit the space available.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Pearl-Technology-Issue-Tracker-Horizontal.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-634" title="WinMo Pearl Technology - Issue Tracker - Horizontal" src="http://blog.pearltechnology.com/wp-content/uploads/2010/03/WinMo-Pearl-Technology-Issue-Tracker-Horizontal-300x177.png" alt="WinMo Pearl Technology - Issue Tracker - Horizontal" width="300" height="177" /></a><br />
</center></p>
<p>We are glad to see that Microsoft is embracing the <a href="http://windowsclient.net/wpf/">WPF</a> and <a href="http://www.silverlight.net/">Silverlight</a>-based development engine for the mobile platform. This decision allows developers and designers skilled in <a href="http://msdn.microsoft.com/en-us/library/ms752059.aspx">XAML</a> to leverage their existing knowledge and prowess to create useful mobile applications for both business and pleasure. The small footprint of Silverlight makes it ideal for usage with embedded or mobile systems with limited power and memory.</p>
<p>You can download our complete solution <a href="/wp-content/uploads/2010/03/PearlTechnology.IssueTracker.zip#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/developing-with-windows-mobile-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding PDF icon to SharePoint Document Libraries</title>
		<link>http://blog.pearltechnology.com/adding-pdf-icon-to-sharepoint-document-libraries/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/adding-pdf-icon-to-sharepoint-document-libraries/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:10:16 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Document Libraries]]></category>
		<category><![CDATA[MOSS 2007]]></category>
		<category><![CDATA[PDF]]></category>
		<category><![CDATA[PDF Icon]]></category>
		<category><![CDATA[Sharepoint]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=574</guid>
		<description><![CDATA[One of the missing features in MOSS 2007 is the ability to recognize PDF files in a document library. It can be frustrating when all you see is a blank page icon instead of SharePoint recognizing the document type properly. This is a common portal issue that is easily remedied with a bit of extra [...]]]></description>
			<content:encoded><![CDATA[<p>One of the missing features in MOSS 2007 is the ability to recognize PDF files in a document library. It can be frustrating when all you see is a blank page icon instead of SharePoint recognizing the document type properly. This is a common portal issue that is easily remedied with a bit of <a href="http://support.microsoft.com/kb/837849">extra configuration</a>. Here is an example of how PDF items are normally displayed inside of a library view.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Missing-Icon-Example.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-577" title="Missing Icon Example" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Missing-Icon-Example-300x80.png" alt="Missing Icon Example" width="300" height="80" /></a><br />
</center></p>
<p>Following the <a href="http://support.microsoft.com/kb/837849">Microsoft KB</a> you can see that you need to edit the <em>docicon.xml</em> file located at the path <em>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\XML</em></p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Docicon-XML.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-582" title="Docicon XML" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Docicon-XML-300x147.png" alt="Docicon XML" width="300" height="147" /></a><br />
</center></p>
<p>The Docicon.xml configuration file is a listing of all document types that are supported by SharePoint. To support the PDF icon, you need to add the following Mapping XML element to the XPath <em>//DocIcons/ByExtension</em>. The Mappings are listed in alphabetical order, so you should insert the PDF mapping accordingly.</p>
<pre name="code" language="XML">&lt;Mapping Key="pdf" Value="pdficon.gif"/&gt;</pre>
<p>Here is the Docicon.xml file after the edit.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Docicon-XML-View.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-583" title="Docicon XML View" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Docicon-XML-View-300x72.png" alt="Docicon XML View" width="300" height="72" /></a><br />
</center></p>
<p><a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/pdficon.gif#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignleft size-full wp-image-590" style="padding-right: 10px" title="pdficon" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/pdficon.gif" alt="pdficon" width="17" height="17" /></a>The next step is retrieving the <a href="http://www.adobe.com/misc/linking.html#pdficon">small PDF icon</a> from Adobe. When you have download the icon image, you need to save the image as &#8220;pdficon.gif&#8221; to match the mappings entry we created earlier. The last step is to copy the PDF icon image to the SharePoint template images path: <em>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\IMAGES\pdficon.gif</em>. This is the location where SharePoint will search for document type icons for rendering in document library views &#8211; according to the configured file extension mappings in docicon.xml.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/pdficon-View.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-593" title="pdficon View" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/pdficon-View-300x146.png" alt="pdficon View" width="300" height="146" /></a><br />
</center></p>
<p>After these steps have been completed, you can now visually distinguish the document type for PDF extensions with a quick icon type indicator.</p>
<p><center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/PDF-Icon-Appears.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-596" title="PDF Icon Appears" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/PDF-Icon-Appears-300x70.png" alt="PDF Icon Appears" width="300" height="70" /></a><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/adding-pdf-icon-to-sharepoint-document-libraries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy Access to Code Snippets with CodeKeep</title>
		<link>http://blog.pearltechnology.com/easy-access-to-code-snippets-with-codekeep/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/easy-access-to-code-snippets-with-codekeep/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 19:37:34 +0000</pubDate>
		<dc:creator>ThadK</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=554</guid>
		<description><![CDATA[Code Keep is an easy way to manage and browse code snippets.]]></description>
			<content:encoded><![CDATA[<p>Remembering exact syntax seems to be a common issue for programmers.  We tend to rely on Google or previous projects for a quick example to get us on the right path.  Whether it’s a one line regular expression or an entire method, programmers are frequently looking at code samples.</p>
<p>Visual Studio has built in support for snippets, but some of the functionality is limited.  For a while, I have kept simple methods and queries stored in files on my computer for quick access.  I have found a simple solution for Visual Studio, as well as online for quickly accessing, storing and sharing routinely used snippets of code that will replace my old ways of storing snippets.</p>
<p>&lt;code:keep&gt; (<a href="http://www.codekeep.net/" target="_blank">www.CodeKeep.net</a>) allows users to store and easily retrieve code snippets in many common programming languages.  At the time of this posting, there are currently 28 languages that you can store, share, and search.  There are two easy ways of adding and viewing your snippets.  First, is on their website.  The website allows you to not only view and manager your snippets, but it also lets you look through snippets other have chosen to share &#8211; when adding snippets, you have the ability to make your snippets private or public.  The other way to access snippets is through a Visual Studio add-in (available in for both Visual Studio 2005 and 2008).  Both options will let you store, browse, and search for code snippets.</p>
<p><strong>Installation instructions</strong></p>
<p>When installing, I recommend setting up an online account first.  This will make the installation flow a little more smoothly.  <em>Make sure to have Visual Studio closed for the installation.</em> Once you have an account setup, download and run the MSI to install CodeKeep.  Make sure the read the ReadMe file.  After installing the application, you will also need to copy three files into the Addins directory in you default project folder.</p>
<p>Once installed, the add-in is available through the Tools Menu<br />
<img src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/codekeep_tools.jpg" alt="Code Keep Tools Menu" /><br />
Because this is an online service, the snippets are not stored on your computer by default.   However, the website does allow users to export their snippets.  Whether you want to take them on the go, or simply back them up, browse to “My Snippets” and click Export Snippets.  All of your snippets can be saved to an XML file.<br />
<img src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/codekeep_export.jpg" alt="Code Keep Export" /><br />
<em><br />
Note:  While using the add-in, I have hit a few bugs that will crash Visual Studio.   Upon restarting VS, I get an error “Object reference not set to an instance of an object”.  To get rid of this, I had run the MSI again and  repair the installation. </em><br />
<img src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/codekeep_error.jpg" alt="Code Keep Error" /><br />
<em>This also required me to log into my account again.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/easy-access-to-code-snippets-with-codekeep/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Deploying to Windows Azure</title>
		<link>http://blog.pearltechnology.com/deploying-to-windows-azure/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/deploying-to-windows-azure/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 20:32:25 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Azure Services]]></category>
		<category><![CDATA[Azure Tools]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Web Role]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=504</guid>
		<description><![CDATA[Microsoft is expected to remove the CTP from their Azure Platform this month at PDC in Los Angeles. Until then, you can still receive access to their free cloud services platform. To get started with Azure you need a Windows Live ID and signup with Microsoft Connect to receive an access code (aka tokens).



When you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Windows-Azure.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignleft size-medium wp-image-508" title="Windows Azure" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Windows-Azure-300x54.png" alt="Windows Azure" width="300" height="54" /></a>Microsoft is expected to remove the CTP from their <a href="http://www.microsoft.com/windowsazure/">Azure Platform</a> this month at <a href="http://microsoftpdc.com/">PDC</a> in Los Angeles. Until then, you can still receive access to their free cloud services platform. To get started with Azure you need a Windows Live ID and <a href="http://www.microsoft.com/windowsazure/account/">signup</a> with <a href="http://connect.microsoft.com/">Microsoft Connect</a> to receive an access code (<em>aka tokens</em>).<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Microsoft-Connect.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-511" title="Microsoft Connect" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Microsoft-Connect-300x135.png" alt="Microsoft Connect" width="300" height="135" /></a><br />
</center></p>
<p>When you receive your access token, you can begin creating projects on the Azure platform with the <a href="https://windows.azure.com">Azure Developer Portal</a>. You can only create one project with the CTP, but you can have multiple services inside each project (<em>web/worker roles</em>).<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Projects.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-515" title="Azure Projects" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Projects-300x86.png" alt="Azure Projects" width="300" height="86" /></a><br />
</center></p>
<p>After you&#8217;ve created your project in the developer portal, you can add services which will be the endpoints you deploy to for Windows Azure. We will add a Windows Azure Service in this example.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Windows-Azure-Add-Service.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-517" title="Windows Azure Add Service" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Windows-Azure-Add-Service-300x137.png" alt="Windows Azure Add Service" width="300" height="137" /></a><br />
</center></p>
<p>To create our Windows Azure application, we need to create a package (cspkg) that contains our application contents and a configuration definition (cscfg) that defines our roles. Microsoft has created Azure tools to assist in generating the package and configuration file. You can download the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=8d75d4f7-77a4-4adf-bce8-1b10608574bb&amp;displaylang=en">Azure SDK</a> to create Azure applications using Visual Studio. The <a href="http://www.microsoft.com/downloads/details.aspx?familyid=AA40F3E2-AFC5-484D-B4E9-6A5227E73590&amp;displaylang=en">Azure SDK</a> allows you to run your own local development fabric before pushing your application into the cloud. <a href="http://eclipse.org/">Eclipse</a> also has its own <a href="http://www.windowsazure4e.org/">Azure Tools</a> if you prefer to develop in the Eclipse environment.</p>
<p>After installation of the Azure Tools, you now have a new project template &#8220;Cloud Service&#8221; which we&#8217;ll use to create our web role.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Visual-Studio-Cloud-Service-Template.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-519" title="Visual Studio Cloud Service Template" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Visual-Studio-Cloud-Service-Template-300x200.png" alt="Visual Studio Cloud Service Template" width="300" height="200" /></a><br />
</center><br />
After providing a name for your Cloud Service project, you are prompted to select which roles you would like to use. We will choose &#8220;ASP.NET Web Role&#8221; for this example.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Roles.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-522" title="Azure Roles" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Roles-300x188.png" alt="Azure Roles" width="300" height="188" /></a><br />
</center></p>
<p>After clicking &#8220;Ok&#8221;, you will now have a Cloud Service project and a Web Role project in your solution. We will now remove the Web Role for this exercise, and replace it with an existing ASP.NET application called <a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx">ASP.NET Chart Controls</a> which Scott Guthrie announced last year. This application did not work on the PDC release of Azure, but Azure now allows web applications to run in Full Trust with some <a href="http://blogs.msdn.com/windowsazure/archive/2009/03/18/hosting-roles-under-net-full-trust.aspx">minor tweaking</a>.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/ASP.NET-Chart-Controls-Solution.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-524" title="ASP.NET Chart Controls Solution" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/ASP.NET-Chart-Controls-Solution-189x300.png" alt="ASP.NET Chart Controls Solution" width="95" height="150" /></a><br />
</center></p>
<p>We now have our solution complete and have one web role we would like to deploy to the cloud. We must now publish the solution to Azure. We right-click on the Cloud Service project and click &#8220;Publish&#8221; which opens up the <a href="http://windows.azure.com">Azure Developer Portal</a>.</p>
<p>After logging in with Windows Live, you want to deploy your application to the Staging Environment before pushing it live. To deploy, you simply select the application package (cspkg) and configuration definition (cscfg) from your &#8220;/publish&#8221; folder in the cloud service &#8220;/bin/Debug&#8221; directory.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Package-and-Configuration-Selection.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-530" title="Azure Package and Configuration Selection" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Package-and-Configuration-Selection-300x113.png" alt="Azure Package and Configuration Selection" width="300" height="113" /></a><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Package-and-Configuration.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-527" title="Azure Package and Configuration" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Package-and-Configuration-300x26.png" alt="Azure Package and Configuration" width="300" height="26" /></a><br />
</center></p>
<p>Clicking on &#8220;Deploy&#8221; will load the Azure package and service definition to the cloud and create a VM necessary to run the application. The environment takes some time to setup and will show its state as &#8220;Initialization&#8221; until the VM is entirely ready. You are given a URI based upon a randomly generated GUID to view your application and test it before moving it into production. Having two environments is nice if you also have database changes that need to coincide with your deployment.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Staging-Environment.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-537" title="Azure Staging Environment" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/Azure-Staging-Environment-300x226.png" alt="Azure Staging Environment" width="300" height="226" /></a><br />
</center></p>
<p>Once the application has been verified, you can click the center arrows icon to swap the Staging site into Production. You can see the two environments have now been switched.<br />
<center><br />
<a href="http://blog.pearltechnology.com/wp-content/uploads/2009/11/ASP.NET-Chart-Controls-Azure.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="aligncenter size-medium wp-image-538" title="ASP.NET Chart Controls Azure" src="http://blog.pearltechnology.com/wp-content/uploads/2009/11/ASP.NET-Chart-Controls-Azure-300x212.png" alt="ASP.NET Chart Controls Azure" width="300" height="212" /></a><br />
</center></p>
<p>Azure does make the deployment process a bit more involved, but there is an <a href="http://blogs.msdn.com/windowsazure/archive/2009/09/17/introducing-the-windows-azure-service-management-api.aspx">managed Azure Deployment API</a> in the works to automate the build and deploy steps you may need in your organization. You can <a href="http://aspchartcontrols.cloudapp.net/">view</a> our sample ASP.NET Chart Controls application running on Azure Services (<em>cloudapp.net</em>). Kudos to Microsoft for allowing full trust applications! We will be watching for more exciting features from the <a href="http://blogs.msdn.com/windowsazure/">Azure Team</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/deploying-to-windows-azure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Exchange Web Services (EWS) Managed API</title>
		<link>http://blog.pearltechnology.com/exchange-web-services-ews-managed-api/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/exchange-web-services-ews-managed-api/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 13:21:26 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[EWS]]></category>
		<category><![CDATA[Exchange 2007]]></category>
		<category><![CDATA[Exchange Server]]></category>
		<category><![CDATA[Exchange Web Services]]></category>
		<category><![CDATA[Managed API]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=294</guid>
		<description><![CDATA[Unless you are a seasoned COM junky, the Exchange Web Services (EWS) Managed API will come as a welcome addition to anyone needing to programmatically manage Microsoft Exchange appointments, calendars, messages, or any other folders residing on an exchange server. The key difference with EWS is that it is using purely managed code. EWS itself [...]]]></description>
			<content:encoded><![CDATA[<p>Unless you are a seasoned <a href="http://www.microsoft.com/com/default.mspx">COM junky</a>, the Exchange Web Services (EWS) Managed API will come as a welcome addition to anyone needing to programmatically manage <a href="http://www.microsoft.com/exchange/2007/default.mspx">Microsoft Exchange</a> appointments, calendars, messages, or any other folders residing on an exchange server. The key difference with EWS is that it is using <a href="http://msdn.microsoft.com/en-us/library/dd637749.aspx">purely managed code</a>. EWS itself is simply a wrapper around the EWS protocol, so there&#8217;s no need to learn another XML-based interface.</p>
<p>You can <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e8f38dd1-f123-4a16-b4c8-584d1f84af48&amp;displaylang=en">download EWS</a> from Microsoft (<em>currently an RC</em>) and begin interacting immediately with any server running Exchange 2010 or Exchange 2007 running SP1 or higher. The web service interaction requires SSL and a valid <a href="http://msdn.microsoft.com/en-us/library/system.net.networkcredential.aspx">Network Credential</a> for access. The base service is hosted on exchange via the EWS URL below, where &lt;exchange_server_name&gt; is the host name of your Exchange server.</p>
<pre name="code" language="xml">https://&lt;exchange_server_name&gt;/ews/exchange.asmx</pre>
<p>To try out EWS in a test environment, you can <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=E99F2A96-FFBC-4323-9676-9657607C4A52&amp;displaylang=en">download</a> the Exchange 2007 virtual machine. Once the Exchange VM (VHD) is running and you are logged in, you need to configure the network settings to utilize automatic IP and DNS settings instead of the default static ones provided. This will assist in routing network traffic to the new machine. To verify the setup, you can browse the following URL below and see the WSDL for the EWS. You will need to ignore the certificate warning and enter a login with access to the service (<em>login as litwareinc\Administrator</em>)</p>
<pre name="code" language="xml">https://ex07sp1/ews/exchange.asmx</pre>
<p>The next step is <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e8f38dd1-f123-4a16-b4c8-584d1f84af48&amp;displaylang=en">installing EWS</a>. After installation, you can begin creating Visual Studio projects using the new API. <a href="http://msdn.microsoft.com/en-us/library/dd633710.aspx">MSDN</a> provides a nice introduction and valuable references for working with the managed API. After creating a new Visual Studio project, you need to add a reference to the new assembly <em>Microsoft.Exchange.Webservices.dll</em> (located at the path <em>Program Files\Microsoft\Exchange\Web Services\1.0\ </em>). Next, we add using statements for the new library reference and also for <a href="http://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate.aspx">X509 certificates</a>.</p>
<pre name="code" language="csharp">using Microsoft.Exchange.WebServices.Data;
using System.Security.Cryptography.X509Certificates;</pre>
<p>Now here&#8217;s some simple code to create a connection to the EWS endpoint. The certificate callback is necessary since we&#8217;re using a user-generated X509 certificate.</p>
<pre name="code" language="csharp">// Hook up the cert callback.
            ServicePointManager.ServerCertificateValidationCallback =
                delegate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
                {
                    // Validate the certificate and return true or false as appropriate.
                    // Note that it not a good practice to always return true because not
                    // all certificates should be trusted.
                    return true;
                };

            // assign exchange version
            ExchangeVersion version = ExchangeVersion.Exchange2007_SP1;

            // create service endpoint connection
            ExchangeService service = new ExchangeService(version);

            // Assign NetworkCredential directly
            service.Credentials = new NetworkCredential("username", "password", "domain");

            // EWS network location
            service.Url = new Uri("https://ex07sp1/ews/exchange.asmx");</pre>
<p>Now we&#8217;ll create an <a href="http://msdn.microsoft.com/en-us/library/dd633661.aspx">appointment</a> using this service endpoint. <em>Note: When you <a href="http://msdn.microsoft.com/en-us/library/dd633620.aspx">add attendees</a>, you actual create a meeting instead of an appointment.</em></p>
<pre name="code" language="csharp">            Appointment appt = new Appointment(service);
            appt.Subject = "Read EWS Documentation";
            appt.Body = "You can download the Exchange 2007 SP2 here: &lt;a href='http://www.microsoft.com/downloads/thankyou.aspx?familyId=ee7829a3-0ae8-44de-822c-908cd1034523&amp;displayLang=en'&gt;SP2 Download&lt;/a&gt;";
            appt.StartTimeZone = TimeZoneInfo.Local;
            appt.Start = DateTime.Now.AddDays(1);
            appt.ReminderMinutesBeforeStart = 15;
            appt.End = appt.Start.AddHours(2);
            appt.RequiredAttendees.Add("Administrator@litwareinc.com");
            appt.Save(); // persisted to exchange</pre>
<p>To probe deeper, you can follow the <a href="http://blogs.msdn.com/exchangedev/">exchange developer blog</a> on MSDN. We look forward to the RTM of this powerful managed Exchange API.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/exchange-web-services-ews-managed-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BizTalk Pipeline Out Of Memory</title>
		<link>http://blog.pearltechnology.com/biztalk-pipeline-out-of-memory/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/biztalk-pipeline-out-of-memory/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 17:52:57 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[Pipeline Components]]></category>
		<category><![CDATA[VirtualStream]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=256</guid>
		<description><![CDATA[I&#8217;ve developed many custom components for BizTalk in the past several years, but I have never had to work with very large input files (&#62;100MB), primarily I&#8217;ve simply created output files. In a recent need to gather several years worth of historical data, it became apparent that memory constraints were going to be pushed to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve developed many custom components for BizTalk in the past several years, but I have never had to work with very large input files (&gt;100MB), primarily I&#8217;ve simply created output files. In a recent need to gather several years worth of historical data, it became apparent that memory constraints were going to be pushed to their peak. After battling the frequent &#8220;System.OutOfMemoryException&#8221; it was time to hunt for the solution.</p>
<p>The <a href="http://social.msdn.microsoft.com/Forums/en-US/biztalkgeneral/thread/8248a5be-3c8c-471f-b2e0-d1872689fee4">resolution</a> to the BizTalk memory problem relied in the source structure (<a href="http://msdn.microsoft.com/en-us/library/system.io.memorystream.aspx">MemoryStream</a>) we were using for storing our stream for the <a href="http://msdn.microsoft.com/en-us/library/microsoft.biztalk.message.interop.ibasemessage_members(BTS.10).aspx">IBaseMessage</a>.</p>
<pre name="code" language="csharp">MemoryStream revisedStream = new MemoryStream();</pre>
<p>The discussion helpfully points out that we should be using the <a href="http://technet.microsoft.com/en-us/library/microsoft.biztalk.streaming.virtualstream(BTS.10).aspx">VirtualStream</a> with a few <a href="http://blogs.neudesic.com/blogs/enterprise_integration/archive/2006/12/27/1366.aspx">caveats</a>. The trick to get the VirtualStream object is to include the source from the BizTalk server samples (<em>&lt;BizTalk Install Path&gt;\SDK\Samples\Pipelines\SchemaResolverComponent\SchemaResolverFlatFileDasm</em>) or use the <em>Microsoft.BizTalk.Streaming.dll</em> as it exists in the GAC (<em>&lt;Windows Path&gt;\assembly\GAC_MSIL\Microsoft.BizTalk.Streaming\3.0.1.0__31bf3856ad364e35\</em>). I chose the later approach, which required adding a reference to<em> Microsoft.BizTalk.Streaming.dll</em> to my custom pipeline solution. I first copied the assembly from the <a href="http://bloggingabout.net/blogs/wellink/archive/2006/07/12/12947.aspx">GAC</a> to the &lt;biztalk install path&gt; for future solutions where I may need to reuse the same assembly source. After adding the reference via Visual Studio, it was simply a matter of changing the MemoryStream reference to VirtualStream.</p>
<pre name="code" language="csharp">VirtualStream revisedStream = new VirtualStream();</pre>
<p>Be sure you rewind the stream before assigning the bodyparts data.</p>
<pre name="code" language="csharp">// Rewind the stream so it is ready for use by the messaging engine
revisedStream.Seek(0, SeekOrigin.Begin);</pre>
<p>So why does this solution work? Behind the scenes, VirtualStream is wrapping excessive data (<em>user defined, but defaults to &gt;4MB</em>) to temporary disk using a <a href="http://msdn.microsoft.com/en-us/library/system.io.bufferedstream.aspx">BufferedStream</a>. This is why we can avoid the &#8220;System.OutOfMemoryException&#8221; &#8211; since the VirtualStream will offload the large data stream to disk I/O instead of purely storing our IBaseMessage in RAM (<em>via MemoryStream</em>). Yes, there&#8217;s certainly overhead depending on where your temporary directory resides, but in most cases this will be the solution you&#8217;re looking for. MSDN docs has other <a href="http://msdn.microsoft.com/en-us/library/ee377071(BTS.10).aspx">BizTalk specific streams</a> if you want to dive deeper.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/biztalk-pipeline-out-of-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft creates CodePlex Foundation</title>
		<link>http://blog.pearltechnology.com/microsoft-creates-codeplex-foundation/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://blog.pearltechnology.com/microsoft-creates-codeplex-foundation/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 20:25:28 +0000</pubDate>
		<dc:creator>AaronH</dc:creator>
				<category><![CDATA[Application Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Codeplex]]></category>
		<category><![CDATA[OSS]]></category>

		<guid isPermaLink="false">http://blog.pearltechnology.com/?p=227</guid>
		<description><![CDATA[Today Microsoft announced that its funding $1 million to create a 501(c)(6) corporation called the CodePlex Foundation. Microsoft created Codeplex.com in 2006 to allow developers the opportunity to share open source projects completely free to the community. One of the first open source projects shared on CodePlex was the AJAX Control Toolkit, a very well-known [...]]]></description>
			<content:encoded><![CDATA[<p>Today Microsoft announced that its funding $1 million to create a 501(c)(6) corporation called the <a href="http://codeplex.org">CodePlex Foundation</a>. Microsoft created <a href="http://www.codeplex.com">Codeplex.com</a> in 2006 to allow developers the opportunity to share open source projects completely free to the community. One of the first open source projects shared on CodePlex was the <a href="http://ajaxcontroltoolkit.codeplex.com">AJAX Control Toolkit</a>, a very well-known component in many ASP.NET developers toolbox. Since its inception, CodePlex has expanded to over <a href="http://port25.technet.com/archive/2009/07/07/codeplex-10-000-hosted-projects-and-counting.aspx">10,000 projects</a>. It&#8217;s important to note that the CodePlex Foundation will operate <a href="http://port25.technet.com/archive/2009/09/10/the-codeplex-foundation-debuts.aspx">entirely independent</a> from Microsoft corporation.</p>
<p>The new foundations Board of Directors has some influential players in the OSS realm. One of the directors is <em>Miguel de Icaza</em>, creator of GNOME and currently the project leader in both <a href="http://www.mono-project.com">Mono</a> and <a href="http://www.mono-project.com/Moonlight">Moonlight</a>. Miguel has his own enlightening <a href="http://tirania.org/blog/archive/2009/Sep-10.html">comments</a> on the new foundation. Another member of the board is <em>Shaun Walker</em>, the original creator of the <a href="http://www.dotnetnuke.com">DotNetNuke</a> project, an incredibly popular OSS web platform.</p>
<p>The goal of the foundation is to bring commercial and OSS communities closer together (<em>e.g. get commercial developers working in OSS projects</em>). The Advisory Panel has some interesting members including <a href="http://haacked.com/">Phil Haack</a>, <a href="http://www.hanselman.com/blog/">Scott Hanselman</a>, and <a href="http://lmaugustin.typepad.com/">Larry Augustin</a>. Larry is now CEO of SugarCRM, a popular non-microsoft based OSS web platform. Hanselman also shares some <a href="http://www.hanselman.com/blog/MicrosoftCreatesTheCodePlexFoundation.aspx">insights</a> into the new foundation.</p>
<p>It&#8217;s great to see Microsoft attempting to bridge the gap that exists between developers of OSS and commercial software, but only time will tell if this investment pays off. Software will continue to get better, especially with the OSS community involvement that Microsoft is slowly embracing.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.pearltechnology.com/microsoft-creates-codeplex-foundation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
