<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>.Net Jonesie</title>
    <link>http://jonesie.net.nz/</link>
    <description>A simple programmers blog</description>
    <language>en-us</language>
    <copyright>Peter G Jones</copyright>
    <lastBuildDate>Tue, 27 Oct 2009 01:20:37 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>peter@jonesie.net.nz</managingEditor>
    <webMaster>peter@jonesie.net.nz</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/jonesie" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=1cb48594-ebac-467e-a7ec-c6976bd53c8b</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,1cb48594-ebac-467e-a7ec-c6976bd53c8b.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,1cb48594-ebac-467e-a7ec-c6976bd53c8b.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=1cb48594-ebac-467e-a7ec-c6976bd53c8b</wfw:commentRss>
      
      <title>Processing a SQL Batch</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,1cb48594-ebac-467e-a7ec-c6976bd53c8b.aspx</guid>
      <link>http://jonesie.net.nz/2009/10/27/ProcessingASQLBatch.aspx</link>
      <pubDate>Tue, 27 Oct 2009 01:20:37 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
This is something I have wanted for a while now.  Today I finally got around&#xD;
to doing something about it. I created a simple console application that can execute&#xD;
a SQL script file that you would normally use in Management Studio or SQLCMD. &#xD;
You might well ask why I would do such a thing.  &#xD;
&lt;/p&gt;&#xD;
        &lt;ol&gt;&#xD;
          &lt;li&gt;&#xD;
SSMS and SQLCMD is not always available or in the right place &#xD;
&lt;/li&gt;&#xD;
          &lt;li&gt;&#xD;
I don't have the code for SSMS and SQLCMD so I cant change the way they work&lt;/li&gt;&#xD;
        &lt;/ol&gt;&#xD;
        &lt;p&gt;&#xD;
In you read my previous post on deploying to SQL Azure then the first point will make&#xD;
sense.  The next step is to make this script processing code work in Azure so&#xD;
I don't have to create databases from my client.  Hopefully this will speed things&#xD;
up a little or a LOT.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Anyways, since I've always wanted someone to write this code and never found any,&#xD;
here it is in case you are in the same boat. &#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
            &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
                &lt;span style="color: blue"&gt;class&lt;/span&gt;&#xD;
                &lt;span style="color: #2b91af"&gt;Program&lt;/span&gt;&#xD;
              &lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
  {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
    &lt;span style="color: blue"&gt;static&lt;/span&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[]&#xD;
args)&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
    {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; connectionstring&#xD;
= args[0];&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; sql;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;FileStream&lt;/span&gt; fs&#xD;
= &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;FileStream&lt;/span&gt;(args[1], &lt;span style="color: #2b91af"&gt;FileMode&lt;/span&gt;.Open, &lt;span style="color: #2b91af"&gt;FileAccess&lt;/span&gt;.Read))&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: blue"&gt;byte&lt;/span&gt;[]&#xD;
bytes = &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: blue"&gt;byte&lt;/span&gt;[fs.Length];&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          fs.Read(bytes, 0, (&lt;span style="color: blue"&gt;int&lt;/span&gt;)fs.Length);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          sql = &lt;span style="color: #2b91af"&gt;Encoding&lt;/span&gt;.UTF8.GetString(bytes);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; ex)&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Unable&#xD;
to read sql script: "&lt;/span&gt; + ex.Message);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;return&lt;/span&gt; 1;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; batchTerminator&#xD;
= &lt;span style="color: #a31515"&gt;@"##GO##"&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: green"&gt;//Regex regex = new Regex(@"(^|\s+)"&#xD;
+ batchTerminator + @"\s", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt;[] strings =&#xD;
sql.Split(&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt;[]&#xD;
{batchTerminator}, &lt;span style="color: #2b91af"&gt;StringSplitOptions&lt;/span&gt;.None);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;SqlConnection&lt;/span&gt; con&#xD;
= &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;SqlConnection&lt;/span&gt;(connectionstring))&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        con.Open();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: #2b91af"&gt;SqlCommand&lt;/span&gt; cmd&#xD;
= &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;SqlCommand&lt;/span&gt;();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        cmd.CommandType = System.Data.&lt;span style="color: #2b91af"&gt;CommandType&lt;/span&gt;.Text;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        cmd.Connection = con;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; i&#xD;
= 0; i &amp;lt; strings.Length; i++)&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.Title&#xD;
= &lt;span style="color: #a31515"&gt;"Processing "&lt;/span&gt; + i.ToString() + &lt;span style="color: #a31515"&gt;"&#xD;
of "&lt;/span&gt; + strings.Length.ToString();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: green"&gt;//if&#xD;
((!regex.IsMatch(strings[i])) &amp;amp;&amp;amp; (!string.IsNullOrEmpty(strings[i].Trim())))&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: blue"&gt;if&lt;/span&gt; (!&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(strings[i].Trim()))&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(strings[i]);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            &lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              cmd.CommandText&#xD;
= strings[i];&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              cmd.ExecuteNonQuery();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ForegroundColor&#xD;
= &lt;span style="color: #2b91af"&gt;ConsoleColor&lt;/span&gt;.Green;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"O.K."&lt;/span&gt;);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ForegroundColor&#xD;
= &lt;span style="color: #2b91af"&gt;ConsoleColor&lt;/span&gt;.Gray;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            &lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; ex)&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            {&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ForegroundColor&#xD;
= &lt;span style="color: #2b91af"&gt;ConsoleColor&lt;/span&gt;.Red;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;"Error:&#xD;
"&lt;/span&gt; + ex.Message);&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.ForegroundColor&#xD;
= &lt;span style="color: #2b91af"&gt;ConsoleColor&lt;/span&gt;.Gray;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: blue"&gt;return&lt;/span&gt; 2;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
            &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine();&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
          }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;return&lt;/span&gt; 0;&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: green"&gt;//Console.WriteLine("Press&#xD;
ENTER when complete");&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: green"&gt;//Console.ReadLine();&lt;/span&gt;&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
              &lt;p style="margin: 0px"&gt;&#xD;
  }&#xD;
&lt;/p&gt;&#xD;
            &lt;/div&gt;&#xD;
          &lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Ok, so it’s not the prettiest or most bullet proof code on the planet, but it works.  &lt;strike&gt;The&#xD;
RegEx is the key to the process.  It’s not perfect – it expects  GO commands&#xD;
to separate the batches and you need to have GO on a line by itself.  It’s easy&#xD;
to extend this should you wish&lt;/strike&gt;.&lt;font color="#ff0000"&gt; [&lt;strong&gt;Update&lt;/strong&gt;]&lt;/font&gt; Regex&#xD;
don't work!  It’s just too hard to find all the GO’s accurately.  Instead,&#xD;
I manually search and replace Go with ##GO##.  This is a lot easier/safer to&#xD;
split with.  I also removed all PRINT statements from my scripts but you could&#xD;
easily parse these out when processing and have then display as progress messages&#xD;
(no need to send them to the server).&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Enjoy!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=1cb48594-ebac-467e-a7ec-c6976bd53c8b"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cu7FRJTSIcCnICts57mQytgg_Lk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cu7FRJTSIcCnICts57mQytgg_Lk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cu7FRJTSIcCnICts57mQytgg_Lk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cu7FRJTSIcCnICts57mQytgg_Lk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,1cb48594-ebac-467e-a7ec-c6976bd53c8b.aspx</comments>
      <category>Azure</category>
      <category>General</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=0fe03aa3-97e0-40d6-ac72-2786c894fb45</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,0fe03aa3-97e0-40d6-ac72-2786c894fb45.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,0fe03aa3-97e0-40d6-ac72-2786c894fb45.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=0fe03aa3-97e0-40d6-ac72-2786c894fb45</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>Migrating and Partitioning a Database to SQL Azure</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,0fe03aa3-97e0-40d6-ac72-2786c894fb45.aspx</guid>
      <link>http://jonesie.net.nz/2009/10/25/MigratingAndPartitioningADatabaseToSQLAzure.aspx</link>
      <pubDate>Sun, 25 Oct 2009 22:07:49 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Moving data from one SQL Server to another is a fairly trivial task these days. &#xD;
You have many options – backup/restore the database, SSIS, detach/copy/attach, ADO.Net,&#xD;
BCP, blah blah blah.  Moving data to SQL Azure is more challenging.  Here&#xD;
is my experience and some details of the solution.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;The Scenario&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The application we are creating has a master application database and database per&#xD;
‘client’.  The per client database will be partitioned into many smaller databases&#xD;
– each being a replica of the source database with a filter on one or two tables.&#xD;
The creation of the partitions will require the client application to be shut down&#xD;
for a period of time – not ideal but acceptable.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
SQL Azure does not (yet) include any support for partitioning or &lt;a href="http://en.wikipedia.org/wiki/Shard_(database_architecture)" target="_blank"&gt;sharding&lt;/a&gt; so&#xD;
we knew we would have to create the solution ourselves.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Options&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
We wanted to have a flexible partitioning solution so from the outset I thought that&#xD;
SSIS would provide a mechanism that would allow the client to create their own partition&#xD;
rules as required. When I started creating the solution BCP was not available.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Trials and Tribulations&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Before partitioning of the database could be performed it was necessary to move the&#xD;
source database to SQL Azure. Before moving the database it’s necessary to have a&#xD;
script that will create the empty database schema.  When I first did this there&#xD;
where no tools so I used the database tools in VSTS to import from the local database&#xD;
and then manually tweaked the script to make it compatible with SQL Azure.  These&#xD;
days there is the &lt;a href="http://sqlazuremw.codeplex.com/" target="_blank"&gt;Migration&#xD;
Wizard on CodePlex&lt;/a&gt; which does pretty good (but not perfect) job of migrating your&#xD;
schema and optionally data.&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 0&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
Executing the schema script is very very slow.  Locally it takes seconds. &#xD;
In SQL Azure it can take up to fifteen minutes. We have tested this from several connections&#xD;
(inside and outside our network and with different service providers) and it’s never&#xD;
been less than eight minutes. Our contacts at Microsoft can run the same script in&#xD;
three minutes.  I have some ideas why this is slow and a possible solution… more&#xD;
on this later if I solve it… but for now this is a big problem – 15 x 42 (the number&#xD;
of partitions) = way too long!&#xD;
&lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
It’s been a long time since I’ve had to do anything with SQL Server beyond creating&#xD;
databases for SharePoint or EPiServer and SSIS was completely new to me.  However,&#xD;
I managed to piece together a package that copied the tables from one database to&#xD;
another.  This package called other packages – 1 for each table – that would&#xD;
truncate the destination table and copy the records.  &#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 1&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
Because there we 30 or so packages I used xml package configuration files to specify&#xD;
the database connections so that I could change the source and destination in one&#xD;
place.  When running the packages in Visual Studio this would constantly remind&#xD;
me that the connection had changed (when it hadn’t) so I had to turn this off. &#xD;
Not a big problem but annoying.&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 2&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
Running each separate table copy worked fine most of the time but running all of the&#xD;
packages in sequence (see problem 3) would fail in different places for various reasons. &#xD;
Sometimes I would get duplicate key errors – which was theoretically impossible.&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 3&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
All but two of the tables have identity columns.  To move the data I had to SET&#xD;
IDENTITY_INSERT ON for the destination table.  OLE DB Destination tasks in the&#xD;
dataflow let you specify identity inserts but these don't work in SQL Azure – you&#xD;
must currently use ADO.Net source and destinations tasks.&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
You can only have a single SET IDENTITY_INSERT ON per database so this means I had&#xD;
to run all these identity table packages sequentially which makes the whole process&#xD;
very slow.&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 4&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
Reliability.  SSIS in Visual Studio seems to me to be very unreliable and flaky. &#xD;
I was plagued with performance issues and crashes.  &#xD;
&lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
In the end, frustration got the better of me and I gave up on SSIS.  Thankfully,&#xD;
BCP for SQL Azure became available last week so that provided an option with more&#xD;
control and visibility. ADO.Net includes a SQLBulkCopy class.  This will let&#xD;
you move data from many different sources to a database table.  It provides a&#xD;
few options to control the behaviour of the operation and this seemed like the best&#xD;
option – the last time I used command line BCP was back in ‘95 with SQL Server 6.5&#xD;
I think – or it might have been Sybase (which in those days was pretty much the same&#xD;
thing).&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I whipped up a simple unit test and some classes to test SQLBulkCopy and it didn’t&#xD;
take long to realise that this wasn’t going to work either.&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problem 5&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
I kept getting errors about not having SET XACT_ABORT set ON.  Binging for this&#xD;
led me down the DTC path.  This is the same path that leads to hell! I couldn’t&#xD;
understand why DTC was getting involved because I had not invoked any transactions. &#xD;
I thought that BCP or my source data reader query was doing something funky so I just&#xD;
added the following SQLCommand query before I started the bulk copy:&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
    SqlCommand xact = new SqlCommand("set xact_abort on", dst);&lt;br&gt;&#xD;
    xact.ExecuteNonQuery(); &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
  &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
This seemed to work, for a while.&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
(It turned out that the base class for my unit test was declaring a TransactionScope&#xD;
that wrapped everything in my unit test.  I didn’t spot this until I have up&#xD;
with SQLBulkCopy so it may well be that this is not necessary now).&#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;u&gt;Problems 6, 7 &amp;amp; 8&lt;/u&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
I’m not exactly sure when I decided to give up on SQLBulkCopy but it was somewhere&#xD;
around the problems with timeouts, lockups and random results.&#xD;
&lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
My options were now reduced to a short list of one – command line BCP.  After&#xD;
a few false starts (I don’t read instructions as well as I could) I managed to get&#xD;
something working quite well.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Success! Moistly…&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I created a batch file to test the various options with BCP.  It’s really pretty&#xD;
simple to use but I wanted the simplest possible solution that would be easy to support&#xD;
and maintain.  Using the native option (-n) provided this but it does mean that&#xD;
should and destination tables need to be almost identical. When creating the schema&#xD;
script I had re-ordered the columns on one table.  This was enough to cause a&#xD;
problem for native mode which generated some cryptic errors.  Thankfully the&#xD;
error file (-e option) provided enough clues to figure out what was wrong.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;u&gt;Throttling&lt;/u&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
SQL Azure will drop connections when/if there is a heavy load on a database. &#xD;
This it to enable high availability – which sounds silly – how can it be highly available&#xD;
if the connections keep dropping? – but in reality this just means you need to be&#xD;
prepared for a connection to drop and transactions to fail if the load on the database&#xD;
/ server is exceeded.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Determining what the threshold is for throttling of the connections is difficult. &#xD;
So difficult in fact that one might say impossible. Throttling is triggered by activity&#xD;
by all users of a server. The server is also virtual (not as in a virtual machine&#xD;
but as in a virtual connection to one or more virtual machines).  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
My BCP commands on one table (the largest) would consistently cause the throttling&#xD;
to kick in.  This table has about 230,000 rows – not huge by and stretch of the&#xD;
imagination.  Thankfully, BCP allows to to specify the batch size and the first&#xD;
and last rows to use.  For this table I found that 10,000 rows per batch worked&#xD;
most of the time and executing BCP on chucks of 50,000 records seems to have stopped&#xD;
the throttling.  Using the first and last row options also provided the opportunity&#xD;
to retry a chuck of records should throttling kill the connection.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The final (so far) code for running command line BCP in a mode that SQL Azure can&#xD;
handle looks like this.  This code is far from complete but should be sufficient&#xD;
to explain the process. Please feel free to adopt and enhance as you see fit.&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
              &lt;span style="color: blue"&gt;private&lt;/span&gt;&#xD;
              &lt;span style="color: blue"&gt;void&lt;/span&gt; copyTableWithCmdLineBCP(&lt;span style="color: blue"&gt;string&lt;/span&gt; sourceServer, &lt;span style="color: blue"&gt;string&lt;/span&gt; sourceDatabase, &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
  &lt;span style="color: blue"&gt;string&lt;/span&gt; sourceTable, &lt;span style="color: blue"&gt;string&lt;/span&gt; sourceRule, &lt;span style="color: blue"&gt;string&lt;/span&gt; sourceUserName, &lt;span style="color: blue"&gt;string&lt;/span&gt; sourcePassword,&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
  &lt;span style="color: blue"&gt;string&lt;/span&gt; destinationServer, &lt;span style="color: blue"&gt;string&lt;/span&gt; destinationDatabase, &lt;span style="color: blue"&gt;string&lt;/span&gt; destinationTable, &lt;span style="color: blue"&gt;string&lt;/span&gt; destinationUserName, &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
  &lt;span style="color: blue"&gt;string&lt;/span&gt; destinationPassword, &lt;span style="color: blue"&gt;int&lt;/span&gt; rowsToCopy)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; ofile = &lt;span style="color: #2b91af"&gt;Path&lt;/span&gt;.GetTempFileName();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; sourceQ = getSourceQuery(sourceDatabase&#xD;
+ &lt;span style="color: #a31515"&gt;".dbo."&lt;/span&gt; + sourceTable, sourceRule);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; countQ = getCountQuery(sourceDatabase&#xD;
+ &lt;span style="color: #a31515"&gt;".dbo."&lt;/span&gt; + sourceTable, sourceRule);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;string&lt;/span&gt; args;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: green"&gt;// export to a temp file&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;if&lt;/span&gt; (sourceUserName&#xD;
== &lt;span style="color: blue"&gt;null&lt;/span&gt;)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: green"&gt;// no user name&#xD;
so use trusted security&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        args = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"\"{0}\"&#xD;
queryout \"{1}\" -S {2} -T -n -E"&lt;/span&gt;, sourceQ, ofile, sourceServer);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        args = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"\"{0}\"&#xD;
queryout \"{1}\" -S {2} -U {3} -P {4} -n -E"&lt;/span&gt;, &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
                &#xD;
sourceQ, ofile, sourceServer, sourceUserName, sourcePassword);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      execProcessAndCheck(Properties.&lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.BCPCMDPath,&#xD;
args, &lt;span style="color: #a31515"&gt;"Bulk copy export failed for table "&lt;/span&gt; + &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
               &#xD;
sourceTable);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: green"&gt;// import the file one chuck&#xD;
at a time&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;int&lt;/span&gt; startRow&#xD;
= 1; startRow &amp;lt;= rowsToCopy; startRow += MAX_ROWS_PER_BATCH)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;int&lt;/span&gt; tries&#xD;
= 0;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (destinationUserName&#xD;
== &lt;span style="color: blue"&gt;null&lt;/span&gt;)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: green"&gt;//&#xD;
no user name so use trusted security&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          args = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"{0}.dbo.{1}&#xD;
in {2} -S {3} -T -n -b 10000 -E -F {4}"&lt;/span&gt;,&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
            destinationDatabase,&#xD;
destinationTable, ofile, destinationServer, startRow);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;else&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          args = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"{0}.dbo.{1}&#xD;
in {2} -S {3} -U {4} -P {5} -n -b 10000 -E -F {6}"&lt;/span&gt;,&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
            destinationDatabase,&#xD;
destinationTable, ofile, destinationServer, destinationUserName,&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
            destinationPassword,&#xD;
startRow);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;int&lt;/span&gt; endRow&#xD;
= startRow + MAX_ROWS_PER_BATCH - 1;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (endRow&#xD;
&amp;lt; rowsToCopy)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          args += &lt;span style="color: #a31515"&gt;"&#xD;
-L "&lt;/span&gt; + endRow.ToString();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: green"&gt;// execute with&#xD;
retries&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;while&lt;/span&gt; (!execProcessAndCheck(Properties.&lt;span style="color: #2b91af"&gt;Settings&lt;/span&gt;.Default.BCPCMDPath,&#xD;
args, &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
           &lt;span style="color: #a31515"&gt;"Bulk&#xD;
copy import failed for table "&lt;/span&gt; + destinationTable) &amp;amp;&amp;amp; ++tries &amp;lt;=&#xD;
MAX_RETRIES)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          Logger.WriteLog(&lt;span style="color: #2b91af"&gt;LogCategory&lt;/span&gt;.Error, &lt;span style="color: #a31515"&gt;"Operation&#xD;
failed due to connection failure.  Will retry."&lt;/span&gt;);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: #2b91af"&gt;Thread&lt;/span&gt;.Sleep(WAIT_BETWEEN_RETRIES);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
          &lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
This uses a couple of helper methods.  getSourceQuery and getCountQuery simply&#xD;
return queries for a specified table name and ‘rule’  The rule is a string which&#xD;
defines how to partition the table.  A switch statement is used to determine&#xD;
the WHERE clause for a table based on the table name and rule value.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
execProcessAndCheck executes a command line with arguments and captures the output. &#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    &lt;span style="color: blue"&gt;private&lt;/span&gt;&lt;span style="color: blue"&gt;bool&lt;/span&gt; execProcessAndCheck(&lt;span style="color: blue"&gt;string&lt;/span&gt; cmdLine, &lt;span style="color: blue"&gt;string&lt;/span&gt; args, &lt;span style="color: blue"&gt;string&lt;/span&gt; errorMessage)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      _processOutput = &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;StringBuilder&lt;/span&gt;();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: #2b91af"&gt;ProcessStartInfo&lt;/span&gt; psi&#xD;
= &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;ProcessStartInfo&lt;/span&gt;(cmdLine,&#xD;
args);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      psi.RedirectStandardError = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      psi.RedirectStandardOutput = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      psi.UseShellExecute = &lt;span style="color: blue"&gt;false&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      psi.CreateNoWindow = &lt;span style="color: blue"&gt;true&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: #2b91af"&gt;Process&lt;/span&gt; prs = &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Process&lt;/span&gt;();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      prs.OutputDataReceived += &lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;DataReceivedEventHandler&lt;/span&gt;(prs_OutputDataReceived);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      prs.StartInfo = psi;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      prs.Start();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      prs.BeginOutputReadLine();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;if&lt;/span&gt; (prs != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        prs.WaitForExit(MAX_PROCESS_TIME);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (!prs.HasExited)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          prs.Kill();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: blue"&gt;throw&lt;/span&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(errorMessage&#xD;
+ &lt;span style="color: #a31515"&gt;" - command has exceeded the maximum allowable time&#xD;
and was exterminated."&lt;/span&gt;);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;return&lt;/span&gt; checkProcessResults(prs,&#xD;
errorMessage);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
          &lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The output is captured by a simple event handler:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    &lt;span style="color: blue"&gt;void&lt;/span&gt; prs_OutputDataReceived(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;DataReceivedEventArgs&lt;/span&gt; e)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;if&lt;/span&gt; (!&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(e.Data))&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        _processOutput.AppendLine(e.Data);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
          &lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
_processOutput is a class scoped StringBuilder.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The results from the process are checked by checkProcessResults:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    &lt;span style="color: blue"&gt;private&lt;/span&gt;&lt;span style="color: blue"&gt;bool&lt;/span&gt; checkProcessResults(&lt;span style="color: #2b91af"&gt;Process&lt;/span&gt; prs, &lt;span style="color: blue"&gt;string&lt;/span&gt; message)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;if&lt;/span&gt; (prs.ExitCode !=&#xD;
0)&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: green"&gt;// look for&#xD;
error 10054 - this means that SQL Azure has throttled and we should retry&lt;/span&gt;&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;string&lt;/span&gt; output&#xD;
= _processOutput.ToString();&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;if&lt;/span&gt; (output.Contains(&lt;span style="color: #a31515"&gt;"NativeError&#xD;
= 10054"&lt;/span&gt;))&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        {&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
          &lt;span style="color: blue"&gt;return&lt;/span&gt;&lt;span style="color: blue"&gt;false&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        message += &lt;span style="color: #a31515"&gt;":&#xD;
Error Code = "&lt;/span&gt; + prs.ExitCode.ToString() + &lt;span style="color: #a31515"&gt;" :&#xD;
Message = "&lt;/span&gt; + output;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
        &lt;span style="color: blue"&gt;throw&lt;/span&gt;&lt;span style="color: blue"&gt;new&lt;/span&gt;&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;(message);&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      }&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
      &lt;span style="color: blue"&gt;return&lt;/span&gt;&lt;span style="color: blue"&gt;true&lt;/span&gt;;&#xD;
&lt;/p&gt;&#xD;
            &lt;p style="margin: 0px"&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
          &lt;/div&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This is all very specify to the way BCP.exe and SQLCMD.exe work – if you want to use&#xD;
this for other command line tools then some tweaking will no doubt be required.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Summary&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
SQL Azure is an extremely powerful platform - despite the issues described above. &#xD;
It will definitely get better as the product gets closer to release.  Most of&#xD;
my problems are caused by my recent inexperience with SQL tools and the general nature&#xD;
of an unfinished product.  Learning how to do this stuff now will provide a better&#xD;
understanding of the realities of cloud based computing as opposed to hosting a SQL&#xD;
Server on some internet connected remote server.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Performance of the database creation, upload and partitioning could be enhanced in&#xD;
several ways.  Threading could help enormously when creating the partition databases&#xD;
but throttling may reduce any benefit when it comes to uploading the data.  Using&#xD;
multiple SQL Azure servers would also help a little. Moving the functionality into&#xD;
the cloud could be possible if SQLBulkCopy would work betterer and if I had a mechanism&#xD;
for creating the database schema other than SQLCmd.exe.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
All of these options are possible given more time – but &lt;a href="http://microsoftpdc.com/" target="_blank"&gt;PDC09&lt;/a&gt; is&#xD;
our hard deadline - so what I have so far will hopefully be good enough for a wicked&#xD;
kick-arse sexed-up demo of what is possible with this awesome platform! I’ll talk&#xD;
more about this application when I can… :)&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=0fe03aa3-97e0-40d6-ac72-2786c894fb45"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QjKFLQZvBxsjJATmAcKPGbjoIYM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QjKFLQZvBxsjJATmAcKPGbjoIYM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QjKFLQZvBxsjJATmAcKPGbjoIYM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QjKFLQZvBxsjJATmAcKPGbjoIYM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,0fe03aa3-97e0-40d6-ac72-2786c894fb45.aspx</comments>
      <category>Azure</category>
      <category>General</category>
      <category>SQL</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=913738ea-f664-4228-8d31-5b8b6dfacb50</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,913738ea-f664-4228-8d31-5b8b6dfacb50.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,913738ea-f664-4228-8d31-5b8b6dfacb50.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=913738ea-f664-4228-8d31-5b8b6dfacb50</wfw:commentRss>
      
      <title>Deploying and Load Balancing EPiServer 5.2</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,913738ea-f664-4228-8d31-5b8b6dfacb50.aspx</guid>
      <link>http://jonesie.net.nz/2009/09/28/DeployingAndLoadBalancingEPiServer52.aspx</link>
      <pubDate>Mon, 28 Sep 2009 08:40:52 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
It’s been a while since I’ve blogged anything about EPiServer – 2 reasons - &#xD;
1) I haven’t done an awful lot with it lately and 2) it’s just so easy it seems silly&#xD;
to blog about. However, over the last couple of weeks I’ve been helping out on a web&#xD;
site replacement project and one of my tasks was to install and configure the various&#xD;
servers – development, staging, UAT &amp;amp; production.  So, me thinks it’s time&#xD;
to talk about it.&#xD;
&lt;/p&gt;&#xD;
        &lt;h5&gt;SuperDeploy&#xD;
&lt;/h5&gt;&#xD;
        &lt;p&gt;&#xD;
Normally EPiServer installation is performed manually using the EPiServer setup and&#xD;
Deployment Centre tools.  However, for this project we attempted to script the&#xD;
entire process using PowerShell scripts.  We have created a deployment tool with&#xD;
PowerShell – aptly named SuperDeploy – that we use for SharePoint installation and&#xD;
database creation.  This is very useful for creating fully automated installations&#xD;
that we can use during development and when we need to install on the clients environment. &#xD;
So, it seemed natural that we should extend this to work with EPiServer.  SuperDeploy&#xD;
uses a simple XML file to define what to install and where - the how is hard coded&#xD;
into PowerShell functions in the script.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Anyways, SuperDeploy works very well and provided a nice repeatable installation for&#xD;
all servers – up to a point.  With a bit more work it could do everything but&#xD;
time is.. you know what, so some manual steps were needed to finish off the production&#xD;
server.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The final production installation had 2 web servers identically configured. &#xD;
The EPiServer site files were installed to a folder on F:\ and this folder was mirrored&#xD;
between the 2 servers using Windows DFS – so changes to files on one server were automatically&#xD;
and instantly copied to the other server – essentially meaning we had a single set&#xD;
of files for both servers.  We could have had the files on a external drive array&#xD;
of some sort but this would mean a single point of failure.  Replicating the&#xD;
files between servers provides an extra level of redundancy. The EPiServer virtual&#xD;
file system (VPP) was also replicated using the same DFS mechanism. The SQL 2005 database&#xD;
was on a third server and this was mirrored using log shipping to a forth server.&#xD;
&lt;/p&gt;&#xD;
        &lt;h5&gt;Load Balancing&#xD;
&lt;/h5&gt;&#xD;
        &lt;p&gt;&#xD;
I’ve come to notice over recent years than when something looks hard and not very&#xD;
well documented – it turns out to be obvious and simple.  Such is the case with&#xD;
the configuration of EPiServer load balancing.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Documentation of the setup of EPiServer load balancing is hard to find. In fact the&#xD;
only documentation I could find was &lt;a href="http://labs.episerver.com/en/Blogs/Allan/Dates/112230/11/LoadBalancing-in-6-steps/" target="_blank"&gt;a&#xD;
single blog post&lt;/a&gt;.  This worried me somewhat as there isn’t a lot of detail&#xD;
in this post and it wasn’t an official EPiServer document. But I needn’t have worried&#xD;
– 5 of the 6 steps were correct but step 4 is applicable to IIS 6, not IIS 7 which&#xD;
we were using.  For IIS 7, httpModules must be specified in the &amp;lt;system.webserver&amp;gt;&#xD;
section of the web.config – not in &amp;lt;system.web&amp;gt;.  You can also configure&#xD;
these in IIS Manager.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The setup of Microsoft NLB was already done for us and the tool linked to in the above&#xD;
post proved that the network was indeed setup correctly.  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The hardest part was testing that the servers were actually load balanced.  Fortunately&#xD;
– a mistake by me editing the IIS config meant that one of the sites would not run. &#xD;
Browsing from a test client machine gave me an HTTP 500 error from IIS. It was impossible&#xD;
to know which server was failing so we disabled one of the servers from the load balancing&#xD;
by turning off the NLB agent.  When the client browser was able to see the site&#xD;
correctly we new a) which server was broken and b) NLB was working.  Crude? &#xD;
Yes, but good enough.  Some better testing is still required of course, but that's&#xD;
another story.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Even the smoothest installation can have surprises.  When we ran the site, we&#xD;
were prompted to login to view the home page – which is strange as it’s a public web&#xD;
site with anonymous access enabled.  We compared the production server configuration&#xD;
of IIS and web.config to the other servers and these were identical – we thought. &#xD;
In the end, we configured the IIS anonymous access user to be the application pool&#xD;
account rather than IUSR and the setup was done.&#xD;
&lt;/p&gt;&#xD;
        &lt;h5&gt;Morals of the story&#xD;
&lt;/h5&gt;&#xD;
        &lt;p&gt;&#xD;
EPiServer installation is easy – even for multiple load balanced servers. If you do&#xD;
have multiple server then ensure they are identically configured – Virtual Machines&#xD;
are a life saver!  Mirroring or sharing the site installation folder will help&#xD;
with this (but it also means a mistake on 1 server will potentially be a mistake on&#xD;
all servers – instantly!).  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Script your installation as much as possible.  It make repeating your installation&#xD;
simple.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Install often and early – preferably as part of your development cycle.  Don’t&#xD;
wait till the end of the development to test your deployment – YOU WILL REGRET IT&#xD;
– trust me!  If you can, have your automated build cycle run your deployment&#xD;
script every night.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Be pragmatic.  Perfect is great if you can afford it but customers and bosses&#xD;
are rarely willing to pay for this.  Good enough is usually good enough!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=913738ea-f664-4228-8d31-5b8b6dfacb50"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jraPwfVPYaRjUlTp9UvNTT4iV7w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jraPwfVPYaRjUlTp9UvNTT4iV7w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jraPwfVPYaRjUlTp9UvNTT4iV7w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jraPwfVPYaRjUlTp9UvNTT4iV7w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,913738ea-f664-4228-8d31-5b8b6dfacb50.aspx</comments>
      <category>EPiServer</category>
      <category>General</category>
      <category>PowerShell</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=30c9d6d6-d5bf-4a5d-a731-d392139f682c</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,30c9d6d6-d5bf-4a5d-a731-d392139f682c.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,30c9d6d6-d5bf-4a5d-a731-d392139f682c.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=30c9d6d6-d5bf-4a5d-a731-d392139f682c</wfw:commentRss>
      <slash:comments>3</slash:comments>
      
      <title>Slides &amp; Code from Azure Development Getting Started</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,30c9d6d6-d5bf-4a5d-a731-d392139f682c.aspx</guid>
      <link>http://jonesie.net.nz/2009/08/20/SlidesCodeFromAzureDevelopmentGettingStarted.aspx</link>
      <pubDate>Thu, 20 Aug 2009 02:00:33 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Here’s the slides and code from my user group session last night – Getting Started&#xD;
with Azure Development.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I covered the basics of Web and Worker roles, storage and a bit of the service bus.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Use as you see fit.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://jonesie.net.nz/content/binary/Drizle.zip"&gt;Drizle.zip (3.53 MB)&lt;/a&gt;&#xD;
          &lt;br&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;a href="http://jonesie.net.nz/content/binary/WindowsAzureStartingUp.zip"&gt;WindowsAzureStartingUp.zip&#xD;
(229.92 KB)&lt;/a&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=30c9d6d6-d5bf-4a5d-a731-d392139f682c"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/vOm1m0snO6Z4MznwL9srwRWWvT8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vOm1m0snO6Z4MznwL9srwRWWvT8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/vOm1m0snO6Z4MznwL9srwRWWvT8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/vOm1m0snO6Z4MznwL9srwRWWvT8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,30c9d6d6-d5bf-4a5d-a731-d392139f682c.aspx</comments>
      <category>Azure</category>
      <category>NZ .Net User Group</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=d44c77cb-2b71-44e1-a21e-13bb2ac4b584</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,d44c77cb-2b71-44e1-a21e-13bb2ac4b584.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,d44c77cb-2b71-44e1-a21e-13bb2ac4b584.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=d44c77cb-2b71-44e1-a21e-13bb2ac4b584</wfw:commentRss>
      <slash:comments>2</slash:comments>
      
      <title>Service Bus Version Weirdness</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,d44c77cb-2b71-44e1-a21e-13bb2ac4b584.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/23/ServiceBusVersionWeirdness.aspx</link>
      <pubDate>Thu, 23 Jul 2009 02:54:08 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://jonesie.net.nz/AzureNetServiceBusAmpTCP.aspx" target="_blank"&gt;After&#xD;
posting about using TCP&lt;/a&gt; with the .Net Service Bus and making it look sooooo simple,&#xD;
I’ve lost most of today trying to get the fracking thing working!  I doesn’t&#xD;
matter what I do in the config, the service host keeps prompting me for a Card (from&#xD;
CardSpace) even though I had everything setup for UserNamePassword creds.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
After much stuffing around I noticed that my solution had the wrong version of the&#xD;
service bus DLL (0.15.0.0 – March CTP I think).  This was my bad – I had copied&#xD;
the DLL to a solution folder.  So I grabbed the '”new” version (0.16.7.0) from&#xD;
the July CTP Assemblies folder and tried that.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Same result!  Arg!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Looking in the GAC I could see it had version 0.16.0.0.  What the ?!!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Time for a reinstall me think.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Download from MS.  Install. Chug chug….&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Ok, now I have version 0.16.71.1.  Right. Fine.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
But the GAC still has 0.16.0.0 and my app still is broked.  Lord - give me strength!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I re-added the project assembly reference to my local non gac copy and set copy local&#xD;
and now it all works again.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I can’t delete the old version from the GAC without uninstalling the SDK completely&#xD;
so it will have to stay there.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Weird!  The Joy of CTP.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=d44c77cb-2b71-44e1-a21e-13bb2ac4b584"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EMG5epuxvz7f7poyEe2bbFpsUeQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMG5epuxvz7f7poyEe2bbFpsUeQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EMG5epuxvz7f7poyEe2bbFpsUeQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EMG5epuxvz7f7poyEe2bbFpsUeQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,d44c77cb-2b71-44e1-a21e-13bb2ac4b584.aspx</comments>
      <category>Azure</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=aafc80fc-4333-4f9a-85d2-5bb401b413ca</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,aafc80fc-4333-4f9a-85d2-5bb401b413ca.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,aafc80fc-4333-4f9a-85d2-5bb401b413ca.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=aafc80fc-4333-4f9a-85d2-5bb401b413ca</wfw:commentRss>
      
      <title>What is Azure &amp;ndash; best explanation I&amp;rsquo;ve seen</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,aafc80fc-4333-4f9a-85d2-5bb401b413ca.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/21/WhatIsAzureNdashBestExplanationIrsquoveSeen.aspx</link>
      <pubDate>Tue, 21 Jul 2009 23:27:25 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Checkout this cool video if you want a 4 minute elevator pitch (ok, so a slow elevator).&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a title="http://blog.smarx.com/posts/what-is-windows-azure-a-hand-drawn-video" href="http://blog.smarx.com/posts/what-is-windows-azure-a-hand-drawn-video"&gt;http://blog.smarx.com/posts/what-is-windows-azure-a-hand-drawn-video&lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=aafc80fc-4333-4f9a-85d2-5bb401b413ca"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/xtTnkPg1GIEZB01ZmSjmOwU4OvY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtTnkPg1GIEZB01ZmSjmOwU4OvY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/xtTnkPg1GIEZB01ZmSjmOwU4OvY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/xtTnkPg1GIEZB01ZmSjmOwU4OvY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,aafc80fc-4333-4f9a-85d2-5bb401b413ca.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=a321ca0a-e86e-4af1-94fe-0f92c4d9616a</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,a321ca0a-e86e-4af1-94fe-0f92c4d9616a.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,a321ca0a-e86e-4af1-94fe-0f92c4d9616a.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=a321ca0a-e86e-4af1-94fe-0f92c4d9616a</wfw:commentRss>
      
      <title>Azure .Net Service Bus &amp;amp; TCP</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,a321ca0a-e86e-4af1-94fe-0f92c4d9616a.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/21/AzureNetServiceBusAmpTCP.aspx</link>
      <pubDate>Tue, 21 Jul 2009 21:42:56 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
We recently implemented the .Net Service bus to expose some in-house WCF services&#xD;
to the world wide world. It may be useful for me and others if I describe how to do&#xD;
this :) This setup allows you to switch between tcp and http relay binding with configuration.&#xD;
&lt;/p&gt;&#xD;
        &lt;h4&gt;The Host&#xD;
&lt;/h4&gt;&#xD;
        &lt;p&gt;&#xD;
For the in-house systems you need to create a host – you cant use IIS as the service&#xD;
bus requires a connection to be initiated by both ends of the communication. &#xD;
We created a Windows Service application that also runs as a console app.  This&#xD;
is much simpler when developing and debugging.  To create this service:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
1) create a new windows service using the standard VS template and add a reference&#xD;
to Microsoft.ServiceBus (in addition to your service and data contracts which I hope&#xD;
are in separate assemblies!)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
2) change the Application Output Type to Console Applications.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
3) add some code to Program.cs to flick to console mode:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;if (args.Length &amp;gt; 0 &amp;amp;&amp;amp; args[0].ToLower() == "/console")&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  myService.RunConsole(args);&lt;br&gt;&#xD;
}&lt;br&gt;&#xD;
else&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  ServiceBase.Run(ServicesToRun); &#xD;
&lt;br&gt;&#xD;
}&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
4) in your service code add the following method:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;internal void RunConsole(string[] args)&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  OnStart(args);&lt;br&gt;&#xD;
  Console.WriteLine("My ServiceHost is running... Press Enter to stop the service");&lt;br&gt;&#xD;
  Console.ReadLine();&lt;br&gt;&#xD;
  OnStop();&lt;br&gt;&#xD;
}&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
Now for the service bus stuff.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
5) in the service class, add a member for the service host:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
ServiceHost _host = null;&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
6) in the OnStart method of your service add the following :&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;// create a behavior for the service bus – it need creds&#xD;
of some type&lt;br&gt;&#xD;
TransportClientEndpointBehavior behavior = new TransportClientEndpointBehavior();&lt;br&gt;&#xD;
behavior.CredentialType = TransportClientCredentialType.UserNamePassword;&lt;br&gt;&#xD;
behavior.Credentials.UserName.UserName = Properties.Settings.Default.ServiceBusSolutionName;&lt;br&gt;&#xD;
behavior.Credentials.UserName.Password = Properties.Settings.Default.ServiceBusPassword;&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;// create an address for the service bus.  config allows&#xD;
a switch between tcp and http&lt;br&gt;&#xD;
Uri address;&lt;br&gt;&lt;br&gt;&#xD;
if(Properties.Settings.Default.ServiceBusBinding == "nettcp") &#xD;
&lt;br&gt;&#xD;
{&lt;/font&gt;&#xD;
            &lt;font face="Courier New"&gt;&#xD;
              &lt;br&gt;&#xD;
  address = ServiceBusEnvironment.CreateServiceUri("sb", Properties.Settings.Default.ServiceBusSolutionName,&#xD;
Properties.Settings.Default.ServiceBusServiceName); &#xD;
&lt;br&gt;&#xD;
}&lt;br&gt;&#xD;
else &#xD;
&lt;br&gt;&#xD;
  if(Properties.Settings.Default.ServiceBusBinding == "basichttp")&lt;br&gt;&#xD;
  {&lt;br&gt;&#xD;
    address = ServiceBusEnvironment.CreateServiceUri("http", Properties.Settings.Default.ServiceBusSolutionName,&#xD;
Properties.Settings.Default.ServiceBusServiceName);&lt;br&gt;&#xD;
  }&lt;br&gt;&#xD;
  else&lt;br&gt;&#xD;
    throw new ArgumentException("Invalid binding for Service Bus");&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;// create the host&lt;br&gt;&#xD;
_host = new ServiceHost(typeof(MyService), address);&lt;br&gt;&lt;br&gt;&#xD;
// update all the end points with the new behavior – you may need more than one –&#xD;
or not – up to you&lt;br&gt;&#xD;
foreach (ServiceEndpoint endpoint in _host.Description.Endpoints)&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
    endpoint.Behaviors.Add(behavior);&lt;br&gt;&#xD;
}&lt;br&gt;&lt;br&gt;&#xD;
// open the portal to another dimension – a dimension of sight and sound&lt;br&gt;&#xD;
_host.Open();&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
Now for some config.  For me this was the hardest part.  Hard coding WCF&#xD;
config is much simpler!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
7) create some service model bindings for netTcpRelayBinding &amp;amp; basicHttpRelayBinding&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;&amp;lt;bindings&amp;gt;&lt;br&gt;&#xD;
  &amp;lt;netTcpRelayBinding&amp;gt;&lt;br&gt;&#xD;
    &amp;lt;binding name="default" /&amp;gt;&lt;br&gt;&#xD;
  &amp;lt;/netTcpRelayBinding&amp;gt;&lt;br&gt;&#xD;
  &amp;lt;basicHttpRelayBinding&amp;gt;&lt;br&gt;&#xD;
    &amp;lt;binding name="default"&amp;gt;&lt;br&gt;&#xD;
      &amp;lt;security mode="None" /&amp;gt;&lt;br&gt;&#xD;
    &amp;lt;/binding&amp;gt;&lt;br&gt;&#xD;
  &amp;lt;/basicHttpRelayBinding&amp;gt;&lt;br&gt;&#xD;
&amp;lt;/bindings&amp;gt;&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
8) add an endpoint for your service:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;&amp;lt;endpoint name="MyServiceEndpoint"&lt;br&gt;&#xD;
          address=""&lt;br&gt;&#xD;
          binding="netTcpRelayBinding"&lt;br&gt;&#xD;
          contract="MyApp.ServiceContracts.IMyService"&lt;br&gt;&#xD;
          bindingConfiguration="default"&#xD;
/&amp;gt;&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
9) if you want to use  basic http then add this instead:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font face="Courier New"&gt;&amp;lt;endpoint name="MyServiceEndpoint"&lt;br&gt;&#xD;
               &#xD;
address=&lt;/font&gt;&#xD;
            &lt;a href="http://mysolution.servicebus.windows.net/MyService"&gt;&#xD;
              &lt;font face="Courier New"&gt;http://mysolution.servicebus.windows.net/MyService&lt;/font&gt;&#xD;
            &lt;/a&gt;&#xD;
            &lt;br&gt;&#xD;
            &lt;font face="Courier New"&gt;               &#xD;
binding="basicHttpRelayBinding"&lt;br&gt;&#xD;
               &#xD;
contract="MyApp.ServiceContracts.IMyService"&lt;br&gt;&#xD;
               &#xD;
bindingConfiguration="default" /&amp;gt;&lt;/font&gt;&#xD;
            &lt;br&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
And that’s about it for the service host.  If you need to have metadata support&#xD;
(WSDL) then that’s a whole other story that I will try to blog about seperately.&#xD;
&lt;/p&gt;&#xD;
        &lt;h4&gt;The Client&#xD;
&lt;/h4&gt;&#xD;
        &lt;p&gt;&#xD;
Azure worker roles do not have a web or app .config you can use for WCF configuration&#xD;
settings.  Web roles do have a web.config but this can only be changed by a redeploy&#xD;
of package so it’s not the best idea to put anything but service configuration in&#xD;
there.  In my case, I needed to access the in-house services from both the web&#xD;
and worker roles so I created a class lib project with a single helper class.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
1) create a Windows Class Library and add references for Microsoft.ServiceBus plus&#xD;
your service and data contracts.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
2) Create a static class with a single static method – call it what you like but something&#xD;
like GetClientChannel() will do.  Add the following code:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
IMyChannel channel;  // this is a simple combo interface of IChannel and IMyService&lt;br&gt;&lt;br&gt;&#xD;
Uri address; &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;br&gt;&#xD;
// create the behavior for SB creds&lt;br&gt;&#xD;
TransportClientEndpointBehavior behavior = new TransportClientEndpointBehavior();&lt;br&gt;&#xD;
behavior.CredentialType = TransportClientCredentialType.UserNamePassword;&lt;br&gt;&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
// get the creds from the cloud config&lt;br&gt;&#xD;
behavior.Credentials.UserName.UserName = RoleManager.GetConfigurationSetting("ServiceBusSolutionName");&lt;br&gt;&#xD;
behavior.Credentials.UserName.Password = RoleManager.GetConfigurationSetting("ServiceBusPassword"); &#xD;
&lt;br&gt;&lt;br&gt;&#xD;
// create a channel factory &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
ChannelFactory&amp;lt;IMyChannel&amp;gt; channelFactory = new ChannelFactory&amp;lt;IMyChannel&amp;gt;(); &#xD;
&lt;br&gt;&lt;br&gt;&#xD;
// create the binding – config allows us to select http or tcp &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
if (RoleManager.GetConfigurationSetting("ServiceBusBinding").ToLower() == "basichttp")&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  channelFactory.Endpoint.Binding = new BasicHttpRelayBinding(EndToEndBasicHttpSecurityMode.None,&#xD;
RelayClientAuthenticationType.None);&lt;br&gt;&#xD;
  address = ServiceBusEnvironment.CreateServiceUri("http", RoleManager.GetConfigurationSetting("ServiceBusSolutionName"),&#xD;
RoleManager.GetConfigurationSetting("ServiceBusServiceName"));&lt;br&gt;&#xD;
}&lt;br&gt;&#xD;
else if (RoleManager.GetConfigurationSetting("ServiceBusBinding").ToLower() == "nettcp")&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  channelFactory.Endpoint.Binding = new NetTcpRelayBinding(EndToEndSecurityMode.Transport,&#xD;
RelayClientAuthenticationType.None);&lt;br&gt;&#xD;
  address = ServiceBusEnvironment.CreateServiceUri("sb", RoleManager.GetConfigurationSetting("ServiceBusSolutionName"),&#xD;
RoleManager.GetConfigurationSetting("ServiceBusServiceName"));&lt;br&gt;&#xD;
}&lt;br&gt;&#xD;
else&lt;br&gt;&#xD;
{&lt;br&gt;&#xD;
  throw new ArgumentException("Invalid service bus binding configuration option:&#xD;
" + RoleManager.GetConfigurationSetting("ServiceBusBinding"));&lt;br&gt;&#xD;
} &#xD;
&lt;br&gt;&lt;br&gt;&#xD;
// update the factory for A B &amp;amp; C &#xD;
&lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
channelFactory.Endpoint.Address = new EndpointAddress(address);&lt;br&gt;&#xD;
channelFactory.Endpoint.Behaviors.Add(behavior); &#xD;
&lt;/p&gt;&#xD;
channelFactory.Endpoint.Contract.ContractType = typeof(ICRMChannel);&lt;br&gt;&lt;p&gt;&#xD;
channel = channelFactory.CreateChannel(new EndpointAddress(address));&lt;br&gt;&#xD;
channel.Open(); &#xD;
&lt;/p&gt;&lt;p&gt;&#xD;
return channel;&#xD;
&lt;/p&gt;&lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
  &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Tada!  All done.  Provided I haven’t introduced any bugs then this should&#xD;
give you a connection to you in-house services, by passing any firewall crap that&#xD;
those pesky IT people seem to insist on.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Enjoy :)&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=a321ca0a-e86e-4af1-94fe-0f92c4d9616a"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7J3cbHw4uHc6tuEOPw8CWMc1L_Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7J3cbHw4uHc6tuEOPw8CWMc1L_Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7J3cbHw4uHc6tuEOPw8CWMc1L_Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7J3cbHw4uHc6tuEOPw8CWMc1L_Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,a321ca0a-e86e-4af1-94fe-0f92c4d9616a.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=08ab31a0-7548-4d11-8255-94ed4c36247e</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,08ab31a0-7548-4d11-8255-94ed4c36247e.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,08ab31a0-7548-4d11-8255-94ed4c36247e.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=08ab31a0-7548-4d11-8255-94ed4c36247e</wfw:commentRss>
      
      <title>A Twit for One Week</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,08ab31a0-7548-4d11-8255-94ed4c36247e.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/17/ATwitForOneWeek.aspx</link>
      <pubDate>Fri, 17 Jul 2009 03:42:30 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
So far, so good. Twitter has not taken over my life.  I’ve tweeted and chirped&#xD;
a little this week and have found a few colleagues to follow and vice versa. It’s&#xD;
also been a little useful and has helped me solve a couple of problems quicker than&#xD;
the usual methods (forums and web searches).&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
It’s interesting to see Twitter going main stream.  When one of our sales guys&#xD;
asked which twitter client to use I thought ‘oh well, twitter is surely dead now!’&#xD;
but then I read that CRM 5 will have a Twitter interface and I’m guessing (truly –&#xD;
no insider info anymore) we will see similar functionality in Office 2010. Google&#xD;
Wave has this too.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I’m not tempted to create the next killer twitter client yet.  Tweetdeck works&#xD;
well enough for me at this stage but I can see that I will soon run out of screen&#xD;
real estate.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Best thing about twitter?  It’s go me blogging again :)&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=08ab31a0-7548-4d11-8255-94ed4c36247e"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bZEYNR0eix0N71UnMQn1KpGFFQs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bZEYNR0eix0N71UnMQn1KpGFFQs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bZEYNR0eix0N71UnMQn1KpGFFQs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bZEYNR0eix0N71UnMQn1KpGFFQs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,08ab31a0-7548-4d11-8255-94ed4c36247e.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=3e997791-403e-439c-aeda-22c78896fe10</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,3e997791-403e-439c-aeda-22c78896fe10.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,3e997791-403e-439c-aeda-22c78896fe10.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=3e997791-403e-439c-aeda-22c78896fe10</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>PowerShell Love &amp;ndash; Converting a comma delimited string to an array</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,3e997791-403e-439c-aeda-22c78896fe10.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/16/PowerShellLoveNdashConvertingACommaDelimitedStringToAnArray.aspx</link>
      <pubDate>Thu, 16 Jul 2009 23:33:27 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
PowerShell takes a while to learn – especially if you have an aversion to manuals&#xD;
as I do – I prefer to learn on the fly.  So, when I wanted to convert a variable&#xD;
containing a comma delimited string into an array I was lost.  After a bit of&#xD;
playing and ‘binging’  I found that it was actually very very easy:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
# start with a string &#xD;
&lt;br&gt;&#xD;
$roles = "db_owner"&lt;br&gt;&lt;br&gt;&#xD;
# now it’s an array of 1 element&lt;br&gt;&#xD;
$roles = ,$roles&#xD;
&lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
Sweet!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=3e997791-403e-439c-aeda-22c78896fe10"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oW7KeycSnjiOnqWGdOVuvXASM1Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oW7KeycSnjiOnqWGdOVuvXASM1Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oW7KeycSnjiOnqWGdOVuvXASM1Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oW7KeycSnjiOnqWGdOVuvXASM1Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,3e997791-403e-439c-aeda-22c78896fe10.aspx</comments>
      <category>General</category>
      <category>PowerShell</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=026a8ac8-96af-49da-9505-1d4f21c0c3da</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,026a8ac8-96af-49da-9505-1d4f21c0c3da.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,026a8ac8-96af-49da-9505-1d4f21c0c3da.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=026a8ac8-96af-49da-9505-1d4f21c0c3da</wfw:commentRss>
      
      <title>PowerShell &amp;ndash; Run a command and wait</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,026a8ac8-96af-49da-9505-1d4f21c0c3da.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/14/PowerShellNdashRunACommandAndWait.aspx</link>
      <pubDate>Tue, 14 Jul 2009 22:39:11 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I searched for a while to find an easy way to run a command from a PowerShell script&#xD;
and wait for it to finish.  Most of the example I found use Invoke-Expression&#xD;
but this wont wait.  In the end I resorted to the tried and true .Net Fx:&#xD;
&lt;/p&gt;&#xD;
        &lt;blockquote&gt;&#xD;
          &lt;p&gt;&#xD;
# run a command line and wait for it to be done    &#xD;
&lt;br&gt;&#xD;
function RunAndWait([string] $command, [string] $arguments) &#xD;
&lt;br&gt;&#xD;
    {&lt;br&gt;&#xD;
    $proc = New-Object     System.Diagnostics.Process&lt;br&gt;&#xD;
    $proc.StartInfo.FileName = $command&lt;br&gt;&#xD;
    $proc.StartInfo.Arguments = $arguments&lt;br&gt;&#xD;
    $proc.Start()&lt;br&gt;&#xD;
    $proc.WaitForExit()&lt;br&gt;&#xD;
    }&#xD;
&lt;/p&gt;&#xD;
        &lt;/blockquote&gt;&#xD;
        &lt;p&gt;&#xD;
You need to seperate the command (aka FileName) from any arguments, but otherwise&#xD;
this seems to work nicely. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
However, PowerGui doesn’t always wait when you are debugging so be careful if you&#xD;
are stepping through your script and expect it to stop in logical places.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=026a8ac8-96af-49da-9505-1d4f21c0c3da"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Hg3nXTRQVNNZduS4W73hh1SNJbs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hg3nXTRQVNNZduS4W73hh1SNJbs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Hg3nXTRQVNNZduS4W73hh1SNJbs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Hg3nXTRQVNNZduS4W73hh1SNJbs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,026a8ac8-96af-49da-9505-1d4f21c0c3da.aspx</comments>
      <category>General</category>
      <category>PowerShell</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=886a1ff5-8af0-43cb-ab2d-0a6b75c09a76</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,886a1ff5-8af0-43cb-ab2d-0a6b75c09a76.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,886a1ff5-8af0-43cb-ab2d-0a6b75c09a76.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=886a1ff5-8af0-43cb-ab2d-0a6b75c09a76</wfw:commentRss>
      
      <title>Installing .Net Service Bus on 2003 or XP</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,886a1ff5-8af0-43cb-ab2d-0a6b75c09a76.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/08/InstallingNetServiceBusOn2003OrXP.aspx</link>
      <pubDate>Wed, 08 Jul 2009 20:49:59 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
The July CTP of the .Net Services SDK only support 2008, Vista or Windows 7. &#xD;
This is true of the previous CTP’s but it was not enforced until the latest release. &#xD;
Luckily for me there is a simple workaround.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
On a machine that does have the July CTP installed, take a look in C:\Program Files\Microsoft&#xD;
.NET Services SDK (July 2009 CTP)\Assemblies.  There is a tool in here called&#xD;
RelayConfigurationInstaller.exe.  Copy this and the Microsoft.ServiceBus.dll&#xD;
to your target machine and run the exe with /i.  Then copy the DLL to the GAC&#xD;
and your done.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
It appears as though RelayConfigurationInstaller simply adds the required machine.config&#xD;
settings on the target machine.  You could also do this manually if required.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Of course, this is not officially supported but MSFT are listening.  If you really&#xD;
need legacy OS support for this then post a message to the &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/netservices/thread/0c5d1db9-29b9-4b60-801f-8fc5f1158e48/" target="_blank"&gt;forums&lt;/a&gt; and&#xD;
ask for it before it’s too late.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Full Credit to Clemens Vasters for this tip.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=886a1ff5-8af0-43cb-ab2d-0a6b75c09a76"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pXOOOxfKx_vDp6sGRFc_smeWEC0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pXOOOxfKx_vDp6sGRFc_smeWEC0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pXOOOxfKx_vDp6sGRFc_smeWEC0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pXOOOxfKx_vDp6sGRFc_smeWEC0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,886a1ff5-8af0-43cb-ab2d-0a6b75c09a76.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>I&amp;rsquo;ve given in and started to tweet</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93.aspx</guid>
      <link>http://jonesie.net.nz/2009/07/08/IrsquoveGivenInAndStartedToTweet.aspx</link>
      <pubDate>Wed, 08 Jul 2009 04:39:01 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Having a blog is like having a nagging wife – not blogging makes me feel guilty. &#xD;
The thing is, I just don’t have the time to to write the type of blog posts I like&#xD;
to write – long and accurate.  Not that I’m ever very accurate, but well …&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Anyways, I’ve been ranting about how stupid twitter is and what a complete time waster&#xD;
it is without actually trying it.  Then it occurred to me that twitter might&#xD;
actually be a useful alternative to long exhaustive blog posts.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So, I’ve signed up again and am tweeting a little about very development focused things. &#xD;
You wont catch me tweeting about the weather or Michael Jackson etc.  Currently&#xD;
I’m into Azure dev so I’m finding lots of little things to chirp about.  I haven’t&#xD;
found a lot of tweets to follow yet apart from the obvious candidates – scottgu etc&#xD;
– but I did get my first reply today when I sent a message to a Microsoft tweet. &#xD;
Very sweet!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Follow me if you love me :)  jonesienz&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/T7C7l7DtWaBcyLU8WzYut4wFBxU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T7C7l7DtWaBcyLU8WzYut4wFBxU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/T7C7l7DtWaBcyLU8WzYut4wFBxU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/T7C7l7DtWaBcyLU8WzYut4wFBxU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,5e8e12d5-4d4d-4e4a-80ba-1b3ea396ff93.aspx</comments>
      <category>Azure</category>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=babbba20-0f78-4b0f-841f-e558920574e3</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,babbba20-0f78-4b0f-841f-e558920574e3.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,babbba20-0f78-4b0f-841f-e558920574e3.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=babbba20-0f78-4b0f-841f-e558920574e3</wfw:commentRss>
      <title>Azure .Net Service Bus &amp;amp; Required permissions cannot be acquired</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,babbba20-0f78-4b0f-841f-e558920574e3.aspx</guid>
      <link>http://jonesie.net.nz/2009/06/15/AzureNetServiceBusAmpRequiredPermissionsCannotBeAcquired.aspx</link>
      <pubDate>Mon, 15 Jun 2009 22:46:01 GMT</pubDate>
      <description>&lt;p&gt;
I’ve been doing quite a bit of fun work with Azure lately – and it’s great! – mostly
:)&amp;nbsp; It’s early days yet and there are a couple of (hundred?) things to sort out
before they go live I guess.&amp;nbsp; The main problem with anything new like this is
the lack of documentation and real world expertise when you strike a problem.&amp;nbsp;
So, I thought I should blog solutions to the problems we have struck lately.&amp;nbsp;
Here’s a little one.
&lt;/p&gt;
&lt;p&gt;
The .Net Service Bus allows you to expose in-house systems to the wide wide web without
all that pesky firewall configuration.&amp;nbsp; Essentially, it sites between the client
and server and routes (WCF) messages.&amp;nbsp; You can read all about it &lt;a href="http://msdn.microsoft.com/en-nz/azure/netservices(en-us).aspx" target="_blank"&gt;here&lt;/a&gt;.&amp;nbsp;&amp;nbsp;
It only took us a morning to figure out how to configure our WCF’s but we had problems
when it came time to deploy the web-role client to Azure.&amp;nbsp; 
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p style="mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" class="MsoNormal"&gt;
&lt;i&gt;&lt;span style="font-family: 'Verdana','sans-serif'; color: maroon; font-size: 14pt"&gt;Required
permissions cannot be acquired.&lt;/span&gt;&lt;/i&gt;&lt;span style="font-family: 'Verdana','sans-serif'; color: maroon; font-size: 14pt"&gt;&lt;?xml:namespace prefix = o /&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;b&gt;&lt;span style="font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: calibri; mso-ansi-language: en-nz; mso-fareast-language: en-nz; mso-bidi-language: ar-sa"&gt;Description: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black; font-size: 8.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-nz; mso-fareast-language: en-nz; mso-bidi-language: ar-sa"&gt;An
unhandled exception occurred during the execution of the current web request. Please
review the stack trace for more information about the error and where it originated
in the code. 
&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;b&gt;&lt;span style="font-family: 'Verdana','sans-serif'; color: black; font-size: 8.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: calibri; mso-ansi-language: en-nz; mso-fareast-language: en-nz; mso-bidi-language: ar-sa"&gt;Exception
Details: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-family: 'Arial','sans-serif'; color: black; font-size: 8.5pt; mso-fareast-font-family: calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: en-nz; mso-fareast-language: en-nz; mso-bidi-language: ar-sa"&gt;System.Security.Policy.PolicyException:
Required permissions cannot be acquired.&lt;br style="mso-special-character: line-break"&gt;
&lt;br style="mso-special-character: line-break"&gt;
&lt;/blockquote&gt;&gt; 
&lt;p&gt;
So, after some research, the solution was very simple.&amp;nbsp; You just need to allow
full trust for the web role which is achieved by setting the web role’s enableNativeCodeExecution
to true in the ServiceDefinition.csdef file.&amp;nbsp; &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/netservices/thread/7bf74134-673e-4139-8c0c-5dab7a726bc7" target="_blank"&gt;See
here for the full story&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
More on Azure soon…
&lt;/p&gt;
&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=babbba20-0f78-4b0f-841f-e558920574e3" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/HF4kvCGIPmZx-4mwitWyaY0D7cc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HF4kvCGIPmZx-4mwitWyaY0D7cc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/HF4kvCGIPmZx-4mwitWyaY0D7cc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/HF4kvCGIPmZx-4mwitWyaY0D7cc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,babbba20-0f78-4b0f-841f-e558920574e3.aspx</comments>
      <category>Azure</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284</wfw:commentRss>
      
      <title>MSDN On Speed</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284.aspx</guid>
      <link>http://jonesie.net.nz/2009/04/13/MSDNOnSpeed.aspx</link>
      <pubDate>Mon, 13 Apr 2009 22:08:41 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
MSDN are testing a new version of the Library pages that are designed for low bandwidth&#xD;
connections.  If you browse to any library page you will see a link under the&#xD;
breadcrumb, e.g:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://jonesie.net.nz/content/binary/loband.jpg" border="0"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This will display a vastly stripped down version of the usual pages.  &lt;img height="377" src="http://jonesie.net.nz/content/binary/azureloband.jpg" width="606" border="0"&gt;&lt;/img&gt;&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
You will be returned to normal mode if you navigate to any other library page or use&#xD;
the persist option at the top right of the page.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The speed of MSDN in this mode is great.  The only thing I miss is search.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Enjoy!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/6JiGMud8PxCOlnTQ4dbbOd_onsI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6JiGMud8PxCOlnTQ4dbbOd_onsI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/6JiGMud8PxCOlnTQ4dbbOd_onsI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/6JiGMud8PxCOlnTQ4dbbOd_onsI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,cfb47c92-1d1c-4b1a-a6ba-cdaf51d3d284.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=d170ee28-5f62-46f0-9d07-87acfa140a0a</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,d170ee28-5f62-46f0-9d07-87acfa140a0a.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,d170ee28-5f62-46f0-9d07-87acfa140a0a.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=d170ee28-5f62-46f0-9d07-87acfa140a0a</wfw:commentRss>
      
      <title>My Name in Lights</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,d170ee28-5f62-46f0-9d07-87acfa140a0a.aspx</guid>
      <link>http://jonesie.net.nz/2009/04/04/MyNameInLights.aspx</link>
      <pubDate>Sat, 04 Apr 2009 19:49:09 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Recently I wrote an &lt;a href="http://devshaped.com/2009/03/banking-with-xml/"&gt;article&lt;/a&gt; for &lt;a href="http://devshaped.com"&gt;http://devshaped.com&lt;/a&gt;. &#xD;
This was a lot of fun. So much so that I want to do more!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=d170ee28-5f62-46f0-9d07-87acfa140a0a"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gkdduv_jdOvC1Aw2mPlhbPFHP4Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gkdduv_jdOvC1Aw2mPlhbPFHP4Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gkdduv_jdOvC1Aw2mPlhbPFHP4Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gkdduv_jdOvC1Aw2mPlhbPFHP4Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,d170ee28-5f62-46f0-9d07-87acfa140a0a.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=6c1fa9ba-3599-48c2-baa7-8e434c4b23bf</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,6c1fa9ba-3599-48c2-baa7-8e434c4b23bf.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,6c1fa9ba-3599-48c2-baa7-8e434c4b23bf.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=6c1fa9ba-3599-48c2-baa7-8e434c4b23bf</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>Visual Studio 2010 Drops WIX :(</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,6c1fa9ba-3599-48c2-baa7-8e434c4b23bf.aspx</guid>
      <link>http://jonesie.net.nz/2009/04/02/VisualStudio2010DropsWIX.aspx</link>
      <pubDate>Thu, 02 Apr 2009 19:56:27 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;I haven't used &lt;a href="http://wix.sourceforge.ne"&gt;WIX &lt;/a&gt;a&#xD;
lot so I'm no expert, but I do know that is way better packaging solution than anything&#xD;
else that ships with Visual Studio currently.  Version 3 of WIX had progressed&#xD;
to the point that MS were helping to have it included in the VS 2010 out of the box. &#xD;
Which is slightly ironic if you know the history of WIX.&lt;br&gt;&lt;br&gt;&#xD;
However, it appears than plans and people have changed and WIX will NOT ship with&#xD;
VS2010.&lt;br&gt;&lt;br&gt;&#xD;
This is very sad for us poor developers who are left with little out of box choices&#xD;
for solution packaging.  Sure you will still be able to get WIX yourself but&#xD;
many shops don't like to let developers help themselves to open source tools and are&#xD;
even meaner when it comes to paying for tools.  Inclusion of WIX with the VS2010&#xD;
release would have moved WIX to the mainstream and finally put a nail in the coffin&#xD;
of VDPROJ packages.&lt;br&gt;&lt;br&gt;&#xD;
For the full story, &lt;a href="http://robmensching.com/blog/posts/2009/4/1/Visual-Studio-will-not-ship-the-WiX-toolset-contributes-only"&gt;read&#xD;
here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&#xD;
If you think this is a mistake then it may not be too late.  Microsoft always&#xD;
listen to customers.  If enough of us talk about this and express opinions then&#xD;
they may change their mind or at least offer WIX as a Power Tools or some such thing.&lt;br&gt;&lt;br&gt;&#xD;
If you would like to have your say then either blog about this yourself or send an&#xD;
email to Soma (VP of Developer Division) via his blog: &lt;a href="http://blogs.msdn.com/somasegar/contact.aspx"&gt;http://blogs.msdn.com/somasegar/contact.aspx&lt;/a&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=6c1fa9ba-3599-48c2-baa7-8e434c4b23bf"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/a6Ngep5M5o5kSBx6eVLGfZKkjZE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/a6Ngep5M5o5kSBx6eVLGfZKkjZE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/a6Ngep5M5o5kSBx6eVLGfZKkjZE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/a6Ngep5M5o5kSBx6eVLGfZKkjZE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,6c1fa9ba-3599-48c2-baa7-8e434c4b23bf.aspx</comments>
      <category>General</category>
      <category>Visual Studio</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=ef7c83d5-3ccf-4a53-a137-5192e812807b</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,ef7c83d5-3ccf-4a53-a137-5192e812807b.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,ef7c83d5-3ccf-4a53-a137-5192e812807b.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=ef7c83d5-3ccf-4a53-a137-5192e812807b</wfw:commentRss>
      
      <title>Bye Bye MVP</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,ef7c83d5-3ccf-4a53-a137-5192e812807b.aspx</guid>
      <link>http://jonesie.net.nz/2009/03/27/ByeByeMVP.aspx</link>
      <pubDate>Fri, 27 Mar 2009 18:30:51 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;It's been a fantastic time being an MVP&#xD;
for the last 6 years.  I've really enjoyed being involved in the community and&#xD;
doing what I can to spread the good work that Microsoft do.  However, all good&#xD;
things come to an end.  I've had a year off presenting and organising to concentrate&#xD;
on personal projects so have not been re-awarded this year.&lt;br&gt;&lt;br&gt;&#xD;
I'm going to miss the comradeship of the fellow MVP's and the occasional 'secret'&#xD;
that we got to hear. No doubt I will lose my sanity again before too long and get&#xD;
involved in some community activities.  I'll be back :)&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=ef7c83d5-3ccf-4a53-a137-5192e812807b"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BZ6edFQ47me5dZfyQuSLxPfoKsk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BZ6edFQ47me5dZfyQuSLxPfoKsk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BZ6edFQ47me5dZfyQuSLxPfoKsk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BZ6edFQ47me5dZfyQuSLxPfoKsk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,ef7c83d5-3ccf-4a53-a137-5192e812807b.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=d43139fa-d790-4af0-a7d2-a825565fe72e</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,d43139fa-d790-4af0-a7d2-a825565fe72e.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,d43139fa-d790-4af0-a7d2-a825565fe72e.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=d43139fa-d790-4af0-a7d2-a825565fe72e</wfw:commentRss>
      <slash:comments>2</slash:comments>
      
      <title>Recession Conspiracy Theory</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,d43139fa-d790-4af0-a7d2-a825565fe72e.aspx</guid>
      <link>http://jonesie.net.nz/2009/03/27/RecessionConspiracyTheory.aspx</link>
      <pubDate>Fri, 27 Mar 2009 18:22:31 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;Here's my grand conspiracy theory. &#xD;
It's 2007 and you realise that your puppet Bush &amp;amp; co is not going to be in office&#xD;
forever and that wars eventually end.  Your next pet President is a has-been&#xD;
who is unlikley to get power.  Your oil producing, weapons manufacturing empire&#xD;
is under threat.  What do you do?  &#xD;
&lt;br&gt;&lt;br&gt;&#xD;
Well, how about an old fashioned recession?  Its worked in the past, right? &#xD;
You can make a few quick billion on the stock market and use that to invest in the&#xD;
bargains that will follow the crash.  Rattle a few cages and the price of oil&#xD;
will go up.  Make sure your President pardons a few friends and free's up some&#xD;
land for development before he goes.  Then make a bit of a mess for the next&#xD;
do-gooder President to keep him busy enough so that he leaves you alone for a while.&lt;br&gt;&lt;br&gt;&#xD;
Hey, this would make a great board game!  Call it Global Domination or Get Richer&#xD;
Quicker.  It could work like Monopoly, except you would start with 400 hotels&#xD;
and $12 Billion.  The idea would be to steal as much money off the other players&#xD;
as you can by manipulating politicians and the media, buying up the hotels and killing&#xD;
off the employees.&lt;br&gt;&lt;br&gt;&#xD;
It's very hard not to be cynical but I believe that the current global financial crisis&#xD;
has largely bypassed New Zealand - or it may just be that the IT industry is more&#xD;
sheltered from it than other industries.&lt;br&gt;&lt;br&gt;&#xD;
I have plenty of work. I'm not worried about being laid-off any time soon.  My&#xD;
employer is doing pretty well this year.  Other IT companies I know have plenty&#xD;
of work.  There are still lots of jobs available in IT.  Basically, everything&#xD;
is pretty much the same as it always is.&lt;br&gt;&lt;br&gt;&#xD;
The main difference I can see is that people are slower at paying bills and the news&#xD;
media are constantly reminding us of the doom and gloom.&lt;br&gt;&lt;br&gt;&#xD;
Recessions are great for some people.  There is a lot of money to be made for&#xD;
those that are prepared and there is no better way to be ready for a recession than&#xD;
to start one yourself!  I have no doubt that this has been created for the benefit&#xD;
of a few individuals and companies.  Fortunately, New Zealand is small enough&#xD;
to be ignored most of the time.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=d43139fa-d790-4af0-a7d2-a825565fe72e"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mid7cnfXPBk1l_AgZg7krzX5rUM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mid7cnfXPBk1l_AgZg7krzX5rUM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mid7cnfXPBk1l_AgZg7krzX5rUM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mid7cnfXPBk1l_AgZg7krzX5rUM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,d43139fa-d790-4af0-a7d2-a825565fe72e.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=ee4568a9-5649-4f02-9577-e4e11197ae9a</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,ee4568a9-5649-4f02-9577-e4e11197ae9a.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,ee4568a9-5649-4f02-9577-e4e11197ae9a.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=ee4568a9-5649-4f02-9577-e4e11197ae9a</wfw:commentRss>
      
      <title>SharePoint Themes</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,ee4568a9-5649-4f02-9577-e4e11197ae9a.aspx</guid>
      <link>http://jonesie.net.nz/2009/03/19/SharePointThemes.aspx</link>
      <pubDate>Thu, 19 Mar 2009 22:06:15 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;If you are into styling SharePoint - and&#xD;
who isn't! - then you might find these useful:  &lt;a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;amp;FamilyID=0a87658f-20b8-4dcc-ad7a-09ad22641f3a"&gt;Ten&#xD;
Themes for SharePoint is VSeWSS Projects&lt;/a&gt;.  I think there is a &lt;a href="http://www.intergen.co.nz"&gt;yellow&lt;/a&gt; one&#xD;
in there ... :)&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=ee4568a9-5649-4f02-9577-e4e11197ae9a"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/r4WXU4Mlur0n9COQURNRNayVW-0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r4WXU4Mlur0n9COQURNRNayVW-0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/r4WXU4Mlur0n9COQURNRNayVW-0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/r4WXU4Mlur0n9COQURNRNayVW-0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,ee4568a9-5649-4f02-9577-e4e11197ae9a.aspx</comments>
      <category>General</category>
      <category>Sharepoint</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=4de99aff-c2a6-477c-b75a-a42296e7af26</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,4de99aff-c2a6-477c-b75a-a42296e7af26.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,4de99aff-c2a6-477c-b75a-a42296e7af26.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=4de99aff-c2a6-477c-b75a-a42296e7af26</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>MVC Release Candidaite 1 - an issue for me</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,4de99aff-c2a6-477c-b75a-a42296e7af26.aspx</guid>
      <link>http://jonesie.net.nz/2009/02/01/MVCReleaseCandidaite1AnIssueForMe.aspx</link>
      <pubDate>Sun, 01 Feb 2009 20:42:02 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Microsoft have release ASP.Net MVC RC 1 last week - twice.  The first release&#xD;
was quickly refreshed to fix some issues so if you downloaded early last week, you&#xD;
may need to get the download again. &lt;a href="http://haacked.com/archive/2009/01/30/aspnetmvc-refresh.aspx"&gt;Check&#xD;
here&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I have had a quick attempt to upgrade my 1 project and it all worked pretty sweetly&#xD;
and the upgrade process was very SIMPLE.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
However.  Several of my crud views use FckEditor for long text fields. &#xD;
A post-pack of these views triggers page validation:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
   &lt;strong&gt;&lt;font color="#ff0000"&gt;A potentially dangerous Request.Form&#xD;
value was detected from the client&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Normally, turing off page request validation in the page and / or web.config will&#xD;
fix this :&#xD;
&lt;/p&gt;&#xD;
        &lt;font color="#0000ff"&gt;&#xD;
          &lt;p&gt;&#xD;
   &amp;lt;&#xD;
&lt;/p&gt;&#xD;
        &lt;/font&gt;&#xD;
        &lt;font color="#a31515"&gt;pages&lt;/font&gt;&#xD;
        &lt;font color="#0000ff"&gt;&#xD;
        &lt;/font&gt;&#xD;
        &lt;font color="#ff0000"&gt;validateRequest&lt;/font&gt;&#xD;
        &lt;font color="#0000ff"&gt;=&lt;/font&gt;&#xD;
        &lt;font color="#000000"&gt;"&lt;/font&gt;&#xD;
        &lt;font color="#0000ff"&gt;false&lt;/font&gt;&#xD;
        &lt;font color="#000000"&gt;"&lt;/font&gt;&#xD;
        &lt;font color="#0000ff"&gt;&amp;gt;&#xD;
&lt;/font&gt;&#xD;
        &lt;p&gt;&#xD;
but for me and others (see comments at Phil Haack link above) this does not help.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So, looks like I will be rolling back to the beta until this is resolved.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font color="#ff0000"&gt;Update: &lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;&#xD;
            &lt;font color="#ff0000"&gt;RTFB!  &lt;a href="http://haacked.com/archive/2009/02/07/take-charge-of-your-security.aspx"&gt;http://haacked.com/archive/2009/02/07/take-charge-of-your-security.aspx&lt;/a&gt;. &#xD;
I haven't tried this yet, but it is almost certainly the solution.&lt;/font&gt;&#xD;
          &lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=4de99aff-c2a6-477c-b75a-a42296e7af26"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JPpo7Mz1De9PU9EUAfxhSWI3JrI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JPpo7Mz1De9PU9EUAfxhSWI3JrI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JPpo7Mz1De9PU9EUAfxhSWI3JrI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JPpo7Mz1De9PU9EUAfxhSWI3JrI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,4de99aff-c2a6-477c-b75a-a42296e7af26.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=63d9958b-c0da-4286-b999-7986342b1a1c</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,63d9958b-c0da-4286-b999-7986342b1a1c.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,63d9958b-c0da-4286-b999-7986342b1a1c.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=63d9958b-c0da-4286-b999-7986342b1a1c</wfw:commentRss>
      
      <title>New Web Platform Installer</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,63d9958b-c0da-4286-b999-7986342b1a1c.aspx</guid>
      <link>http://jonesie.net.nz/2009/02/01/NewWebPlatformInstaller.aspx</link>
      <pubDate>Sun, 01 Feb 2009 20:12:23 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Reading Paul a post on &lt;a href="http://haacked.com/"&gt;Hacked.com&lt;/a&gt; I saw mention&#xD;
of a new thing - the Web Platform Installer. This is a nifty tool that can be used&#xD;
to install the .Net Framework, ASP.Net, Visual Web Developer, ASP.MVC, Silverlight&#xD;
tools and other bits and peices. All from one very convienient and SIMPLE interface.&#xD;
&lt;/p&gt;&#xD;
        &lt;img border="0" src="http://jonesie.net.nz/content/binary/WPI.png"&gt;&lt;/img&gt;&#xD;
        &lt;p&gt;&#xD;
Using Virtual Machines for development these days I am often setting up new machines.&#xD;
This will save me a bit of time there. It's also great for helping friends and noobs&#xD;
get started with web development and will reduce the amount of time I spend on emails&#xD;
and awkward phone calls.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Well done Microsoft!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=63d9958b-c0da-4286-b999-7986342b1a1c"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VHVI1vSQpxactWLcRcwKTzB-oRM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VHVI1vSQpxactWLcRcwKTzB-oRM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VHVI1vSQpxactWLcRcwKTzB-oRM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VHVI1vSQpxactWLcRcwKTzB-oRM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,63d9958b-c0da-4286-b999-7986342b1a1c.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=28a04c20-4fc8-404f-aa1e-00702733b3d3</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,28a04c20-4fc8-404f-aa1e-00702733b3d3.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,28a04c20-4fc8-404f-aa1e-00702733b3d3.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=28a04c20-4fc8-404f-aa1e-00702733b3d3</wfw:commentRss>
      
      <title>End of an era - so long Rod</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,28a04c20-4fc8-404f-aa1e-00702733b3d3.aspx</guid>
      <link>http://jonesie.net.nz/2009/01/18/EndOfAnEraSoLongRod.aspx</link>
      <pubDate>Sun, 18 Jan 2009 08:19:54 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
It's sad but understandable that &lt;a href="http://www.drury.net.nz/2008/07/15/don/"&gt;Rod&#xD;
has decided to through in the blogging towel&lt;/a&gt;. While I haven't been following a&#xD;
lot of bloggers lately, Rod's posts were always insightful and often inspiring and&#xD;
I always tried to keep up to date with his feed.  You will be missed Rod&#xD;
- which seems impossible now that I say it. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=28a04c20-4fc8-404f-aa1e-00702733b3d3"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0D1AUkomhesy8WUDGICGatXtrvI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0D1AUkomhesy8WUDGICGatXtrvI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0D1AUkomhesy8WUDGICGatXtrvI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0D1AUkomhesy8WUDGICGatXtrvI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,28a04c20-4fc8-404f-aa1e-00702733b3d3.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=e80d2074-6d8e-4084-8582-86b8af6e7cb8</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,e80d2074-6d8e-4084-8582-86b8af6e7cb8.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,e80d2074-6d8e-4084-8582-86b8af6e7cb8.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=e80d2074-6d8e-4084-8582-86b8af6e7cb8</wfw:commentRss>
      <slash:comments>3</slash:comments>
      
      <title>MVC DropDownList and blank options</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,e80d2074-6d8e-4084-8582-86b8af6e7cb8.aspx</guid>
      <link>http://jonesie.net.nz/2009/01/14/MVCDropDownListAndBlankOptions.aspx</link>
      <pubDate>Wed, 14 Jan 2009 20:34:24 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;I'm loving MVC.  In fact, it is my&#xD;
new love.  SharePoint is out - that was a bad relationship anyway - too sadistic.&lt;br&gt;&lt;br&gt;&#xD;
There are however, a few things in the current beta that require a workaround or two. &#xD;
Here's one.&lt;br&gt;&lt;br&gt;&#xD;
To create a dropdown list in MVC you use the HtmlHelper thus:&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;&amp;lt;%= Html.DropDownList("CityID") %&amp;gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br&gt;&#xD;
then in your controller you add the following before calling the view:&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;ViewData["CityID"] = new SelectList(from c&#xD;
in someDataContext.Cities orderby c.Name select c, &#xD;
&lt;br&gt;&#xD;
"CityID","Name", selectedCityID);&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br&gt;&#xD;
where selectedCityID is the item you want preselected in the list.  Note that&#xD;
the ViewData key and the control name all match.  And this just works. &#xD;
Easy as cake.&lt;br&gt;&lt;br&gt;&#xD;
But now, suppose you want an option at the top of the list such as "[select a city]"&#xD;
when you are adding new records.  Again, this is a peice of pie, just do this&#xD;
:&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;&amp;lt;%= Html.DropDownList("[select a city]",&#xD;
"CityID") %&amp;gt;&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br&gt;&#xD;
The dropdown list will now contain this extra option at the top of the list of city,&#xD;
and it's value will be blank.&lt;br&gt;&lt;br&gt;&#xD;
BUT..  the specified selectedvalue of selectedCityID will not be selected any&#xD;
more.  If you look a the page source generated by the HtmlHelper you will see&#xD;
that none of the options has selected=selected.&lt;br&gt;&lt;br&gt;&#xD;
I dont know if this is a bug and/or if it will be fixed by the release candidate (due&#xD;
any day) but as a workaround I have used the following jQuery code to pre-select the&#xD;
default option:&lt;br&gt;&lt;br&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;$(function() {&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt; &#xD;
$("select[@name='CityID'] option[@value='&amp;lt;%= ViewData.Model.CityID%&amp;gt;']").attr('selected',&#xD;
'selected');&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;});&lt;/font&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br&gt;&#xD;
Hope this helps someone else :)&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=e80d2074-6d8e-4084-8582-86b8af6e7cb8"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/TaQ4k0vtDrxSqfRSadLgnuAy9EA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TaQ4k0vtDrxSqfRSadLgnuAy9EA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/TaQ4k0vtDrxSqfRSadLgnuAy9EA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/TaQ4k0vtDrxSqfRSadLgnuAy9EA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,e80d2074-6d8e-4084-8582-86b8af6e7cb8.aspx</comments>
      <category>General</category>
    </item>
    <item>
      <trackback:ping>http://jonesie.net.nz/Trackback.aspx?guid=53e851a0-6f75-4916-bccd-4a640f6e52dd</trackback:ping>
      <pingback:server>http://jonesie.net.nz/pingback.aspx</pingback:server>
      <pingback:target>http://jonesie.net.nz/PermaLink,guid,53e851a0-6f75-4916-bccd-4a640f6e52dd.aspx</pingback:target>
      <dc:creator>Peter</dc:creator>
      <wfw:comment>http://jonesie.net.nz/CommentView,guid,53e851a0-6f75-4916-bccd-4a640f6e52dd.aspx</wfw:comment>
      <wfw:commentRss>http://jonesie.net.nz/SyndicationService.asmx/GetEntryCommentsRss?guid=53e851a0-6f75-4916-bccd-4a640f6e52dd</wfw:commentRss>
      
      <title>Script Tag Madness - Blank Pages</title>
      <guid isPermaLink="false">http://jonesie.net.nz/PermaLink,guid,53e851a0-6f75-4916-bccd-4a640f6e52dd.aspx</guid>
      <link>http://jonesie.net.nz/2008/12/28/ScriptTagMadnessBlankPages.aspx</link>
      <pubDate>Sun, 28 Dec 2008 03:57:44 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I've been writing a small app using the latest ASP.Net MVC Beta and JQuery - for fun&#xD;
and for work - and got caught out by a problem I'm sure Ive had before.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
When ever you have a script tag dont self close it like this:&#xD;
&lt;/p&gt;&#xD;
        &lt;font size="2"&gt;&#xD;
        &lt;/font&gt;&#xD;
        &lt;font color="#0000ff" size="2"&gt;&#xD;
          &lt;p&gt;&#xD;
            &lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&#xD;
            &lt;font color="#a31515" size="2"&gt;script&lt;/font&gt;&#xD;
            &lt;font size="2"&gt;&#xD;
            &lt;/font&gt;&#xD;
            &lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&#xD;
            &lt;font color="#0000ff" size="2"&gt;="text/javascript"&lt;/font&gt;&#xD;
            &lt;font size="2"&gt;&#xD;
            &lt;/font&gt;&#xD;
            &lt;font color="#ff0000" size="2"&gt;src&lt;/font&gt;&#xD;
            &lt;font color="#0000ff" size="2"&gt;="&lt;/font&gt;&#xD;
            &lt;font size="2"&gt;Scripts/jquery-1.2.6.min.js&lt;/font&gt;&#xD;
            &lt;font color="#0000ff" size="2"&gt;"&#xD;
/&lt;/font&gt;&#xD;
            &lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&#xD;
          &lt;/p&gt;&#xD;
          &lt;p&gt;&#xD;
          &lt;/p&gt;&#xD;
        &lt;/font&gt;For me this would stop all subsequent scripts from executing and sometimes&#xD;
result in a completly blank page.   I had the same result in Firefox and&#xD;
IE 7.  Instead, allways have a seperate end tag:&#xD;
&lt;font size="2"&gt;&lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;script&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="text/javascript"&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;src&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;="&lt;/font&gt;&lt;font size="2"&gt;Scripts/jquery-1.2.6.min.js&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;"&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;script&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;p&gt;&lt;font color="#0000ff"&gt;Happy New Year :)&lt;/font&gt;&lt;/p&gt;&lt;img width="0" height="0" src="http://jonesie.net.nz/aggbug.ashx?id=53e851a0-6f75-4916-bccd-4a640f6e52dd"&gt;&lt;/img&gt;&lt;/body&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VTqohniUWY7zNujTvFd4gB0Ayd0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VTqohniUWY7zNujTvFd4gB0Ayd0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VTqohniUWY7zNujTvFd4gB0Ayd0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VTqohniUWY7zNujTvFd4gB0Ayd0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <comments>http://jonesie.net.nz/CommentView,guid,53e851a0-6f75-4916-bccd-4a640f6e52dd.aspx</comments>
      <category>General</category>
    </item>
  </channel>
</rss>
