<?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>Rock Solid &#187; .NET</title>
	<atom:link href="http://rocksolid.gibraltarsoftware.com/category/development/dotnet/feed" rel="self" type="application/rss+xml" />
	<link>http://rocksolid.gibraltarsoftware.com</link>
	<description>Notes from the folks behind Gibraltar Software</description>
	<lastBuildDate>Thu, 19 Jan 2012 23:24:39 +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>Getting to Know Gibraltar &#8211; Adding Exceptions</title>
		<link>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-adding-exceptions</link>
		<comments>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-adding-exceptions#comments</comments>
		<pubDate>Wed, 07 Dec 2011 21:55:59 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Gibraltar]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Product Information]]></category>
		<category><![CDATA[Exceptions]]></category>

		<guid isPermaLink="false">http://rocksolid.gibraltarsoftware.com/?p=1101</guid>
		<description><![CDATA[Continuing with our Getting to Know Gibraltar series - see how you can record and handle exceptions in an easy, step-by-step way.]]></description>
			<content:encoded><![CDATA[<p><a href="http://rocksolid.gibraltarsoftware.com/?p=1051">In my last post</a> we set up a minimalist application, attached Gibraltar to it, and reported some trace information. In this post we’re going to build on that and add exceptions. First we are going to add an unhandled exception, so we change our code so that it looks like this:</p>
<pre class="brush: csharp; title: ; notranslate">
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

namespace GibraltarGettingStartedApp
{

	class Program
	{
		static int Main(string[] args)
			{
				Trace.WriteLine(&quot;About to Blow up...&quot;);
				int zero = 0;
				Trace.Close();
				return 1 / zero;
			}
		}
	}
}
</pre>
<p>That should get the runtime’s panties in a bunch, let’s try it. <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/wlEmoticon-smile1.png" alt="Smile" /></p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML22a2b5ec.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML22a2b5ec" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML22a2b5ec_thumb.png" alt="SNAGHTML22a2b5ec" width="577" height="157" border="0" /></a></p>
<p>Yep, that did it! Now, let’s see what Gibraltar logged…</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb3.png" alt="image" width="435" height="52" border="0" /></a></p>
<p>Gibraltar knows we crashed and if we open up the record…</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image8.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb4.png" alt="image" width="566" height="106" border="0" /></a></p>
<p>We know what the problem was, we can click the link and go right to the line in the source code and Gibraltar tells us what the user experience is going to be, “This fatal error will not be reported to the user, then the application will exit”. All and all, pretty cool.</p>
<p>As an aside, let me close down VS, I want to test if I click the link, will it open the file and go to the line? It does! That’s cool, though I notice that it only opens the actual file and not the solution or project that the file is in. Hmm, I’ll need to investigate that more as it’d be better if the entire solution was opened, don’t you think?</p>
<p>Let’s try running the same unhandled exception in a winforms application and see what happens. We’ll need to run the exe from the commandline, as the VS debugger will “get in the way” and try to do “clever stuff”, but when we do, we see the following dialog:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML298b97c" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML298b97c.png" alt="SNAGHTML298b97c" width="472" height="301" border="0" /></p>
<p>Here Gibraltar is giving us even more help. It’s popped up a dialog which will actually help us recover from the crash and carry on using our application. If we select “Restart Application” Gibraltar will restart the application for us and enable us to carry on using our application. Of course, this facility should only be used in a testing environment. In the real world, I don’t think it would be wise to restart and to continue using an application which had just suffered from a crash, as there is no way to know what state the underlying model is in. However, from a testing perspective, it’s an excellent tool.</p>
<p>Of course, the same information is recorded in Gibraltar:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image9.png" alt="image" width="475" height="48" border="0" /></p>
<p>Notice that the “Status” has been recorded as “Normal”. If we open the record we can see why:</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image10.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb5.png" alt="image" width="442" height="146" border="0" /></a></p>
<p>It’s because we chose to continue the execution and shut down the application normally after.</p>
<p>Okay, let’s change our console application code to handle the exception…</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

namespace GibraltarGettingStartedApp
{
	class Program
	{
		static int Main(string[] args)
		{
			Trace.WriteLine(&quot;About to Blow up...&quot;);
			int zero = 0;
			Trace.Close();
			try { return 1 / zero; }
			catch (DivideByZeroException e) { }
			return 0;
		}
	}
}
</pre>
<p>And let’s see what difference that made to Gibraltar…</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image11.png" alt="image" width="507" height="70" border="0" /></p>
<p>Hmm, as far as Gibraltar is concerned everything is normal, there is no sign of the handled exception. For a clue as to why that is, let’s examine logging best practices, you can read them at…</p>
<p><a title="http://www.gibraltarsoftware.com/Support/Documentation/Logging_BestPractices.html" href="http://www.gibraltarsoftware.com/Support/Documentation/Logging_BestPractices.html">http://www.gibraltarsoftware.com/Support/Documentation/Logging_BestPractices.html</a></p>
<p>And they quite clearly state:</p>
<blockquote><p>“We strongly recommend that in all cases where an exception is consumed within a catch block that you log the exception with an Informational severity rather than silently swallowing the error.”</p></blockquote>
<p>Okay, so this states that if we handle an exception, and we want that fact recorded by Gibraltar, then we have to log it. That makes sense really. So, let’s change our code to the following:</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

namespace GibraltarGettingStartedApp
{
	class Program
	{
		static int Main(string[] args)
		{
			Trace.WriteLine(&quot;About to Blow up...&quot;);
			int zero = 0;
			try { return 1 / zero; }
			catch (DivideByZeroException e)
			{
				Trace.WriteLine(&quot;Error: &quot; + e.Message);
			}
			Trace.Close();
			return 0;
		}
	}
}
</pre>
<p>Now let’s see how that’s affected Gibraltar:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image12.png" alt="image" width="499" height="90" border="0" /></p>
<p>This time you can plainly see that the error has been recorded, which is good, but notice too that there’s no exception tab:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image13.png" alt="image" width="236" height="113" border="0" /></p>
<p>Of course, we should be able to do better and we can. If we use the TraceInformation method, and pass a formatted string, along with the exception, then Gibraltar will give us a much richer experience.</p>
<p>So, let’s change our code to use that method:</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;

namespace GibraltarGettingStartedApp
{
	class Program
	{
		static int Main(string[] args)
		{
			Trace.WriteLine(&quot;About to Blow up...&quot;);
			int zero = 0;
			try { return 1 / zero; }
			catch (DivideByZeroException e)
			{
				Trace.TraceInformation(&quot;Error: {0}&quot;,e.Message,e);
			}
			Trace.Close();
			return 0;
		}
	}
}
</pre>
<p>And let’s look at the information provided in Gibraltar:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image14.png" alt="image" width="332" height="112" border="0" /></p>
<p>This time, as you can see, we get the “Exceptions” tab. This is because Gibraltar scans the insertion variables and, if it finds one that is an exception, then it uses that as the exception for the log message (regardless of its severity). Pretty cool eh?</p>
<p>In this post we added an unhandled exception to your console application to see what effect that had on Gibraltar. We then added an unhandled exception to a winforms application so we could see the enhanced features available to us there and then we finished up by handling that exception and seeing why best practice is to log handled exceptions.</p>
<p>I hope you’ll join me next time as we continue our exploration of Gibraltar, until then, happy coding! <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/wlEmoticon-smile1.png" alt="Smile" /></p>
]]></content:encoded>
			<wfw:commentRss>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-adding-exceptions/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting to Know Gibraltar &#8211; Making a Start</title>
		<link>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-making-a-start</link>
		<comments>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-making-a-start#comments</comments>
		<pubDate>Mon, 28 Nov 2011 20:29:00 +0000</pubDate>
		<dc:creator>Gary</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Product Information]]></category>
		<category><![CDATA[Gibraltar]]></category>

		<guid isPermaLink="false">http://rocksolid.gibraltarsoftware.com/?p=1051</guid>
		<description><![CDATA[In order to learn how Gibraltar works I'm going to create a minimalist application, with tracing, and add Gibraltar too it]]></description>
			<content:encoded><![CDATA[<p>Hello there. My name is Gary Short and I’ve recently joined Gibraltar Software. Amongst the other things I’ll be doing (more details on those later) I’ll be evangelising the <a href="http://www.gibraltarsoftware.com/">Gibraltar product</a>.</p>
<p>Now I’ve never used the product and I don’t know anything about it, so I guess I’m on the same sort of learning curve as a new customer when they first <a href="http://www.gibraltarsoftware.com/Try/">download a trial version</a>.</p>
<p>We all learn in different ways and at different speeds, but the way I learn best is through action centred learning, in other words, I like to “do stuff” to learn how “stuff works”. So, the best way for me to learn how to do something with Gibraltar, is to do something with Gibraltar. <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/wlEmoticon-smile.png" alt="Smile" /></p>
<p>So what’s the simplest thing I can do to get something working? Well after having a quick look at the documentation, it seems to me that the simplest thing to do is:</p>
<ol>
<li>Configure a minimalist application for tracing</li>
<li>Hook up Gibraltar</li>
<li>Examine the data in Gibraltar.</li>
</ol>
<p>Okay, so let’s do that!</p>
<p><strong>Step 1. Configure a Minimalist Application For Tracing</strong></p>
<p>Let’s work with the simplest thing, namely a console application with one method and a couple of calls to the Tracing API. Something like this should fit the bill:</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using Gibraltar.Agent;

namespace GibraltarGettingStartedApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Trace.WriteLine(&quot;Entered method!&quot;);
            Console.WriteLine(&quot;In the body of the method!&quot;);
            Trace.WriteLine(&quot;Leaving method!&quot;);
        }
    }
}
</pre>
<p>And when we run this, it does pretty much as we’d expect it to do:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1cd40ddc" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1cd40ddc.png" alt="SNAGHTML1cd40ddc" width="582" height="296" border="0" /></p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image2.png" alt="image" width="428" height="259" border="0" /></p>
<p><strong>Step 2. Hook up Gibraltar</strong></p>
<p>Firstly, start Gibraltar and from the and click the “Add Gibraltar Now” button:</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb2.png" alt="image" width="429" height="202" border="0" /></a></p>
<p>Then, simply work your way through the wizard. Starting with selecting the project file for your application:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1cdaa960" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1cdaa960.png" alt="SNAGHTML1cdaa960" width="408" height="330" border="0" /></p>
<p>Next, since we’re doing the simplest thing possible, accept the default configuration:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1cdbcbed" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1cdbcbed.png" alt="SNAGHTML1cdbcbed" width="407" height="330" border="0" /></p>
<p>Then deselect all the checkboxes.With the exception of “Allow Sessions to be Emailed to you”, which I can guess at, I have no idea what these do, but we’ll find out later. For now, we just want to do the simplest thing that’ll work.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1ce275e2" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1ce275e2.png" alt="SNAGHTML1ce275e2" width="409" height="331" border="0" /></p>
<p>And we’re done:</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1ce31a6a.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1ce31a6a" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1ce31a6a_thumb.png" alt="SNAGHTML1ce31a6a" width="414" height="335" border="0" /></a></p>
<p>Okay so let’s run our application again.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="SNAGHTML1d52aa8a" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/SNAGHTML1d52aa8a.png" alt="SNAGHTML1d52aa8a" width="424" height="216" border="0" /></p>
<p>Hmm, notice that the console window stays open this time, and we have to physically close it to make our application end – what&#8217;s happening here I wonder? We’ll come back and investigate that in a moment, but for now, let’s see what information is available in Gibraltar.</p>
<p><strong>Step 3. Examine the Data in Gibraltar</strong></p>
<p>Open Gibraltar and select “New Sessions”</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image4.png" alt="image" width="196" height="177" border="0" /></p>
<p>and in the right hand pane, we see that we do indeed have information from our application! <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/wlEmoticon-smile.png" alt="Smile" /></p>
<p>Now it’s time to investigate that “application is still running” oddity. Looking at the information we can see that the “status” is  “crashed”, even though we closed it down properly.</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image5.png" alt="image" width="445" height="79" border="0" /></p>
<p>My guess as to what is going on here is that the Gibraltar Agent is holding open the application after the execution path has reached the end of the Main() method. We then closed the window manually, and because our application didn&#8217;t end in the way Gibraltar expected, it&#8217;s marked this event as a &#8220;crash&#8221;. It’s time to look up the documentation and find out what’s going on.</p>
<p>A quick read of the documentation at:</p>
<p><a title="http://www.gibraltarsoftware.com/Support/Documentation/WinForms_DevelopersReference_EnsureYourApplicationExits.html" href="http://www.gibraltarsoftware.com/Support/Documentation/WinForms_DevelopersReference_EnsureYourApplicationExits.html">http://www.gibraltarsoftware.com/Support/Documentation/WinForms_DevelopersReference_EnsureYourApplicationExits.html</a></p>
<p>Shows us that indeed, when we are using a console application, we are responsible for ending the session. We can also see that there are a number of ways to do this, but since we are trying the simplest possible thing that will work, we’ll just add the Trace.Close() call to the end off our application. So now our code looks like this:</p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Diagnostics;
using Gibraltar.Agent;

namespace GibraltarGettingStartedApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Trace.WriteLine(&quot;Entered method!&quot;);
            Console.WriteLine(&quot;In the body of the method!&quot;);
            Trace.WriteLine(&quot;Leaving method!&quot;);
            Trace.Close();
        }
    }
}
</pre>
<p>If we run our application now, we can see that our application closes when we get to the end of the Main() method. If we look in Gibraltar we can also see that our application has closed normally:</p>
<p><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image6.png" alt="image" width="443" height="68" border="0" /></p>
<p>Okay, I think that is enough for this post. To help us learn how Gibraltar works, we’ve build a minimalist application and enabled Gibraltar to record our trace information. In the next post, we’ll build on these beginnings by looking at what happens when our application throws and error. We’ll also find out if Gibraltar deals with handled and unhandled exceptions differently.</p>
<p>Until next time, happy coding! <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/wlEmoticon-smile.png" alt="Smile" /></p>
]]></content:encoded>
			<wfw:commentRss>http://rocksolid.gibraltarsoftware.com/development/logging/getting-to-know-gibraltar-making-a-start/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gibraltar for Silverlight and Windows Phone 7</title>
		<link>http://rocksolid.gibraltarsoftware.com/development/logging/gibraltar-for-silverlight-and-windows-phone-7</link>
		<comments>http://rocksolid.gibraltarsoftware.com/development/logging/gibraltar-for-silverlight-and-windows-phone-7#comments</comments>
		<pubDate>Mon, 11 Jul 2011 14:08:48 +0000</pubDate>
		<dc:creator>Robert McLaws</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[CEIP]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://rocksolid.gibraltarsoftware.com/?p=912</guid>
		<description><![CDATA[We have a lot of customers using Gibraltar with the server-side Silverlight apps, but until now, you had to roll your own solution to get client-side log messages into Gibraltar.  There were options such as using NLog or CLog to forward client-side messages to Gibraltar, but we didn&#8217;t provide any out-of-the-box capability for client-side logging. We&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>We have a lot of customers using Gibraltar with the server-side Silverlight apps, but until now, you had to roll your own solution to get client-side log messages into Gibraltar.  There were options such as using NLog or CLog to forward client-side messages to Gibraltar, but we didn&#8217;t provide any out-of-the-box capability for client-side logging.</p>
<p>We&#8217;ve just released sample code (both source and binary) that will ultimately form the basis for built-in Silverlight and Windows Phone support in a future version of Gibraltar.  It supports Silverlight 3 &amp; 4 as well as Windows Phone 7.x. You can use on binaries as-is (we even provide a NuGet package to make it super easy to integrate), or you can start with our implementation then tweak the code as you wish. Either way, it gives you an easy way to get a more complete picture from your Gibraltar logs today including both client- and server-side logging.</p>
<p>Please check out the bits and let us know what you think!</p>
<p><strong>Understanding the Design</strong><br />
Our support for Silverlight comes in two parts: a client-side library that is a subset of the current Gibraltar.Agent shipping release, and a server-side AgentConnector that acts as the “message sink” for each Silverlight client that writes client-side messages to the Gibraltar log, which is then packaged up and pushed to the Hub and/or Analyst just as you would expect.</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb.png" alt="image" width="550" height="84" border="0" /></a></p>
<p>The Agent Connector is a REST-based WCF service that leverages <a href="http://blogs.msdn.com/b/davidebb/archive/2010/10/11/light-up-your-nupacks-with-startup-code-and-webactivator.aspx" target="_blank">WebActivator</a> to automatically configure the service route, give you near-zero-config that will have you up and running in less than 5 minutes.</p>
<p>Log messages are continuously streamed from each client to your web application with client-side message buffering to ensure that no more than one outbound request to to the Agent Connector is active at once for each client. Server-side, each client is assigned a unique ID to make it easy to analyze multi-user behaviors and trace individual client sessions from Gibraltar Analyst.</p>
<p><strong>Getting the Bits</strong><br />
There are two different ways you can get the code. The first is through <a title="Getting started with NuGet" href="http://docs.nuget.org/docs/start-here/overview" target="_blank">NuGet.org</a>. If you’re not familiar with NuGet, it is a free Visual Studio extension that manages assembly dependencies including automatic downloads and updates. The &#8220;Server&#8221; component of this design leverages NuGet to pull down Gibraltar.Agent, as well as WebActivator, so either way, you&#8217;ll want to check it out.</p>
<p>The second option is to <a href="http://www.gibraltarsoftware.com/support/Gibraltar/Silverlight/Latest_Version" target="_blank">download a zip file</a> containing the same binaries included in the NuGet packages as well as the full source code, an end-to-end sample application and a ReadMe file with details on building and integrating the code.</p>
<p><strong>Installing the Server Bits with NuGet</strong><br />
Your solution will likely have two parts, a Silverlight client app, and a Web Application. To start, you’ll want to have the NuGet Package Manager installed in VS2010. You’ll also want to have already configured the Gibraltar Agent on your web app. If you have not done so, please follow the directions <a href="http://www.gibraltarsoftware.com/support/Documentation.aspx?Page=Viewer_ConfigWizard_Introduction.html" target="_blank">on this page of our User’s Guide</a>.</p>
<p>Right-click your web project, and select “Manage NuGet Packages”. In the resulting window, type “Gibraltar.Agent” into the search box in the top-right corner. You should be presented with a number of packages. Select ‘Gibraltar Agent for Silverlight – Server”. This will add the assembly references, as well as a clientaccesspolicy.xml file, to the root of your app. You can also open up the NuGet Package Console and type &#8220;Install-Package Gibraltar.Agent.Silverlight.Server&#8221;, which will accomplish the same thing.</p>
<p><strong>Installing and Configuring the Client Bits with NuGet</strong><br />
Now right-click your Silverlight project, call up the NuGet Package Manager again, run the same search, and this time select the “Gibraltar Agent for Silverlight – Client” package. You can also open up the NuGet Package Console and type &#8220;Install-Package Gibraltar.Agent.Silverlight.Client&#8221;. After it installs the proper assemblies for your project type (the same package has the SL3, SL4, and WP7 binaries), there is one more thing you’ll need to do. You need to add the following string to the ResourceDictionary in your App.xaml file:</p>
<pre class="brush: xml; title: ; notranslate">&lt;system:String x:Key=&quot;GibraltarAgentServer&quot;&gt;http://YOURSITEHERE.com/&lt;/system:String&gt;</pre>
<p>This value needs to be the root of your application, be it a domain, subdomain, or IIS application. This will be combined with the built-in WCF route auto-registered by the Server binaries (“/GibraltarAgentService/”, to be exact). Now, you should be able to use Gibraltar.Agent.Log just like you always have:</p>
<pre class="brush: csharp; title: ; notranslate">
Log.TraceCritical(&quot;This is a critical message.&quot;);
</pre>
<p>Since multiple clients will likely be connected, the service assigns each IP address a unique integer ID, so you can easily track which messages come from which clients or have Gibraltar filter the view to only show messages from a single client. You’ll see results similar to the screenshot below:</p>
<p><a href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/image_thumb1.png" alt="image" width="550" height="390" border="0" /></a></p>
<p>Well, there you have it. Get the bits and tell us what you think. Even with this early sample, we’ve sought to make it as robust and forgiving as possible, in line with <a href="http://rocksolid.gibraltarsoftware.com/development/logging/first-do-no-harm-designing-robust-infrastructure" target="_blank">our goal to “First, Do No Harm”</a>. Your feedback will help us extend and harden our Silverlight support and become an easy-to-use and rock-solid part of the standard distribution for a future Gibraltar version. So, if you find any issues, please do not hesitate to leave a comment and let us know.</p>
]]></content:encoded>
			<wfw:commentRss>http://rocksolid.gibraltarsoftware.com/development/logging/gibraltar-for-silverlight-and-windows-phone-7/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Philly.NET Code Camp 2011.1 &#8211; Presentation Notes and More</title>
		<link>http://rocksolid.gibraltarsoftware.com/development/philly-net-code-camp-2011-1-presentation-notes-and-more</link>
		<comments>http://rocksolid.gibraltarsoftware.com/development/philly-net-code-camp-2011-1-presentation-notes-and-more#comments</comments>
		<pubDate>Mon, 18 Apr 2011 18:42:04 +0000</pubDate>
		<dc:creator>Kendall</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Speaking]]></category>
		<category><![CDATA[AppFabric Cache]]></category>
		<category><![CDATA[Code Camp]]></category>
		<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://rocksolid.gibraltarsoftware.com/?p=867</guid>
		<description><![CDATA[Get our presentation notes and source code from Easy Application Scaling with Microsoft AppFabric and AOP, presented at the Philly Code Camp 2011.1.]]></description>
			<content:encoded><![CDATA[<p>The Gibraltar team was there in force for Philly.NET Code Camp 2011.1.  Since it&#8217;s right in our backyard we brought more of the team and had a booth set up.  We were just thrilled at how many people stopped by to talk &#8211; not just to check out Gibraltar and VistaDB (but that&#8217;s always great!) but also to talk about past presentations we&#8217;ve done.</p>
<p>Kendall Miller presented a new talk at this Code Camp &#8211; Easy Application Scaling with Microsoft AppFabric and AOP.  You can read the slides below as well as download the source code for the demos.  This is an extended version of the webinar we did a few months ago, with a lot more code samples.</p>
<div id="__ss_7614265" style="width: 425px;"><strong style="display: block; margin: 12px 0 4px;"><a title="Easy Scaling with AppFabric Cache and AOP" href="http://www.slideshare.net/gibraltarsoftware/easy-scaling-with-appfabric-cache-and-aop">Easy Scaling with AppFabric Cache and AOP</a></strong> <object id="__sse7614265" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=easyscalingwithappfabriccacheandaop-110413084925-phpapp01&amp;stripped_title=easy-scaling-with-appfabric-cache-and-aop&amp;userName=gibraltarsoftware" /><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=easyscalingwithappfabriccacheandaop-110413084925-phpapp01&amp;stripped_title=easy-scaling-with-appfabric-cache-and-aop&amp;userName=gibraltarsoftware" allowfullscreen="true" allowscriptaccess="always" name="__sse7614265"></embed></object>&nbsp;</p>
<div style="padding: 5px 0 12px;">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/gibraltarsoftware">Gibraltar Software</a></div>
</div>
<p>The key idea is that AppFabric cache creates a number of opportunities for high performance, highly scalable applications but you&#8217;ll want to do some up-front work to make it easy to use in your application.  The code samples walk through how to do it all by hand, then show how to use <a title="Post Sharp by Sharpcrafters" href="http://www.sharpcrafters.com/" target="_blank">PostSharp </a>to inject the code at compile time and make it a whole lot easier.  You can <a title="App Fabric Demo Code" href="http://rocksolid.gibraltarsoftware.com/wp-content/uploads/AppFabric-Demo-Code.zip">Download the Code</a> to see for yourself</p>
<p>Philly .NET was very well run as usual &#8211; all the food set up and ready to go, good places to network, lots of tracks and sessions to attend.  This year they also added an open spaces area for folks to hotly debate common challenges in a semi-moderated forum.  It was a fun place to sit and listen to the passionate, divergent opinions on the range of software construction topics.  Of course we were happy to see our friends from <a title="DevExpress at Philly Code Camp" href="http://community.devexpress.com/blogs/rachelhawley/archive/2011/04/07/devexpress-at-philly-code-camp-2011-1.aspx" target="_blank">DevExpress </a>there as well as the rest of the community.</p>
<p><script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script><br />
<script src="http://b.scorecardresearch.com/beacon.js?c1=7&amp;c2=7400849&amp;c3=1&amp;c4=&amp;c5=&amp;c6="></script></p>
]]></content:encoded>
			<wfw:commentRss>http://rocksolid.gibraltarsoftware.com/development/philly-net-code-camp-2011-1-presentation-notes-and-more/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

