<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" version="2.0">
  <channel>
    <title>Paul Mrozowski's Blog - Developer Tools</title>
    <link>http://www.rcs-solutions.com/blog/</link>
    <description>A day in the life (of a developer)</description>
    <language>en-us</language>
    <copyright>Paul Mrozowski / RCS Solutions, Inc.</copyright>
    <lastBuildDate>Wed, 13 Aug 2008 02:17:44 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>paulm@rcs-solutions.com</managingEditor>
    <webMaster>paulm@rcs-solutions.com</webMaster>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=0c45f600-d3fb-4838-b823-5a88fe39fd0c</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,0c45f600-d3fb-4838-b823-5a88fe39fd0c.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,0c45f600-d3fb-4838-b823-5a88fe39fd0c.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=0c45f600-d3fb-4838-b823-5a88fe39fd0c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I ran across a really cool .NET library on a recent project I've been working on.
We have an internal website where we post news, documentation, etc. - basically a
Content Management System (CMS). We're working on a new set of documentation that
is being done inside of a third party help builder application. We need to import
the HTML files it generates into our website (so we get all the things it offers,
like security, searching, revision tracking, view statistics, etc.). So basically,
I need to run through a lot of HTML files, build a tree of the documents (similar
to the help file) and rewrite all of the URL's and image links to point to the correct
URL inside of the site. I initially started looking at various regular expressions
that I might be able to use over at <a href="http://regexlib.com/" target="_blank">http://regexlib.com/</a>.
Almost every single one of them had some comment about it failing under some circumstances.
The HTML is surprisingly clean, but I was still nervous about it. So I looked at using <a href="http://www.devincook.com/goldparser/" target="_blank">GOLD</a> to
parse the HTML. However, from some of the comments I found it still didn't make everything
as easy I would have liked. I finally ran across <a href="http://www.codeplex.com/htmlagilitypack" target="_blank">HtmlAgilityPack</a> over
on CodePlex . It's a .NET library which lets you read AND write changes to an HTML
file via a simple API. 
</p>
        <p>
Here's a chunk of code from my importer so you can get a feel for how it works: 
</p>
        <div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new">
          <p style="margin: 0px">
            <span style="color: #2b91af">HtmlDocument</span> doc = <span style="color: blue">new</span><span style="color: #2b91af">HtmlDocument</span>();
</p>
          <p style="margin: 0px">
doc.Load(content.FullDocumentPath);
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">HtmlNodeCollection</span> linkNodes = doc.DocumentNode.SelectNodes(<span style="background: #e5e5e5">"//a/@href"</span>);
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">Content</span> match = <span style="color: blue">null</span>;
</p>
          <p style="margin: 0px">
            <span style="background: #ffffbf">// Run only if there are links in the document.</span>
          </p>
          <p style="margin: 0px">
            <span style="color: blue">if</span> (linkNodes != <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
{
</p>
          <p style="margin: 0px">
    <span style="background: #ffffbf">// Fix up the URL's</span></p>
          <p style="margin: 0px">
    <span style="color: blue">foreach</span> (<span style="color: #2b91af">HtmlNode</span> linkNode <span style="color: blue">in</span> linkNodes)
</p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        <span style="color: #2b91af">HtmlAttribute</span> attrib
= linkNode.Attributes[<span style="background: #e5e5e5">"href"</span>];
</p>
          <p style="margin: 0px">
        <span style="background: #ffffbf">// If
it's an internal page anchor, ignore it</span></p>
          <p style="margin: 0px">
        <span style="color: blue">if</span> (attrib.Value.StartsWith(<span style="background: #e5e5e5">"#"</span>))
</p>
          <p style="margin: 0px">
            <span style="color: blue">continue</span>;
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">string</span> path
= <span style="color: blue">this</span>.GetAbsolutePath(content.DocumentLink, attrib.Value);
</p>
          <p style="margin: 0px">
        match = <span style="color: blue">this</span>.m_contentList.Find(p
=&gt; p.DocumentLink == path);
</p>
          <p style="margin: 0px">
 
</p>
          <p style="margin: 0px">
        <span style="color: blue">if</span> (match
!= <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
            attrib.Value =
match.GetUrl();
</p>
          <p style="margin: 0px">
        <span style="color: blue">else</span><span style="color: blue">if</span> (!path.ToLower().StartsWith(<span style="background: #e5e5e5">"http://"</span>)
&amp;&amp; !path.ToLower().StartsWith(<span style="background: #e5e5e5">"mailto:"</span>))
</p>
          <p style="margin: 0px">
            <span style="color: #2b91af">Console</span>.WriteLine(<span style="background: #e5e5e5">"Cannot
find matching document, searched for "</span> + path);                        
</p>
          <p style="margin: 0px">
    }
</p>
          <p style="margin: 0px">
}
</p>
          <p style="margin: 0px">
 
</p>
        </div>
        <p>
Basically, doc.DocumentNode.SelectNodes("//a/@href") returns a collection of links
in the document (it uses XPath syntax for the selection string). From there, I just
iterate through them, build the new URL, then save the modified Url via code that
just does: linkNode.Attributes["href"].Value = "New URL Here". I also needed to strip
out all the script tags inside of the document, so it uses similar syntax: 
</p>
        <div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new">
          <p style="margin: 0px">
            <span style="color: blue">private</span>
            <span style="color: blue">void</span> StripOutScripts(<span style="color: #2b91af">HtmlDocument</span> doc)
</p>
          <p style="margin: 0px">
{
</p>
          <p style="margin: 0px">
    <span style="background: #ffffbf">// Strip out the scripts</span></p>
          <p style="margin: 0px">
    <span style="color: #2b91af">HtmlNodeCollection</span> scriptNodes
= doc.DocumentNode.SelectNodes(<span style="background: #e5e5e5">"//script"</span>);
</p>
          <p style="margin: 0px">
    <span style="color: blue">if</span> (scriptNodes != <span style="color: blue">null</span>)
</p>
          <p style="margin: 0px">
    {
</p>
          <p style="margin: 0px">
        <span style="color: blue">foreach</span> (<span style="color: #2b91af">HtmlNode</span> scriptNode <span style="color: blue">in</span> scriptNodes)
</p>
          <p style="margin: 0px">
        {
</p>
          <p style="margin: 0px">
            scriptNode.ParentNode.RemoveChild(scriptNode, <span style="color: blue">false</span>);
</p>
          <p style="margin: 0px">
        }
</p>
          <p style="margin: 0px">
    }
</p>
          <p style="margin: 0px">
}
</p>
          <p style="margin: 0px">
 
</p>
        </div>
        <p>
I do the same sort of thing - iterate over the collection, except this time tell it
to remove the nodes from the document (note that I'm grabbing the parent node, since
the current node is everything contained within the script, excluding the &lt;script&gt;
tags. By getting the parent, we get that and the tags themselves.
</p>
        <p>
Each collection has a WriteContentTo() method which can write the HTML for that section
of the document to a Stream. What's really nice about this entire library (besides
how simple it was to use) was the fact that it doesn't seem to mangle the existing
HTML when using WriteContentTo() (at least from what I've seen). Only one minor complaint
- the docs are a bit weak. It just includes the standard documentation of the classes,
not much in the way of examples. However, it's pretty consistent so it doesn't take
much to get started with it.
</p>
        <p>
What a great library - it couldn't be simpler. It saved me a ton of time.
</p>
        <p>
          <strong>Links:</strong>
        </p>
        <p>
          <a href="http://www.codeplex.com/htmlagilitypack">http://www.codeplex.com/htmlagilitypack</a>
          <br />
          <a href="http://regexlib.com/">http://regexlib.com/</a>
          <br />
          <a href="http://www.devincook.com/goldparser/">http://www.devincook.com/goldparser/</a>
        </p>
        <img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=0c45f600-d3fb-4838-b823-5a88fe39fd0c" />
      </body>
      <title>Processing HTML Documents</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,0c45f600-d3fb-4838-b823-5a88fe39fd0c.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2008/08/13/ProcessingHTMLDocuments.aspx</link>
      <pubDate>Wed, 13 Aug 2008 02:17:44 GMT</pubDate>
      <description>&lt;p&gt;
I ran across a really cool .NET library on a recent project I've been working on.
We have an internal website where we post news, documentation, etc. - basically a
Content Management System (CMS). We're working on a new set of documentation that
is being done inside of a third party help builder application. We need to import
the HTML files it generates into our website (so we get all the things it offers,
like security, searching, revision tracking, view statistics, etc.). So basically,
I need to run through a lot of HTML files, build a tree of the documents (similar
to the help file) and rewrite all of the URL's and image links to point to the correct
URL inside of the site. I initially started looking at various regular expressions
that I might be able to use over at &lt;a href="http://regexlib.com/" target="_blank"&gt;http://regexlib.com/&lt;/a&gt;.
Almost every single one of them had some comment about it failing under some circumstances.
The HTML is surprisingly clean, but I was still nervous about it. So I looked at using &lt;a href="http://www.devincook.com/goldparser/" target="_blank"&gt;GOLD&lt;/a&gt; to
parse the HTML. However, from some of the comments I found it still didn't make everything
as easy I would have liked. I finally ran across &lt;a href="http://www.codeplex.com/htmlagilitypack" target="_blank"&gt;HtmlAgilityPack&lt;/a&gt; over
on CodePlex . It's a .NET library which lets you read AND write changes to an HTML
file via a simple API. 
&lt;/p&gt;
&lt;p&gt;
Here's a chunk of code from my importer so you can get a feel for how it works: 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new"&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;HtmlDocument&lt;/span&gt; doc = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;HtmlDocument&lt;/span&gt;();
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
doc.Load(content.FullDocumentPath);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;HtmlNodeCollection&lt;/span&gt; linkNodes = doc.DocumentNode.SelectNodes(&lt;span style="background: #e5e5e5"&gt;"//a/@href"&lt;/span&gt;);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: #2b91af"&gt;Content&lt;/span&gt; match = &lt;span style="color: blue"&gt;null&lt;/span&gt;;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="background: #ffffbf"&gt;// Run only if there are links in the document.&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: blue"&gt;if&lt;/span&gt; (linkNodes != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
{
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background: #ffffbf"&gt;// Fix up the URL's&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;HtmlNode&lt;/span&gt; linkNode &lt;span style="color: blue"&gt;in&lt;/span&gt; linkNodes)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;HtmlAttribute&lt;/span&gt; attrib
= linkNode.Attributes[&lt;span style="background: #e5e5e5"&gt;"href"&lt;/span&gt;];
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background: #ffffbf"&gt;// If
it's an internal page anchor, ignore it&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (attrib.Value.StartsWith(&lt;span style="background: #e5e5e5"&gt;"#"&lt;/span&gt;))
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;continue&lt;/span&gt;;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;string&lt;/span&gt; path
= &lt;span style="color: blue"&gt;this&lt;/span&gt;.GetAbsolutePath(content.DocumentLink, attrib.Value);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; match = &lt;span style="color: blue"&gt;this&lt;/span&gt;.m_contentList.Find(p
=&amp;gt; p.DocumentLink == path);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (match
!= &lt;span style="color: blue"&gt;null&lt;/span&gt;)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrib.Value =
match.GetUrl();
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;else&lt;/span&gt; &lt;span style="color: blue"&gt;if&lt;/span&gt; (!path.ToLower().StartsWith(&lt;span style="background: #e5e5e5"&gt;"http://"&lt;/span&gt;)
&amp;amp;&amp;amp; !path.ToLower().StartsWith(&lt;span style="background: #e5e5e5"&gt;"mailto:"&lt;/span&gt;))
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="background: #e5e5e5"&gt;"Cannot
find matching document, searched for "&lt;/span&gt; + path);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
}
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
Basically, doc.DocumentNode.SelectNodes("//a/@href") returns a collection of links
in the document (it uses XPath syntax for the selection string). From there, I just
iterate through them, build the new URL, then save the modified Url via code that
just does: linkNode.Attributes["href"].Value = "New URL Here". I also needed to strip
out all the script tags inside of the document, so it uses similar syntax: 
&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: consolas, courier new"&gt;
&lt;p style="margin: 0px"&gt;
&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; StripOutScripts(&lt;span style="color: #2b91af"&gt;HtmlDocument&lt;/span&gt; doc)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
{
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background: #ffffbf"&gt;// Strip out the scripts&lt;/span&gt;
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;HtmlNodeCollection&lt;/span&gt; scriptNodes
= doc.DocumentNode.SelectNodes(&lt;span style="background: #e5e5e5"&gt;"//script"&lt;/span&gt;);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (scriptNodes != &lt;span style="color: blue"&gt;null&lt;/span&gt;)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;HtmlNode&lt;/span&gt; scriptNode &lt;span style="color: blue"&gt;in&lt;/span&gt; scriptNodes)
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; scriptNode.ParentNode.RemoveChild(scriptNode, &lt;span style="color: blue"&gt;false&lt;/span&gt;);
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
}
&lt;/p&gt;
&lt;p style="margin: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
I do the same sort of thing - iterate over the collection, except this time tell it
to remove the nodes from the document (note that I'm grabbing the parent node, since
the current node is everything contained within the script, excluding the &amp;lt;script&amp;gt;
tags. By getting the parent, we get that and the tags themselves.
&lt;/p&gt;
&lt;p&gt;
Each collection has a WriteContentTo() method which can write the HTML for that section
of the document to a Stream. What's really nice about this entire library (besides
how simple it was to use) was the fact that it doesn't seem to mangle the existing
HTML when using WriteContentTo() (at least from what I've seen). Only one minor complaint
- the docs are a bit weak. It just includes the standard documentation of the classes,
not much in the way of examples. However, it's pretty consistent so it doesn't take
much to get started with it.
&lt;/p&gt;
&lt;p&gt;
What a great library - it couldn't be simpler. It saved me a ton of time.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.codeplex.com/htmlagilitypack"&gt;http://www.codeplex.com/htmlagilitypack&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://regexlib.com/"&gt;http://regexlib.com/&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://www.devincook.com/goldparser/"&gt;http://www.devincook.com/goldparser/&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=0c45f600-d3fb-4838-b823-5a88fe39fd0c" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,0c45f600-d3fb-4838-b823-5a88fe39fd0c.aspx</comments>
      <category>.NET</category>
      <category>C#</category>
      <category>Developer Tools</category>
    </item>
    <item>
      <trackback:ping>http://www.rcs-solutions.com/blog/Trackback.aspx?guid=6c6a0782-4fc8-46cb-b555-31701e8ff471</trackback:ping>
      <pingback:server>http://www.rcs-solutions.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.rcs-solutions.com/blog/PermaLink,guid,6c6a0782-4fc8-46cb-b555-31701e8ff471.aspx</pingback:target>
      <dc:creator>Paul Mrozowski</dc:creator>
      <wfw:comment>http://www.rcs-solutions.com/blog/CommentView,guid,6c6a0782-4fc8-46cb-b555-31701e8ff471.aspx</wfw:comment>
      <wfw:commentRss>http://www.rcs-solutions.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6c6a0782-4fc8-46cb-b555-31701e8ff471</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>Visual Studio Add-ins failing</title>
      <guid isPermaLink="false">http://www.rcs-solutions.com/blog/PermaLink,guid,6c6a0782-4fc8-46cb-b555-31701e8ff471.aspx</guid>
      <link>http://www.rcs-solutions.com/blog/2007/10/18/VisualStudioAddinsFailing.aspx</link>
      <pubDate>Thu, 18 Oct 2007 02:49:58 GMT</pubDate>
      <description>&lt;p&gt;
I’ve been trying to get the (highly regarded) CopySourceAsHtml add-in to work under
Visual Studio to make it easier to post code samples. Every time I tried loading it,
it was failing with: 
&lt;/p&gt;
&lt;p&gt;
The Add-in 'CopySourceAsHtml' failed to load or caused an exception. 
&lt;br&gt;
Would you like to remove this Add-in? 
&lt;br&gt;
If you choose yes, the file it was loaded from, '\\wtz-srv-dc01\Users\paul.mrozowski\My
Documents\Visual Studio 2005\Addins\CopySourceAsHtml.AddIn', will be renamed. 
&lt;br&gt;
Error Message: 
&lt;br&gt;
&lt;unknown error&gt;
Error number: 8013150a 
&lt;/p&gt;
&lt;p&gt;
I tried downloading the source, recompiling, making some suggested changes to the
control references. Nothing seemed to help. As soon as I attempted to activate the
add-in, it was failing. Then it suddenly occurred to me: what if it’s related to the
fact that “My Documents” is on a network drive? To test this idea, I created a new
local folder, then when into Tools &amp;gt; Options &amp;gt; Environment &amp;gt; Add-in/Macros
Security. I added a new local folder which had a copy of the add-in and exited VS
and restarted. Finally, I when to Tools &amp;gt; Add-ins and reselected the CopySourceAsHtml
add-in. No errors! 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/VisualStudioAddinsfailing_140FD/options_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="386" alt="options" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/VisualStudioAddinsfailing_140FD/options_thumb.png" width="649" border="0"&gt;&lt;/a&gt; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
I copied and pasted some code (and selected Override for the font to add Courier New
as a secondary font). (random code shown below). 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; Process
events from the grid&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;param
name="source"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;param
name="e"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;developer&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt;Paul
Mrozowski&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;/developer&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;///&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;created&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; background: #ffffbf; color: black; font-family: consolas"&gt;10/16/2007&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="gray" size="2"&gt;&lt;span style="font-size: 10pt; color: gray; font-family: consolas"&gt;&amp;lt;/created&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;protected&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;void&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; grdTemplates_ItemCommand(&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;object&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; source,
Telerik.WebControls.&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="#2b91af" size="2"&gt;&lt;span style="font-size: 10pt; color: #2b91af; font-family: consolas"&gt;GridCommandEventArgs&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; e)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; (e.CommandName
== &lt;span style="background: #e5e5e5"&gt;"Edit"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;.EditRecord(e.Item);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;else&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; (e.CommandName
== &lt;span style="background: #e5e5e5"&gt;"Cancel"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;.grdTemplates.EditIndexes.Clear();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;else&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; (e.CommandName
== &lt;span style="background: #e5e5e5"&gt;"Add"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;.AddRecord();&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;else&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; (e.CommandName
== &lt;span style="background: #e5e5e5"&gt;"Test"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;.TestQuery(e);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;else&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;if&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt; (e.CommandName
== &lt;span style="background: #e5e5e5"&gt;"Update"&lt;/span&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="blue" size="2"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: consolas"&gt;this&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;.UpdateRoles(e);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;Here's
a screenshot as a comparison:&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&lt;/span&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;&lt;a href="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/VisualStudioAddinsfailing_140FD/htmlComparison_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="358" alt="htmlComparison" src="http://www.rcs-solutions.com/blog/content/binary/WindowsLiveWriter/VisualStudioAddinsfailing_140FD/htmlComparison_thumb.png" width="724" border="0"&gt;&lt;/a&gt; &lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="background: white; margin: 0in 0in 0pt"&gt;
&lt;font face="Consolas" color="black" size="2"&gt;&lt;span style="font-size: 10pt; color: black; font-family: consolas"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Links:&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
CopySourceAsHtml
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/"&gt;http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Getting it to run under VS 2008 Beta 2
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;&lt;a href="http://diditwith.net/2007/08/16/CopySourceAsHtmlInVisualStudio2008.aspx"&gt;http://diditwith.net/2007/08/16/CopySourceAsHtmlInVisualStudio2008.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.rcs-solutions.com/blog/aggbug.ashx?id=6c6a0782-4fc8-46cb-b555-31701e8ff471" /&gt;</description>
      <comments>http://www.rcs-solutions.com/blog/CommentView,guid,6c6a0782-4fc8-46cb-b555-31701e8ff471.aspx</comments>
      <category>Developer Tools</category>
      <category>Visual Studio</category>
    </item>
  </channel>
</rss>