<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7049316631692964922</id><updated>2011-09-14T04:33:54.630-07:00</updated><category term='C#'/><category term='LINQ'/><category term='Visual Studio'/><category term='Team Foundation Server'/><category term='Microsoft'/><category term='Team Build'/><category term='MVVM'/><category term='General'/><category term='Prism'/><category term='Software Development'/><category term='Visual Basic'/><category term='ClickOnce'/><category term='WPF'/><category term='Unit Testing'/><category term='Visual Studio 2010'/><category term='XAML'/><category term='.NET'/><title type='text'>My.RAM.Serialize()</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>48</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-1785113760390485829</id><published>2011-03-04T09:02:00.000-08:00</published><updated>2011-03-04T09:33:45.407-08:00</updated><title type='text'>A Time Of Transition...</title><content type='html'>My time at KPMG has come to an end...  As I reflect back on these past 3+ years, I've certainly learned more here than I ever have in my career.  I attribute a lot of my success to one person.

&lt;p&gt;
I certainly owe a huge debt of gratitude to &lt;a href="http://coolthingoftheday.blogspot.com/"&gt;Greg&lt;/a&gt;.  Through him, I was allowed to use the latest technologies, think outside of the box, and work on highly critical projects with a huge sense of responsibility.
&lt;/p&gt;

Thanks, Greg.  You've certainly been the best manager I've ever had (pretty sad huh :P), but not only that, you've also been a great mentor and friend.  I really could not have gotten luckier when I landed the job at KPMG and became a part of your team.  Thanks again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-1785113760390485829?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/1785113760390485829/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=1785113760390485829' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1785113760390485829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1785113760390485829'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2011/03/time-of-transition.html' title='A Time Of Transition...'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5070202772303562018</id><published>2010-12-15T08:56:00.001-08:00</published><updated>2010-12-15T08:59:45.531-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB + C# Adventures (Final Part)</title><content type='html'>&lt;p&gt;Now that I’ve been using &lt;strong&gt;C&lt;/strong&gt;# continuously for my current project, I can honestly say that I can switch between &lt;strong&gt;VB.NET&lt;/strong&gt; and &lt;strong&gt;C#&lt;/strong&gt; easily.&amp;#160; As I’ve said before, I learned &lt;strong&gt;.NET&lt;/strong&gt; in &lt;strong&gt;C#&lt;/strong&gt; a long time ago and personal projects are done in &lt;strong&gt;C#&lt;/strong&gt;, but most of my production experience has been using &lt;strong&gt;VB.NET&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;Do I regret having to use &lt;strong&gt;VB.NET&lt;/strong&gt;?&amp;#160; Not at all, because it’s all about the framework, not the syntax.&amp;#160; I like being able to use both languages and achieve the same outcome.&amp;#160; Of course I can’t say that I know &lt;strong&gt;C#&lt;/strong&gt; inside and out, but I can’t say the same about &lt;strong&gt;VB.NET &lt;/strong&gt;either.&amp;#160; I also feel a sense of pride being able to do more than one language and not complain about it.&amp;#160; I still find it funny when my developer friends say something like “Oh I hate &lt;strong&gt;VB.NET&lt;/strong&gt;.” or “I can program in &lt;strong&gt;C#&lt;/strong&gt; about 3x faster than &lt;strong&gt;VB.NET&lt;/strong&gt;.”&lt;/p&gt;  &lt;p&gt;So which language do I prefer?&amp;#160; I have always preferred &lt;strong&gt;C#&lt;/strong&gt; over &lt;strong&gt;VB.NET&lt;/strong&gt;, but I’ve never complained and never will, if I have to use &lt;strong&gt;VB.NET&lt;/strong&gt; for a project.&amp;#160; Sometimes there’s no choice in what language you have to use and knowing both is a useful skill to have.&amp;#160; Maybe one day if we need to develop some kind of math intensive library, &lt;strong&gt;F#&lt;/strong&gt; will be thrown my way :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5070202772303562018?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5070202772303562018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5070202772303562018' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5070202772303562018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5070202772303562018'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/12/vb-c-adventures-final-part.html' title='VB + C# Adventures (Final Part)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2264104761525939496</id><published>2010-12-10T10:05:00.001-08:00</published><updated>2010-12-10T10:08:43.057-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='Prism'/><title type='text'>Closing a WPF Window Through Your ViewModel</title><content type='html'>&lt;p&gt;I ran into the issue of properly closing a &lt;strong&gt;Window&lt;/strong&gt; (&lt;strong&gt;View&lt;/strong&gt;) from my &lt;strong&gt;ViewModel&lt;/strong&gt; a while ago.&amp;#160; How does one do this without breaking &lt;strong&gt;MVVM&lt;/strong&gt; or adding too much complexity?&amp;#160; Since I’m developing my current project using &lt;strong&gt;Prism&lt;/strong&gt; and my &lt;strong&gt;IUnityContainers&lt;/strong&gt; are injected into my &lt;strong&gt;ViewModels&lt;/strong&gt;, why not just inject &lt;strong&gt;this.Close()&lt;/strong&gt; also?&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/**** Window (View) ****/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;...&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Window(IUnityContainer unityContainer)&lt;/pre&gt;

  &lt;pre&gt;{    &lt;/pre&gt;

  &lt;pre class="alt"&gt;   InitializeComponent();    &lt;/pre&gt;

  &lt;pre&gt;   &lt;span class="kwrd"&gt;this&lt;/span&gt;.DataContext = &lt;span class="kwrd"&gt;new&lt;/span&gt; ViewModel(unityContainer, &lt;span class="kwrd"&gt;this&lt;/span&gt;.Close);&lt;/pre&gt;

  &lt;pre class="alt"&gt;}&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;/**** End Window (View) ****/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&amp;#160;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="rem"&gt;/**** ViewModel ****/&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ViewModel&lt;/pre&gt;

  &lt;pre&gt;{    &lt;/pre&gt;

  &lt;pre class="alt"&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; ViewModel(IUnityContainer unityContainwer, Action closeAction)    &lt;/pre&gt;

  &lt;pre&gt;   {        &lt;/pre&gt;

  &lt;pre class="alt"&gt;      ...        &lt;/pre&gt;

  &lt;pre&gt;      CloseCommand = &lt;span class="kwrd"&gt;new&lt;/span&gt; DelegateCommand(closeAction);    &lt;/pre&gt;

  &lt;pre class="alt"&gt;   }    &lt;/pre&gt;

  &lt;pre&gt;   &lt;/pre&gt;

  &lt;pre class="alt"&gt;   &lt;span class="kwrd"&gt;public&lt;/span&gt; DelegateCommand CloseCommand    &lt;/pre&gt;

  &lt;pre&gt;   {        &lt;/pre&gt;

  &lt;pre class="alt"&gt;      get;        &lt;/pre&gt;

  &lt;pre&gt;      &lt;span class="kwrd"&gt;private&lt;/span&gt; set;    &lt;/pre&gt;

  &lt;pre class="alt"&gt;   }&lt;/pre&gt;

  &lt;pre&gt;}&lt;/pre&gt;

  &lt;pre class="alt"&gt;&lt;span class="rem"&gt;/**** End ViewModel ****/&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Does this break &lt;strong&gt;MVVM&lt;/strong&gt; at all?&amp;#160; Is testability decreased because I injected the &lt;strong&gt;this.Close()&lt;/strong&gt; method into my &lt;strong&gt;ViewModel&lt;/strong&gt;?&amp;#160; I would argue not since I’ve used the &lt;strong&gt;Action&lt;/strong&gt; delegate.&amp;#160; This seems to be the easiest/simplest way to do what I (and many others) want.&amp;#160; Now there may be some purists out there that don’t want any user entered code in the code-behind, but as you might have guessed, I’m no purist.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2264104761525939496?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2264104761525939496/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2264104761525939496' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2264104761525939496'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2264104761525939496'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/12/closing-wpf-window-through-your.html' title='Closing a WPF Window Through Your ViewModel'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-7826719313299907090</id><published>2010-12-08T09:57:00.001-08:00</published><updated>2010-12-08T09:57:27.989-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><title type='text'>WPF, MVVM and TextBoxes</title><content type='html'>&lt;p&gt;Overall, I like &lt;strong&gt;WPF&lt;/strong&gt; and &lt;strong&gt;MVVM&lt;/strong&gt;.&amp;#160; That’s not to say that I think &lt;strong&gt;MVVM&lt;/strong&gt; is a perfect design pattern.&amp;#160; I find myself breaking the purity of &lt;strong&gt;MVVM&lt;/strong&gt; sometimes because I think there’s a lot of compromise needed to do what I want to without adding complexity.&lt;/p&gt;  &lt;p&gt;Anyway, one of the biggest gripes about &lt;strong&gt;MVVM&lt;/strong&gt; and &lt;strong&gt;TextBoxes&lt;/strong&gt; is that the data for bound &lt;strong&gt;TextBoxes&lt;/strong&gt; is updated when the &lt;strong&gt;TextBox&lt;/strong&gt; control loses focus.&amp;#160; But that makes sense, right?&amp;#160; Well, what if you’ve updated a &lt;strong&gt;TextBox&lt;/strong&gt; and hit a &lt;strong&gt;MenuItem&lt;/strong&gt; to save your data.&amp;#160; Guess what?&amp;#160; The &lt;strong&gt;TextBox&lt;/strong&gt; doesn’t lose focus and your save takes the stale &lt;strong&gt;TextBox&lt;/strong&gt; data.&amp;#160; Needless to say this is &lt;strong&gt;VERY&lt;/strong&gt; frustrating… &lt;/p&gt;  &lt;p&gt;One solution would be to move the focus off of the &lt;strong&gt;TextBox&lt;/strong&gt; like so:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;((System.Windows.UIElement)System.Windows.Input.Keyboard.FocusedElement).MoveFocus(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Windows.Input.TraversalRequest(System.Windows.Input.FocusNavigationDirection.Next));&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;You can call that before you actually execute your save command, but even that seems like a bit too much effort to do what should logically be done anyway… I’ve done the above in some of my projects, but there has to be some other way to do what I want…&lt;/p&gt;

&lt;p&gt;Instead of using the vanilla &lt;strong&gt;Menu&lt;/strong&gt; control, I turned to &lt;strong&gt;Infragistics’&lt;/strong&gt; &lt;strong&gt;xamMenu&lt;/strong&gt;.&amp;#160; I was hoping that their menu would take into account something like the issue I was having with my &lt;strong&gt;TextBox&lt;/strong&gt; data.&amp;#160; I was right… sort of.&amp;#160; It turns out that if I use their &lt;strong&gt;xamMenu&lt;/strong&gt; like so:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenu&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenuItem&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Header&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Save&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:XamMenuItem.InputBindings&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;MouseBinding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;MouseAction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;LeftClick&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{Binding SaveCommand}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:XamMenuItem.InputBindings&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenuItem&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenu&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;The above doesn’t do what I want either… After some experimenting, I found that if I use the vanilla &lt;strong&gt;MenuItem&lt;/strong&gt; elements instead of &lt;strong&gt;Infragistics’&lt;/strong&gt; &lt;strong&gt;XamMenuItem&lt;/strong&gt; elements, my &lt;strong&gt;TextBox&lt;/strong&gt; data updates and saves.&amp;#160; It seems weird to me that using a combination of the &lt;strong&gt;Infragistics&lt;/strong&gt; &lt;strong&gt;xamMenu&lt;/strong&gt; and the vanilla &lt;strong&gt;MenuItem&lt;/strong&gt; causes the data to update correctly, yet using all &lt;strong&gt;Infragistics’&lt;/strong&gt; elements doesn’t.&lt;/p&gt;

&lt;p&gt;&amp;lt;shrug&amp;gt; In the end I ended up using vanilla &lt;strong&gt;Button&lt;/strong&gt; elements in the &lt;strong&gt;xamMenu&lt;/strong&gt; because using the vanilla &lt;strong&gt;MenuItem&lt;/strong&gt; elements caused spacing issues:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenu&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;    &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{Binding SaveCommand}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Background&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Transparent&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;BorderBrush&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Transparent&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;StackPanel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Orientation&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Stretch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;None&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Source&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{StaticResource Image}&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;TextBlock&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Background&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Transparent&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;4,0,0,0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Save&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;StackPanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Button&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ig:xamMenu&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-7826719313299907090?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/7826719313299907090/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=7826719313299907090' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7826719313299907090'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7826719313299907090'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/12/wpf-mvvm-and-textboxes.html' title='WPF, MVVM and TextBoxes'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8845268909800492905</id><published>2010-10-20T12:32:00.001-07:00</published><updated>2010-10-20T12:41:29.236-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>VS2010 IDE vs Stand Alone Execution Weirdness (Mouse Wheel)</title><content type='html'>&lt;p&gt;So I’m doing some &lt;strong&gt;ActiveX&lt;/strong&gt; &lt;strong&gt;Interop&lt;/strong&gt; with my &lt;strong&gt;WPF&lt;/strong&gt; application.&amp;#160; As most people know, it’s more of a two step process with WPF since you have to host the &lt;strong&gt;ActiveX&lt;/strong&gt; control inside of a &lt;strong&gt;WindowsFormsHost&lt;/strong&gt; object before you can introduce it into a &lt;strong&gt;WPF&lt;/strong&gt; Control or Window. &lt;/p&gt;  &lt;p&gt;Anyway, I was testing my component in the IDE and it seemed to be working fine.&amp;#160; Next, I ran the application by itself because it’s faster than through the IDE and I found that my mouse wheel was not working.&amp;#160; What gives? Why would it work properly in the IDE, but not by itself?&lt;/p&gt;  &lt;p&gt;I got frustrated and posted a question on the &lt;strong&gt;MSDN&lt;/strong&gt; forums about it.&amp;#160; Since my &lt;strong&gt;ActiveX&lt;/strong&gt; component has license restrictions, I couldn’t provide a proper sample application.&amp;#160; I then got the suggestion to host the &lt;strong&gt;Interop&lt;/strong&gt; component in a &lt;strong&gt;Winforms&lt;/strong&gt; application as a test.&amp;#160; My &lt;strong&gt;Winforms&lt;/strong&gt; sample project works as it should inside and outside of the IDE.&lt;/p&gt;  &lt;p&gt;I then tried to just start a simple &lt;strong&gt;WPF&lt;/strong&gt; application with the &lt;strong&gt;Interop&lt;/strong&gt; control and the same behavior occurs as in my main project: Mouse Wheel works in the IDE, but not stand alone.&amp;#160; At this point it seems like it’s a &lt;strong&gt;WPF/ActiveX Interop&lt;/strong&gt; issue.&lt;/p&gt;  &lt;p&gt;Another suggestion I got was to use &lt;strong&gt;Spy++&lt;/strong&gt; to see my component was responding to the Mouse Wheel messages.&amp;#160; I opened up &lt;strong&gt;Spy++&lt;/strong&gt;, but before I did anything I noticed that my application was now handling the Mouse Wheel messages.&amp;#160; Now here’s what’s confusing me, as soon as I closed &lt;strong&gt;Spy++&lt;/strong&gt;, my application stopped handling Mouse Wheel messages again.&amp;#160; Why does the simple fact of having &lt;strong&gt;Spy++&lt;/strong&gt; open make my &lt;strong&gt;ActiveX&lt;/strong&gt; component work correctly???&amp;#160; I didn’t event start logging the component!&lt;/p&gt;  &lt;p&gt;According to &lt;strong&gt;Spy++&lt;/strong&gt;, my component was indeed handling Mouse Wheel messages as indicated by the log and also because the component was scrolling as it should… I’m waiting for a response to my forum post, hopefully someone can tell me what’s going on.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8845268909800492905?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8845268909800492905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8845268909800492905' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8845268909800492905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8845268909800492905'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/10/vs2010-ide-vs-stand-alone-execution.html' title='VS2010 IDE vs Stand Alone Execution Weirdness (Mouse Wheel)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5953722760532349387</id><published>2010-10-04T09:06:00.001-07:00</published><updated>2010-10-04T09:06:16.788-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB + C# Adventures (Part 5)</title><content type='html'>&lt;h2&gt;I Miss This&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;VB&lt;/strong&gt; definitely makes certain things easier than &lt;strong&gt;C#&lt;/strong&gt;.&amp;#160; This may go back to the whole &lt;strong&gt;VB&lt;/strong&gt; making me lazy thing, but I miss being able to do this and not having to worry about a null reference exception: &lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; i &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Integer&lt;/span&gt; = Len(Trim(SomeString))&lt;br /&gt;&lt;br /&gt;...&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;&lt;em&gt;Note that if the code above were to changed to &lt;strong&gt;SomeString.Trim.Length&lt;/strong&gt;, a null reference exception could occur in either language.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Conversion methods are available in the &lt;strong&gt;System.Convert &lt;/strong&gt;namespace, but in &lt;strong&gt;VB&lt;/strong&gt; you can do the old &lt;strong&gt;CBool(SomeObject)&lt;/strong&gt;, &lt;strong&gt;CInt(SomeObject)&lt;/strong&gt;, etc.&amp;#160; I’m not saying that using the &lt;strong&gt;System.Convert&lt;/strong&gt; methods are bad or anything, just that I need to get used to certain things.&amp;#160; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;Style&lt;/h2&gt;

&lt;p&gt;I’ll be blunt, I hate sloppy code.&amp;#160; I try to be consistent in my style and cleanliness regardless of the language I’m programming in.&amp;#160; I think that &lt;strong&gt;C#&lt;/strong&gt; definitely has more possibilities as far as clean styles go.&amp;#160; For example:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (someCondition)&lt;br /&gt;    DoThis();&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (someCondition){&lt;br /&gt;    DoThis();&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (someCondition)&lt;br /&gt;{&lt;br /&gt;    DoThis();&lt;br /&gt;}&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;I find all three of the above styles readable.&amp;#160; However, given the syntactic flexibility of &lt;strong&gt;C#&lt;/strong&gt;, messiness is just as easy:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (someCondition) DoThis(); &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(someOtherCondition) {DoThis();AlsoDoThis();}&lt;br /&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;I’ve always hated code that sat on one line, even way back in college when I was learning &lt;strong&gt;C/C++&lt;/strong&gt;.&amp;#160; Sure it can be more succinct, but I find it harder to read.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5953722760532349387?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5953722760532349387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5953722760532349387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5953722760532349387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5953722760532349387'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/10/vb-c-adventures-part-5.html' title='VB + C# Adventures (Part 5)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-4770018105738196451</id><published>2010-09-30T08:43:00.001-07:00</published><updated>2010-09-30T08:44:28.505-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Prism'/><title type='text'>My Prism Journey (Part 3)</title><content type='html'>&lt;h2&gt;It’s Me, Not You&lt;/h2&gt;  &lt;p&gt;&lt;strong&gt;WPF’s&lt;/strong&gt; bare controls are decent, but not always as robust as people need or want.&amp;#160; I initially setup my &lt;strong&gt;Shell&lt;/strong&gt; using the basic &lt;strong&gt;Grid&lt;/strong&gt; component on a &lt;strong&gt;Window&lt;/strong&gt;.&amp;#160; Of course I was and still am in the learning phase, but as my project becomes more “real”, I realize that I should probably start using the components that’ll actually be needed once my project hits our production environment.&lt;/p&gt;  &lt;p&gt;Since I’ll be using floating panes, I turned to &lt;strong&gt;Infragistics&lt;/strong&gt;.&amp;#160; We use their controls in many of our &lt;strong&gt;WinForms&lt;/strong&gt; applications so it seemed logical to use them for my &lt;strong&gt;Prism&lt;/strong&gt; project.&amp;#160; I figured this would be easy since &lt;strong&gt;Prism&lt;/strong&gt; can inject views into any control that hosts an &lt;strong&gt;ItemControl&lt;/strong&gt; or &lt;strong&gt;ContentControl&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;There was a bit of a learning curve to get &lt;strong&gt;Infragistics’&lt;/strong&gt; Dock Manager to work the way I wanted.&amp;#160; Although I was easily able to place &lt;strong&gt;ConentControls&lt;/strong&gt; in the various dock regions, for some reason I couldn’t get the Dock Manager to fill its parent container.&amp;#160; This behavior wasn’t expected because the &lt;strong&gt;WinForms&lt;/strong&gt; equivalent did fill in the area as expected.&amp;#160; I also followed the Getting Started sample from scratch in a new project and the control didn’t fill…&lt;/p&gt;  &lt;p&gt;I did some searching and it looked like others were having the same issue.&amp;#160; The post I found was dated 2009 with no answer so I figured that this issue wasn’t resolved.&amp;#160; I was pretty irate that the expected behavior wasn’t implemented over a year later.&amp;#160; I even went so far as to gripe to the &lt;a href="http://coolthingoftheday.blogspot.com/"&gt;boss&lt;/a&gt; about it and asked if I could look at other companies’ components.&lt;/p&gt;  &lt;p&gt;After my grumbling session, I took a step back.&amp;#160; &lt;strong&gt;Infragistics&lt;/strong&gt; has been in the controls game a long time (remember &lt;strong&gt;Sheridan&lt;/strong&gt; and &lt;strong&gt;VB&lt;/strong&gt; pre &lt;strong&gt;.NET&lt;/strong&gt;?), they couldn’t have let something like this slip.&amp;#160; I did some more searching and I found that all I needed was a single property: &lt;strong&gt;LayoutMode=”FillContainer”&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Open hand facing upwards and forcefully place forehead into hand…&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h2&gt;Views, ViewModels, And Events&lt;/h2&gt;  &lt;p&gt;Not all applications have simple UIs.&amp;#160; I have a registered library that handles some of my &lt;strong&gt;Region&lt;/strong&gt; management based on certain requirements.&amp;#160; This manager will inject a &lt;strong&gt;View+ViewModel&lt;/strong&gt; into a &lt;strong&gt;Region&lt;/strong&gt;, nothing complicated here.&amp;#160; In my &lt;strong&gt;ViewModel&lt;/strong&gt; I subscribe to certain events, which again is nothing complicated.&amp;#160; &lt;/p&gt;  &lt;p&gt;I noticed something odd when I retrieved data through my application.&amp;#160; Every time I retrieved data, the time it took to display multiplied.&amp;#160; At first, I thought it was because my &lt;strong&gt;View&lt;/strong&gt; wasn’t being properly removed from my &lt;strong&gt;Region&lt;/strong&gt;. Nope, the &lt;strong&gt;ActiveView&lt;/strong&gt; count is 0 as it should be.&amp;#160; I then placed break points in my data layer and found the culprit.&amp;#160; &lt;/p&gt;  &lt;p&gt;The expected behavior is that if I request data, a new data layer is instantiated, and my data is returned.&amp;#160; However, every time I requested data, a data layer was instantiated, and the data was returned, but the previously instantiated data layer never got destroyed and was also retrieving data!&amp;#160; &lt;/p&gt;  &lt;p&gt;This immediately made me look at the fact that I subscribed to a retrieval event, but never unsubscribed from it.&amp;#160; &lt;strong&gt;Prism’s&lt;/strong&gt; event system must have still had a reference to the CallBack and was still calling it.&amp;#160; This explained the multiplicative time increase.&amp;#160; I ended up having to make sure that my &lt;strong&gt;Region&lt;/strong&gt; manager library unsubscribes from any events when removing &lt;strong&gt;Views&lt;/strong&gt; from my &lt;strong&gt;Regions&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-4770018105738196451?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/4770018105738196451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=4770018105738196451' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4770018105738196451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4770018105738196451'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/my-prism-journey-part-3.html' title='My Prism Journey (Part 3)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2413798915306289409</id><published>2010-09-23T11:57:00.001-07:00</published><updated>2010-09-23T12:00:32.015-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB + C# Adventures (Part 4)</title><content type='html'>&lt;h4&gt;Event Handlers&lt;/h4&gt;  &lt;p&gt;Adding and removing event handlers in &lt;strong&gt;VB&lt;/strong&gt; is pretty straightforward.&amp;#160; I think the syntax, although wordy, lends itself to readability better than its &lt;strong&gt;C#&lt;/strong&gt; counterpart.&amp;#160; In &lt;strong&gt;VB&lt;/strong&gt; for example:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;AddHandler&lt;/span&gt; o.SomeEvent, &lt;span style="color: #0000ff"&gt;AddressOf&lt;/span&gt; Handler&lt;br /&gt;...&lt;br /&gt;&lt;span style="color: #0000ff"&gt;RemoveHandler&lt;/span&gt; o.SomeEvent, &lt;span style="color: #0000ff"&gt;AddressOf&lt;/span&gt; Handler&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;In &lt;strong&gt;C#&lt;/strong&gt;, you’d have to do the following:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;...&lt;br /&gt;o.SomeEvent += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler(Handler);&lt;br /&gt;...&lt;br /&gt;o.SomeEvent -= &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler(Handler);&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Now the thing that struck me as “funny” was the need to create a new &lt;strong&gt;EventHandler&lt;/strong&gt; delegate (or whatever event handler delegate you created) to remove it in the &lt;strong&gt;C#&lt;/strong&gt; syntax…&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h4&gt;Method Parameters Passed By Reference&lt;/h4&gt;

&lt;p&gt;Since I’m using methods that pass parameters as reference, you have to use the &lt;strong&gt;ref&lt;/strong&gt; identifier before those parameters in &lt;strong&gt;C#&lt;/strong&gt;.&amp;#160; At first this bugged me because I was so used to not having to do it in &lt;strong&gt;VB&lt;/strong&gt;.&amp;#160; But is it necessarily better not having to identify a reference parameter?&amp;#160; I got to thinking about this and I now think it’s good to have to denote it.&amp;#160; &lt;/p&gt;

&lt;p&gt;Why do I think so now?&amp;#160; The intent of a parameter passed by reference is to change the parameter itself (of course this has different implications for value types versus reference types).&amp;#160; This can lead to confusion if you don’t know that the variable that you’re passing in can change.&amp;#160; Requiring the &lt;strong&gt;ref&lt;/strong&gt; identifier alleviates this confusion in my opinion.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2413798915306289409?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2413798915306289409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2413798915306289409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2413798915306289409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2413798915306289409'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/vb-c-adventures-part-4.html' title='VB + C# Adventures (Part 4)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5757541185575561141</id><published>2010-09-21T12:06:00.001-07:00</published><updated>2010-09-21T12:06:45.664-07:00</updated><title type='text'>My Prism Journey (Part 2)</title><content type='html'>&lt;p&gt;Have you registered some types in your &lt;strong&gt;bootstrapper &lt;/strong&gt;like I have?&amp;#160; Through Prism’s Dependency Injection, I’ve been passing the &lt;strong&gt;EventAggregator&lt;/strong&gt; around to my objects as a parameter.&amp;#160; I’ve also passed in some other registered types, but then I got to thinking…why not just resolve it through the &lt;strong&gt;UnityContainer&lt;/strong&gt;?&amp;#160; Instead of injecting all the registered types I need, I can just pass in a single &lt;strong&gt;IUnityContainer&lt;/strong&gt; and resolve all of the types I need.&amp;#160; Pretty slick!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5757541185575561141?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5757541185575561141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5757541185575561141' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5757541185575561141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5757541185575561141'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/my-prism-journey-part-2.html' title='My Prism Journey (Part 2)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-9105988505655521574</id><published>2010-09-20T15:16:00.001-07:00</published><updated>2010-09-20T15:16:47.942-07:00</updated><title type='text'>VB + C# Adventures (Part 3)</title><content type='html'>&lt;p&gt;I ran into a little hiccup today, which I found amusing.&amp;#160; Parentheses use is &lt;strong&gt;very&lt;/strong&gt; important in &lt;strong&gt;C#&lt;/strong&gt;, whereas in &lt;strong&gt;VB&lt;/strong&gt; you can be lazy about them (think method calls).&amp;#160; In my &lt;strong&gt;C#&lt;/strong&gt; project, I was trying to do an &lt;strong&gt;object.ToString.ToUpper&lt;/strong&gt;, but for some reason &lt;strong&gt;Intellisense&lt;/strong&gt; couldn’t didn’t find &lt;strong&gt;ToUpper&lt;/strong&gt;.&amp;#160; Well, given that &lt;strong&gt;ToString&lt;/strong&gt; is a method call, you need to call it as such: &lt;strong&gt;object.ToString().ToUpper()&lt;/strong&gt;.&amp;#160; Has &lt;strong&gt;VB&lt;/strong&gt; made me a lazy developer? :)&lt;/p&gt;  &lt;p&gt;Optional parameters… I personally never liked them, but they’re pretty ubiquitous in &lt;strong&gt;VB&lt;/strong&gt; land.&amp;#160; It wasn’t until &lt;strong&gt;.NET 4&lt;/strong&gt; that &lt;strong&gt;C#&lt;/strong&gt; got this language feature.&amp;#160; &lt;strong&gt;VB&lt;/strong&gt; will let you have optional value and reference parameters, whereas &lt;strong&gt;C#&lt;/strong&gt; won’t let you have optional reference/out parameters.&amp;#160; I’m currently using a data access layer written in &lt;strong&gt;VB&lt;/strong&gt; that has a few methods with optional parameters for my &lt;strong&gt;C#&lt;/strong&gt; project and I saw this first hand through &lt;strong&gt;Intellisense&lt;/strong&gt;.&amp;#160; No brackets were present around the optional reference parameters through &lt;strong&gt;C#&lt;/strong&gt;…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-9105988505655521574?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/9105988505655521574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=9105988505655521574' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/9105988505655521574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/9105988505655521574'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/vb-c-adventures-part-3.html' title='VB + C# Adventures (Part 3)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-1389800462584843037</id><published>2010-09-17T13:51:00.001-07:00</published><updated>2010-09-17T13:51:57.080-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='Prism'/><title type='text'>My Prism Journey (Part 1)</title><content type='html'>&lt;p&gt;I’m not going to describe what &lt;a href="http://compositewpf.codeplex.com/"&gt;&lt;strong&gt;Prism&lt;/strong&gt;&lt;/a&gt; is because you can just do a search :)&amp;#160; I’m going to post my experiences in trying to leverage the &lt;strong&gt;Prism&lt;/strong&gt; libraries to create a modular application.&amp;#160; The tutorials that come with the library are very helpful so people should definitely read the &lt;strong&gt;chm&lt;/strong&gt; file for help.&amp;#160; I’m also trying to be as &lt;strong&gt;MVVM&lt;/strong&gt; as possible so hopefully I don’t completely mangle my application.&lt;/p&gt;  &lt;p&gt;One of the components that I’m adding to my application requires &lt;strong&gt;COM Interop… &lt;/strong&gt;yay.&amp;#160; I did the obligatory &lt;strong&gt;aximp&lt;/strong&gt; call on my &lt;strong&gt;ActiveX&lt;/strong&gt; component, but for some reason I got a &lt;strong&gt;file not found&lt;/strong&gt; exception whenever I tried to access the component at runtime.&amp;#160; Adding the references created by &lt;strong&gt;aximp&lt;/strong&gt; didn’t seem to work.&lt;/p&gt;  &lt;p&gt;I had to actually create a new &lt;strong&gt;WinForms&lt;/strong&gt; control library, add the component to my &lt;strong&gt;toolbox&lt;/strong&gt;, drag the component to the control, and then I was able to access the component at runtime.&amp;#160; No worries, I just copied the interop dlls and placed them in a folder so that those can be used instead of the &lt;strong&gt;aximp&lt;/strong&gt; generated ones.&lt;/p&gt;  &lt;p&gt;To include interop &lt;strong&gt;ActiveX&lt;/strong&gt; components in your &lt;strong&gt;WPF&lt;/strong&gt; application, you need to host the &lt;strong&gt;ActiveX&lt;/strong&gt; component in a &lt;strong&gt;WinForms&lt;/strong&gt; control.&amp;#160; No problem, add &lt;strong&gt;WindowsFormsIntegration&lt;/strong&gt; so you can use the &lt;strong&gt;WindowsFormHost&lt;/strong&gt; control in your &lt;strong&gt;WPF&lt;/strong&gt; app/control.&amp;#160; You can then add the component to the &lt;strong&gt;WindowsFormHost.Child&lt;/strong&gt; and it will display.&amp;#160; Pretty straight forward…&lt;/p&gt;  &lt;p&gt;After getting the above sorted out, I got my interop control to display in the specified &lt;strong&gt;region &lt;/strong&gt;in my &lt;strong&gt;shell&lt;/strong&gt;.&amp;#160; However, it was displaying incorrectly… I set the &lt;strong&gt;ActiveX.Dock = Fill&lt;/strong&gt;, but it wasn’t filling the &lt;strong&gt;region&lt;/strong&gt;.&amp;#160; I sat there for a good hour or so trying to figure this one out… No matter what I did, it just wouldn’t fill the damn &lt;strong&gt;region&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;I then decided to create a little test program to see where the issue could possibly be.&amp;#160; I added a &lt;strong&gt;WindowsFormHost&lt;/strong&gt; and a reference to the &lt;strong&gt;ActiveX&lt;/strong&gt; component.&amp;#160; It filled fine!&amp;#160; Ok, maybe it’s because the &lt;strong&gt;region&lt;/strong&gt; in my application is wrapped with a &lt;strong&gt;T&lt;/strong&gt;&lt;strong&gt;abcontrol&lt;/strong&gt;.&amp;#160; I wrapped the &lt;strong&gt;WindowsFormHost&lt;/strong&gt; with the &lt;strong&gt;TabControl&lt;/strong&gt; and it still filled correctly.&amp;#160; Wait, to add a &lt;strong&gt;region&lt;/strong&gt; to your &lt;strong&gt;shell&lt;/strong&gt;, you need to specify what the region is hosted in, which is either an &lt;strong&gt;ItemsControl&lt;/strong&gt; or &lt;strong&gt;ContentControl&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;It turns out that I used &lt;strong&gt;ItemsControls&lt;/strong&gt; to host my &lt;strong&gt;regions&lt;/strong&gt; (because the tutorial used those as well).&amp;#160; I then tried switching my &lt;strong&gt;region&lt;/strong&gt; hosts to &lt;strong&gt;ContentControls&lt;/strong&gt; and now my &lt;strong&gt;ActiveX&lt;/strong&gt; component fills as it should… Sheesh.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-1389800462584843037?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/1389800462584843037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=1389800462584843037' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1389800462584843037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1389800462584843037'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/my-prism-journey-part-1.html' title='My Prism Journey (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5080958464071799328</id><published>2010-09-16T13:41:00.001-07:00</published><updated>2010-09-16T13:47:56.857-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB + C# Adventures (Part 2)</title><content type='html'>&lt;p&gt;We’re using &lt;strong&gt;Visual Studio 2010&lt;/strong&gt; so all of my gripes, comparisons, etc will be based on that.&amp;#160; &lt;/p&gt;  &lt;p&gt;The biggest thing I noticed right off the bat is in the IDE.&amp;#160; &lt;strong&gt;C#&lt;/strong&gt;&amp;#160;&lt;strong&gt;Intellisense&lt;/strong&gt; is kind of clunky compared to its &lt;strong&gt;VB&lt;/strong&gt; counterpart.&amp;#160; I found this kind of weird…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;C# Syntax&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I’m finding myself using parentheses where I should be using brackets, but it’s rare.&amp;#160; &lt;/p&gt;  &lt;p&gt;I miss the &lt;strong&gt;With&lt;/strong&gt; construct that’s in &lt;strong&gt;VB&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;I sometimes declare my variable name before the type.&lt;/p&gt;  &lt;p&gt;Semi-colons…don’t forget those!&lt;/p&gt;  &lt;p&gt;Curly-braces galore!&lt;/p&gt;  &lt;p&gt;I find the syntax to be a bit more cryptic.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;VB Syntax&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;More verbose, but I find it easier to read (this is just personal preference I guess).&lt;/p&gt;  &lt;p&gt;Gotta love direct access to &lt;strong&gt;My.Settings&lt;/strong&gt; and &lt;strong&gt;My.Resources&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;No need to &lt;strong&gt;break&lt;/strong&gt; after every case in &lt;strong&gt;Select&lt;/strong&gt; (&lt;strong&gt;Switch&lt;/strong&gt;) statements.&lt;/p&gt;  &lt;p&gt;Delegate parameters need an &lt;strong&gt;AddressOf&lt;/strong&gt; identifier when passing into a method, whereas &lt;strong&gt;C#&lt;/strong&gt; you just pass in the method.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5080958464071799328?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5080958464071799328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5080958464071799328' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5080958464071799328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5080958464071799328'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/vb-c-adventures-part-2.html' title='VB + C# Adventures (Part 2)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8077015511847773775</id><published>2010-09-16T13:15:00.001-07:00</published><updated>2010-09-16T13:23:24.322-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>VB + C# Adventures (Part 1)</title><content type='html'>&lt;p&gt;I’ll be starting a new series documenting my experiences with using &lt;strong&gt;VB&lt;/strong&gt; and &lt;strong&gt;C#&lt;/strong&gt; simultaneously.&amp;#160; This isn’t meant to be a &lt;a href="http://www.harding.edu/fmccown/vbnet_csharp_comparison.html"&gt;comparison&lt;/a&gt; between the languages, but rather just a non-technical (as can be anyway) dump of the things that are going through my head as I use both languages.&amp;#160; I’m sure this has been done before, but this ought to be fun anyway.&lt;/p&gt;  &lt;p&gt;Some personal background…&lt;/p&gt;  &lt;p&gt;Back when I was in college, I learned &lt;strong&gt;C++&lt;/strong&gt; as my first language.&amp;#160; Of course there was some minor &lt;strong&gt;SPARC&lt;/strong&gt; assembly (like I really remember any of that…) and later &lt;strong&gt;Java&lt;/strong&gt; as required by whichever classes I was taking.&amp;#160; I had extremely light exposure to &lt;strong&gt;VB6&lt;/strong&gt; in my senior year in one of my design classes.&amp;#160; We did &lt;strong&gt;UML &lt;/strong&gt;diagrams and we tied it into a &lt;strong&gt;VB&lt;/strong&gt; skeleton with absolutely no requirement to write any code.&amp;#160; I literally wrote zero lines of &lt;strong&gt;VB&lt;/strong&gt; code in that class.&lt;/p&gt;  &lt;p&gt;My first professional job was at a mortgage company and the environment was &lt;strong&gt;VB6&lt;/strong&gt;.&amp;#160; It didn’t take long for me to get adjusted, but I found &lt;strong&gt;VB6 &lt;/strong&gt;a little odd as it went against most of the guiding principles I learned in college as to how to write a program.&amp;#160; Anyway, I’m not going to jump onto the “bash &lt;strong&gt;VB&lt;/strong&gt;” train because that train is full…&lt;/p&gt;  &lt;p&gt;Since &lt;strong&gt;VB6&lt;/strong&gt; was on my resume, my proceeding jobs were also related to me using &lt;strong&gt;VB6&lt;/strong&gt;.&amp;#160; I didn’t mind it, but at the same time I wasn’t really learning anything new… I guess you can say that I started getting bored.&amp;#160; &lt;/p&gt;  &lt;p&gt;Fast forward to my current job.&amp;#160; When I first started here, I had zero professional experience with &lt;strong&gt;.NET&lt;/strong&gt;.&amp;#160; I’ve always wanted to get into it, but opportunities seemed slim for me given that I had no professional experience in &lt;strong&gt;.NET &lt;/strong&gt;(catch 22…, but it’s worse for game developers).&amp;#160; I did do some studying on my own in &lt;strong&gt;C#&lt;/strong&gt;, but I wasn’t about to lie and say that I had real-world &lt;strong&gt;.NET&lt;/strong&gt; experience.&amp;#160; I was very fortunate to come across a job listing for my current position and also for the fact that &lt;a href="http://coolthingoftheday.blogspot.com/"&gt;Greg&lt;/a&gt; gave me a shot.&lt;/p&gt;  &lt;p&gt;Jumping from &lt;strong&gt;VB6&lt;/strong&gt; to &lt;strong&gt;VB.NET&lt;/strong&gt; wasn’t difficult.&amp;#160; I guess it was because I had retained some of the objected-oriented knowledge from college and the syntax between the two wasn’t too different.&amp;#160; I was (and still am) excited to learn something new for a change.&amp;#160; So far, doing things in &lt;strong&gt;C#&lt;/strong&gt; isn’t too difficult for me.&amp;#160; I had some prior experience with &lt;strong&gt;C&lt;/strong&gt;-style syntax already and I know the&lt;strong&gt; .NET&lt;/strong&gt; framework from doing things in&lt;strong&gt; VB.NET&lt;/strong&gt; already.&lt;/p&gt;  &lt;p&gt;I feel that a good carpenter can build a great house with any brand of tools you give them.&amp;#160; The same holds true in the case of a good&lt;strong&gt; .NET&lt;/strong&gt; developer (or any developer for that matter).&amp;#160; A good or bad developer will be a good or bad developer regardless of what language they are using.&amp;#160; This is why I really don’t understand the &lt;strong&gt;C#&lt;/strong&gt; snobbery I see a lot of.&amp;#160; Both languages have their pros and cons, but in the end it’s the result that matters.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8077015511847773775?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8077015511847773775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8077015511847773775' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8077015511847773775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8077015511847773775'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/09/vb-c-adventures-part-1.html' title='VB + C# Adventures (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3451753034675655818</id><published>2010-08-17T08:14:00.001-07:00</published><updated>2010-08-17T08:14:49.603-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>Visual Studio 2010, When “Save All” Doesn’t Mean “Save All”</title><content type='html'>&lt;p&gt;I found a minor bug related to the &lt;strong&gt;Save All &lt;/strong&gt;functionality while updating our build definitions.&amp;#160; A new project was added to our TFS and this needed to be cloaked for all of our existing build definitions.&amp;#160; No problem, just add the path, set it to &lt;strong&gt;cloaked&lt;/strong&gt;, and copy the line so you can easily paste it in your next build definition without having to pick the path.&amp;#160; &lt;/p&gt;  &lt;p&gt;I did this for five of our definitions and I decided to go back to the first one for some reason to double check.&amp;#160; Why didn’t the path get saved?&amp;#160; I hit &lt;strong&gt;Save All&lt;/strong&gt; and didn’t get a prompt when I closed the build definitions, so what gives?&amp;#160; Okay, maybe it was a glitch or something so I did it again, this time I tried using the regular &lt;strong&gt;Save &lt;/strong&gt;instead of &lt;strong&gt;Save All&lt;/strong&gt;.&amp;#160; This time my build definitions were updated.&amp;#160; &lt;/p&gt;  &lt;p&gt;It seems like there’s a bug with &lt;strong&gt;Save All &lt;/strong&gt;and updating build definitions.&amp;#160; I submitted the issue to Microsoft, but they want a video… I’m always wary about submitting anything work related to the public domain so I had to decline.&amp;#160; Hopefully the issue gets resolved, but in the meantime if anybody else is having the same issue, just hit &lt;strong&gt;Save&lt;/strong&gt; instead.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3451753034675655818?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3451753034675655818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3451753034675655818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3451753034675655818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3451753034675655818'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/08/visual-studio-2010-when-save-all-doesnt.html' title='Visual Studio 2010, When “Save All” Doesn’t Mean “Save All”'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3002043018629454743</id><published>2010-08-09T13:26:00.001-07:00</published><updated>2010-08-09T13:27:53.600-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>The Reappearing Breakpoint (VS2010)</title><content type='html'>&lt;p&gt;Today I somehow made VS2010 crash in the middle of debugging.&amp;#160; After I reopened my project, I noticed that a breakpoint that I had deleted previously kept on showing up.&amp;#160; Needless to say this was quite confusing since I removed it.&amp;#160; No problem, I’ll just remove it again…&lt;/p&gt;  &lt;p&gt;Whenever I ran my application in debug mode, the breakpoint would magically reappear! I thought maybe it was a glitch, so I just closed and reopened my project.&amp;#160; F5 and why is it reappearing when I just deleted it?&amp;#160; Okay, I’ll just shut down VS and reopen it… F5, OMG why won’t you go away?!&amp;#160; &lt;/p&gt;  &lt;p&gt;Debug-&amp;gt;Delete All Breakpoints fixed it… life’s a glitch.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3002043018629454743?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3002043018629454743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3002043018629454743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3002043018629454743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3002043018629454743'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/08/reappearing-breakpoint-vs2010.html' title='The Reappearing Breakpoint (VS2010)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3672448746546359319</id><published>2010-06-09T13:22:00.001-07:00</published><updated>2010-06-23T09:04:17.609-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>VS2008 to VS2010 Upgrade Notes</title><content type='html'>&lt;p&gt;&lt;strong&gt;UPDATE 6/23/2010:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The issue with one of our setup project builds has been successfully resolved with a workaround that I thought didn’t work at first.&amp;#160; It turns out our Microsoft contact couldn’t reproduce the issue.&amp;#160; It was the end of the day so I decided to shelve this issue until this morning.&amp;#160; I tried running the setup project from my XP machine with the workaround and it worked.&amp;#160; More importantly, I ran it on our build machine and it worked!&amp;#160; The thing that threw me off was that it failed on my Windows 7 development machine, which is where I initially tested the issue.&amp;#160; I suspect it might have to do with the fact that the interop assemblies were actually built on my old XP development environment and that something isn’t jiving now when I use the same assemblies to build on my Windows 7 machine.&amp;#160; In any case, copying the interop dlls to the same path as the &lt;strong&gt;vdproj&lt;/strong&gt; file works like a charm.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Using the latest and greatest development environment is always fun.&amp;#160; However, upgrading from a previous version isn’t always easy.&amp;#160; When we converted our dev environment from VS2005 to VS2008, there were a number of headaches to get everything working properly.&amp;#160; So far, upgrading to VS2010 from VS2008 is proving no different.&amp;#160; Since we’re still on TFS2008, we used &lt;a href="http://blogs.msdn.com/b/willbar/archive/2009/11/01/building-net-4-0-applications-using-team-build-2008.aspx"&gt;this&lt;/a&gt; workaround to build VS2010 solutions on our Build machines.&amp;#160; &lt;/p&gt;  &lt;p&gt;So after our build machines had VS2010 installed and the above &lt;strong&gt;MSBuildPath&lt;/strong&gt; workaround was applied, I ran my first build.&amp;#160; It was a ClickOnce build and it actually ran without any issues.&amp;#160; The application compiled and everything got copied over to our drop location…Cool!&amp;#160; So then I tried running our MSI build for the same project.&amp;#160; I was expecting it to build fine since the ClickOnce build is a little bit more complex, but the MSI build failed.&amp;#160; After thoroughly checking all settings in the Setup project, I couldn’t figure out why it was failing.&amp;#160; The only reason in the BuildLog.txt was &lt;strong&gt;EXEC : error : Unable to update the dependencies of the project.&amp;#160; &lt;/strong&gt;Could the message be a bit more vague, please?&lt;/p&gt;  &lt;p&gt;After searching the web, it seemed others were having the same &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/552799"&gt;problem&lt;/a&gt;.&amp;#160; The workarounds suggested on that page didn’t work for us.&amp;#160; So instead of waiting around, we decided to open up a support ticket, which our contact at Microsoft is currently looking into.&amp;#160; I had a feeling that Interop assemblies in our project might be causing the problem, but it wasn’t until today that my suspicion was gaining ground.&amp;#160; We have a few projects that have MSI builds, so I went ahead and converted and built those out.&amp;#160; What do you know?&amp;#160; The MSI builds that don’t have Interop assemblies build fine on our build machine.&amp;#160; We’re still waiting for a real solution to this problem, until then, we’re building the MSI package locally for that one project.&lt;/p&gt;  &lt;p&gt;Another one of our builds has unit tests.&amp;#160; I ran this project’s build without the unit tests first and it completed.&amp;#160; I then ran the build with the unit tests and 99.9% of the unit tests failed, but not all of them, which was weird to me.&amp;#160; These unit tests passed completely when we were using VS2008, so maybe the MSTest reference needed to be updated or something.&amp;#160; I searched MSDN and found this &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/92716892-87d0-430c-b421-e2c80bb3e038"&gt;post&lt;/a&gt; about the same exact issue we were having.&amp;#160; I tried the solutions suggested, but they didn’t work.&amp;#160; There were some other odd issues with the build with the unit tests, so I just decided to delete the workspace associated with that build.&amp;#160; After I did this, the unit tests passed and everything looked good.&lt;/p&gt;  &lt;p&gt;I hope when we upgrade our TFS2008 to TFS2010, that there aren’t going to be more issues.&amp;#160; I have my fingers crossed…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3672448746546359319?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3672448746546359319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3672448746546359319' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3672448746546359319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3672448746546359319'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/06/vs2008-to-vs2010-upgrade-notes.html' title='VS2008 to VS2010 Upgrade Notes'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2009729087611644307</id><published>2010-04-05T09:08:00.001-07:00</published><updated>2010-04-05T09:08:37.703-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Running an Interactive Application Through a Windows Service</title><content type='html'>&lt;p&gt;Have a need to run an interactive application through a Windows Service?&amp;#160; I do and I did a LOT of searching on the Internet and the answer I found was that it can’t be done anymore ever since Windows Vista was released.&lt;/p&gt;  &lt;p&gt;A lot of people on MSDN asked this question, but couldn’t seem to get it to work either.&amp;#160; I just assumed that it couldn’t be done since nobody else couldn’t get it to work either.&amp;#160; &lt;/p&gt;  &lt;p&gt;Luckily, I asked this question myself on one of the MSDN forums and a MSFT moderator was able to point me to this blog: &lt;a href="http://asprosys.blogspot.com/2009/03/allow-service-to-interact-with-desktop.html" target="_blank"&gt;http://asprosys.blogspot.com/2009/03/allow-service-to-interact-with-desktop.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thankfully, Stephen Martin was able to get the problem solved and even has some sample code to show you that it does work as it should.&amp;#160; It’s in &lt;strong&gt;C#&lt;/strong&gt;, but you can always translate it to &lt;strong&gt;VB&lt;/strong&gt; if you need to.&amp;#160; I personally used a converter found here: &lt;a href="http://dotnetspider.com/codeconvert/Default.aspx" target="_blank"&gt;http://dotnetspider.com/codeconvert/Default.aspx&lt;/a&gt;.&amp;#160; The converter isn’t perfect, but it only had a few things that needed to be fixed.&lt;/p&gt;  &lt;p&gt;One issue I had though was with running a &lt;strong&gt;.cmd&lt;/strong&gt; file (I imagine the same issue would happen for &lt;strong&gt;.com/.bat&lt;/strong&gt; files also).&amp;#160; For some reason, running the &lt;strong&gt;CreateProcessAsUser&lt;/strong&gt; would show the command window then disappear.&amp;#160; My &lt;strong&gt;.cmd&lt;/strong&gt; file was a long file name with spaces so I thought maybe that had something to do with it.&amp;#160; I included double quotes around my command string like this:&amp;#160; &lt;strong&gt;cmd.exe /c “C:\This Is a Long Path\command.cmd”&amp;#160; &lt;/strong&gt;The &lt;strong&gt;.cmd&lt;/strong&gt; file would not run.&amp;#160; &lt;/p&gt;  &lt;p&gt;Scratching my head, I put the above string in the &lt;strong&gt;Windows Run&lt;/strong&gt; and tried to run it.&amp;#160; It wouldn’t run here either… I then tried putting the &lt;strong&gt;.cmd&lt;/strong&gt; file in the root of my &lt;strong&gt;C:\&lt;/strong&gt; and tried running it like this: &lt;strong&gt;cmd.exe /c “C:\command.cmd”&lt;/strong&gt;&amp;#160; This ran fine.&amp;#160; I figured that since both &lt;strong&gt;CreateProcessAsUser&lt;/strong&gt; and &lt;strong&gt;Windows Run&lt;/strong&gt; were having the same issue, it was a good thing.&amp;#160; &lt;/p&gt;  &lt;p&gt;After much playing around with the string and a lot of frustration, I tried the following: &lt;strong&gt;cmd.exe /c “”C:\This Is a Long Path\command.cmd”&lt;/strong&gt;&amp;#160; This worked… I’m not too sure why the double quotes are needed twice before the long file name though…&amp;#160; This also works with the &lt;strong&gt;.cmd&lt;/strong&gt; file that was in the root of my &lt;strong&gt;C:\ &lt;/strong&gt;like this: &lt;strong&gt;cmd.exe /c “”C:\command.cmd”&lt;/strong&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2009729087611644307?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2009729087611644307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2009729087611644307' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2009729087611644307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2009729087611644307'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/04/running-interactive-application-through.html' title='Running an Interactive Application Through a Windows Service'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2549060773604902790</id><published>2010-03-11T11:19:00.001-08:00</published><updated>2010-03-11T13:03:00.606-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><title type='text'>WinForms/WPF Interop ElementHost Not Drawing The WPF Control!</title><content type='html'>&lt;p&gt;&lt;strong&gt;&amp;lt;Edit&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It turns out it wasn’t externalizing the WPF control that solved the issue, but rather changing my build configuration to Release instead of Debug.&amp;#160; When I added the externalized assembly, I set the configuration to Release.&amp;#160; I’m not sure exactly why a debug build would cause this behavior…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;lt;/Edit&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;lt;Edit 2&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It seems to work properly on Windows XP regardless of the build configuration.&amp;#160; Might be a Windows 7 thing…&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&amp;lt;/Edit 2&amp;gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I’ve been doing a lot of &lt;strong&gt;WPF&lt;/strong&gt; work lately and a lot of it has been with &lt;strong&gt;WinForms&lt;/strong&gt; interoperating with &lt;strong&gt;WPF&lt;/strong&gt;.&amp;#160; Today I noticed some odd behavior when I tried to add a &lt;strong&gt;WPF&lt;/strong&gt; control to a &lt;strong&gt;WinForms&lt;/strong&gt; &lt;strong&gt;ElementHost&lt;/strong&gt; object…&lt;/p&gt;  &lt;p&gt;Usually I put the &lt;strong&gt;WPF&lt;/strong&gt; control in a separate assembly, but today I thought I didn’t need to since it was just a very simple control.&amp;#160; Immediately I saw that the &lt;strong&gt;WPF&lt;/strong&gt; control wouldn’t draw itself properly for some reason.&amp;#160; It would only draw itself sometimes, but if i clicked on the &lt;strong&gt;WPF&lt;/strong&gt; control and somehow hit a &lt;strong&gt;Button&lt;/strong&gt; or &lt;strong&gt;ComboBox&lt;/strong&gt;, the control would show up.&lt;/p&gt;  &lt;p&gt;I then decided to try and put the simple control in its own assembly and that solved the problem… It looks like there’s some issues with including a &lt;strong&gt;WPF&lt;/strong&gt; control in a &lt;strong&gt;WinForms&lt;/strong&gt; project directly, in my case anyway.&amp;#160; I’m using Visual Studio 2008 on Win7 x86 and if anybody else has this type of issue, try doing what I did to resolve the issue.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2549060773604902790?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2549060773604902790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2549060773604902790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2549060773604902790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2549060773604902790'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2010/03/winformswpf-interop-elementhost-not.html' title='WinForms/WPF Interop ElementHost Not Drawing The WPF Control!'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-610261563865997371</id><published>2009-12-09T15:24:00.001-08:00</published><updated>2009-12-09T15:24:25.103-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio IDE Tab Spacing</title><content type='html'>&lt;p&gt;Don’t you hate it when you get some source code and the tab spacing is different than yours?&amp;#160; I know I do.&amp;#160; You could go line by line and press backspace, which is not the smartest way to do it (I was guilty of this). &lt;/p&gt;  &lt;p&gt;Here’s the much simpler way to get the tabs aligned:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_jBiTiK8T3Jc/SyAxpaof1-I/AAAAAAAAAMY/LmhO_fMuzL4/s1600-h/tabspacing%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="tabspacing" border="0" alt="tabspacing" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/SyAxqCRlfUI/AAAAAAAAAMk/ju4BEZwNVGg/tabspacing_thumb%5B1%5D.png?imgmax=800" width="452" height="183" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-610261563865997371?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/610261563865997371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=610261563865997371' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/610261563865997371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/610261563865997371'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/12/visual-studio-ide-tab-spacing.html' title='Visual Studio IDE Tab Spacing'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_jBiTiK8T3Jc/SyAxqCRlfUI/AAAAAAAAAMk/ju4BEZwNVGg/s72-c/tabspacing_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8625054233438567888</id><published>2009-11-18T09:48:00.001-08:00</published><updated>2009-11-18T09:48:55.597-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>TFS folders and the evil “&amp;”</title><content type='html'>&lt;p&gt;So I tried to make a folder within TFS called “&lt;strong&gt;R&amp;amp;D&lt;/strong&gt;”&lt;strong&gt; &lt;/strong&gt;and it let me.&amp;#160; No surprises…yet.&amp;#160; After moving a project into this folder, I ran the project to make sure all paths/references were still intact.&amp;#160; The project ran fine so things seemed okay.&amp;#160; &lt;/p&gt;  &lt;p&gt;It wasn’t until I tried opening a form up in Designer view that I got a weird error:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_jBiTiK8T3Jc/SwQzhnDGLZI/AAAAAAAAALQ/aHg_I8JB7NQ/s1600-h/DesignerError%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="DesignerError" border="0" alt="DesignerError" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/SwQzh2O6UBI/AAAAAAAAALU/iXzIyLpj8WE/DesignerError_thumb.png?imgmax=800" width="244" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;How is it that the project can build and run fine, but I’m seeing this?&amp;#160; XML?&amp;#160; I don’t have anything related to XML in the form code, so what gives?&amp;#160; After doing some searching on the internet, it seems that the “&lt;strong&gt;&amp;amp;&lt;/strong&gt;” character anywhere in the path causes this issue.&amp;#160; Since my project was in the “&lt;strong&gt;R&amp;amp;D”&lt;/strong&gt; folder, I was having this issue.&amp;#160; I renamed the folder and the problem went away…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8625054233438567888?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8625054233438567888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8625054233438567888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8625054233438567888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8625054233438567888'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/11/tfs-folders-and-evil.html' title='TFS folders and the evil “&amp;amp;”'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_jBiTiK8T3Jc/SwQzh2O6UBI/AAAAAAAAALU/iXzIyLpj8WE/s72-c/DesignerError_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-7542203565812459278</id><published>2009-10-29T10:27:00.001-07:00</published><updated>2009-10-29T10:31:06.093-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><title type='text'>WPF Data Binding – ComboBox Items List</title><content type='html'>&lt;p&gt;As I learn WPF I’m running into quite a few roadblocks, but I’m enjoying the fact that it’s a challenge and something new.&amp;#160; One of the things I’m trying to get used to is Data Binding to the WPF UI.&amp;#160; I’m also trying to learn WPF the MVVM way.&amp;#160; There are a lot of examples on how to do this on the web so I’ll just get to what got me stuck for a bit on ComboBox items binding.&amp;#160; Here’s some of my UI XAML and my code behind:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;DockPanel&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;42&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;TopDockPanel&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;auto&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DockPanel&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;Dock&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Top&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;LastChildFill&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;auto&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Grid1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;266&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DockPanel&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;Dock&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Left&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;7,7,0,9&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;71&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Combo1:&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ComboBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{Binding ComboList1}&amp;quot;&lt;/span&gt;  &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;84,9,22,13&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;SelectionChanged&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Combo1_SelectionChanged&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;auto&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Grid2&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;281&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Label&lt;/span&gt; &lt;span style="color: #ff0000"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Left&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;6,7,0,9&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;89&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Combo2:&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Label&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ComboBox&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ItemsSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;{Binding ComboList2}&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Margin&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;101,9,20,13&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;IsEditable&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;False&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;auto&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Grid3&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;auto&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;DockPanel&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; SomeClass&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; _SomeClassVM &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; SomeClassViewModel = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;' This call is required by the Windows Form Designer.&lt;/span&gt;&lt;br /&gt;    InitializeComponent()&lt;br /&gt;    &lt;span style="color: #008000"&gt;' Add any initialization after the InitializeComponent() call.&lt;/span&gt;&lt;br /&gt;    _SomeClassVM = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; SomeClassViewModel&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Me&lt;/span&gt;.DataContext = _SomeClassVM&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;/p&gt;&lt;p&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Combo1_SelectionChanged(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.Windows.Controls.SelectionChangedEventArgs)&lt;br /&gt;    _SomeClassVM.Combo1Changed(sender)&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;

&lt;p&gt;Nothing complicated, a simple MVVMish implementation (ish because there’s event handler code in the code behind file, I’ll be refactoring this as I go on).&amp;#160; My View Model implements the &lt;strong&gt;INotifyPropertyChanged&lt;/strong&gt; Interface so that the UI can be notified of any property changes and update any data bindings as needed.&amp;#160; My View Model also exposes a couple of Public Properties: &lt;strong&gt;ComboList1&lt;/strong&gt; and &lt;strong&gt;ComboList2&lt;/strong&gt; which are &lt;strong&gt;List (Of String)&lt;/strong&gt; objects:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 100.8%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 210px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; height: 455px; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;p&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; SomeClassViewModel&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Implements&lt;/span&gt; INotifyPropertyChanged&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; _ComboList1 &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; _ComboList2 &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;/p&gt;&lt;p&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt; ComboList1() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; _ComboList1&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt; ComboList2() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; _ComboList2&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()&lt;br /&gt;    _ComboList1 = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; ItemsList &lt;span style="color: #008000"&gt;'this is just a list of strings from anywhere&lt;/span&gt;&lt;br /&gt;      _ComboList1.Add(item)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    OnPropertyChanged(&lt;span style="color: #006080"&gt;&amp;quot;SQLServerList&amp;quot;&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    _ComboList2 = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Combo1Changed(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;)&lt;br /&gt;    _ComboList2.Clear()&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; SomeOtherList &lt;span style="color: #008000"&gt;'this is just list of string from another place&lt;/span&gt;&lt;br /&gt;      _ComboList2.Add(sqlDatabase)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    OnPropertyChanged(&lt;span style="color: #006080"&gt;&amp;quot;ComboList2&amp;quot;&lt;/span&gt;)&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Event&lt;/span&gt; PropertyChanged(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; e &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.ComponentModel.PropertyChangedEventArgs) &lt;span style="color: #0000ff"&gt;Implements&lt;/span&gt; System.ComponentModel.INotifyPropertyChanged.PropertyChanged&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; OnPropertyChanged(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; propertyName &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;RaiseEvent&lt;/span&gt; PropertyChanged(&lt;span style="color: #0000ff"&gt;Me&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; PropertyChangedEventArgs(propertyName))&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Class&lt;/p&gt;&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Now, I thought that clearing and adding items to my &lt;strong&gt;ComboList2&lt;/strong&gt; object would suffice in propagating change notifications up to the UI…WRONG.&amp;#160; It seems there’s more to it than just clearing/adding to the list and raising the &lt;strong&gt;PropertyChanged&lt;/strong&gt; event.&amp;#160; This implementation only notified the UI that &lt;strong&gt;ComboList2&lt;/strong&gt; changed once at the first time I changed &lt;strong&gt;ComboBox1&lt;/strong&gt;’s selected item instead of each time.&amp;#160; What gives?&lt;/p&gt;

&lt;p&gt;After some fiddling I found that I couldn’t use the current &lt;strong&gt;_ComboList2&lt;/strong&gt; object reference.&amp;#160; I had to actually set the&lt;strong&gt; _ComboList2&lt;/strong&gt; object to a new List for the UI to update:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Combo1Changed(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; NewList &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; SomeOtherList &lt;span style="color: #008000"&gt;'this is just list of string from another place&lt;/span&gt;&lt;br /&gt;      NewList.Add(item)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    _ComboList2 = NewList&lt;br /&gt;    OnPropertyChanged(&lt;span style="color: #006080"&gt;&amp;quot;ComboList2&amp;quot;&lt;/span&gt;)&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Sub&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;There’s a more elegant way to solve the issue I had, which is to use an &lt;strong&gt;ObservableCollection&lt;/strong&gt; instead of &lt;strong&gt;List (Of String)&lt;/strong&gt; objects:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Class&lt;/span&gt; SomeClassModel&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; _ComboList1 &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; _ComboList2 &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt; ComboList1() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; _ComboList1&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;ReadOnly&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt; ComboList2() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; _ComboList2&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Get&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Property&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt;()&lt;br /&gt;    _ComboList1 = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; ItemsList &lt;span style="color: #008000"&gt;'this is just a list of strings from anywhere&lt;/span&gt;&lt;br /&gt;      _ComboList1.Add(item)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    _ComboList2 = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; ObservableCollection(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; Combo1Changed(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; sender &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.&lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;)&lt;br /&gt;    _ComboList2.Clear&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; item &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; SomeOtherList &lt;span style="color: #008000"&gt;'this is just list of string from another place&lt;/span&gt;&lt;br /&gt;      _ComboList2.Add(item)&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Class&lt;/pre&gt;

  &lt;br /&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;You’ll notice a couple of things.&amp;#160; The first being that the View Model no longer needs &lt;strong&gt;INotifyPropertyChanged&lt;/strong&gt;.&amp;#160; This is because &lt;strong&gt;ObservableCollection&lt;/strong&gt; implements &lt;strong&gt;INotifyPropertyChanged&lt;/strong&gt; (and &lt;strong&gt;INotifyCollectionChanged&lt;/strong&gt;).&amp;#160; You’ll also notice that I was able to just clear/add to &lt;strong&gt;_ComboList2&lt;/strong&gt; without having to raise any events.&amp;#160; The UI updated as expected and I suspect it’s because when clearing or adding items to the &lt;strong&gt;ObservableCollection&lt;/strong&gt;, properties such as &lt;strong&gt;count&lt;/strong&gt; raise the &lt;strong&gt;PropertyChanged&lt;/strong&gt; event properly.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-7542203565812459278?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/7542203565812459278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=7542203565812459278' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7542203565812459278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7542203565812459278'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/10/wpf-data-binding-combobox-items-list.html' title='WPF Data Binding – ComboBox Items List'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-6908977499496700384</id><published>2009-10-13T15:09:00.001-07:00</published><updated>2009-10-13T15:09:19.780-07:00</updated><title type='text'>Error in last post. Think of it as a what not to do :)</title><content type='html'>&lt;h5&gt;It turns out that pointing to a file with an Interface inside of it doesn’t work as intended (oops! :/).&amp;#160; Although you can implement the Interface, problems arise when you try to cast it since they’re interfaces in different namespaces…&amp;#160; It looks like you will have to point all libraries that need the interface to a single project that has the Interface you need.&lt;/h5&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-6908977499496700384?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/6908977499496700384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=6908977499496700384' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6908977499496700384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6908977499496700384'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/10/error-in-last-post-think-of-it-as-what.html' title='Error in last post. Think of it as a what not to do :)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5618777567647953894</id><published>2009-10-13T15:05:00.000-07:00</published><updated>2009-10-13T15:08:15.241-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><title type='text'>Sharing an Interface (What not to do)</title><content type='html'>&lt;p&gt;Have you ever had a class library that uses an Interface?&amp;#160; How about two or more libraries that need to use the same Interface?&amp;#160; For instance, &lt;strong&gt;ClassLibrary1 &lt;/strong&gt;and &lt;strong&gt;ClassLibrary2&lt;/strong&gt; need to implement &lt;strong&gt;ISomeInterface&lt;/strong&gt; below:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_jBiTiK8T3Jc/StTntBwSfmI/AAAAAAAAAKQ/5QpWoShhdIM/s1600-h/Interface1%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface1" border="0" alt="Interface1" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/StTntTGWDZI/AAAAAAAAAKU/zpYK8BUOl54/Interface1_thumb%5B1%5D.png?imgmax=800" width="233" height="112" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Instead of copying &lt;strong&gt;ISomeInterface.vb &lt;/strong&gt;to both &lt;strong&gt;ClassLibrary&lt;/strong&gt; projects or adding a project reference, you can add a link to &lt;strong&gt;ISomeInterface.vb&lt;/strong&gt; and have access to &lt;strong&gt;ISomeInterface&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_jBiTiK8T3Jc/StTnt6qOkLI/AAAAAAAAAKY/N09QLp_7SqE/s1600-h/Interface2%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface2" border="0" alt="Interface2" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/StTnuCyFsfI/AAAAAAAAAKc/6lTSK5jDnRU/Interface2_thumb.png?imgmax=800" width="244" height="190" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/StTnufmqLQI/AAAAAAAAAKg/FFMmg9H_6S8/s1600-h/Interface3%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface3" border="0" alt="Interface3" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/StTnunFBypI/AAAAAAAAAKk/t4-Pb4wZ5LE/Interface3_thumb.png?imgmax=800" width="244" height="179" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now you’ll notice that &lt;strong&gt;ISomeInterface.vb &lt;/strong&gt;is part of &lt;strong&gt;ClassLibrary1&lt;/strong&gt; as a linked file:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/StTnuygUaCI/AAAAAAAAAKo/Im5yv6jrAXQ/s1600-h/Interface3%5B5%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface3" border="0" alt="Interface3" src="http://lh5.ggpht.com/_jBiTiK8T3Jc/StTnvCzATCI/AAAAAAAAAKs/nSZX0v3JG4k/Interface3_thumb%5B1%5D.png?imgmax=800" width="244" height="124" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now we can implement &lt;strong&gt;ISomeInterface &lt;/strong&gt;in &lt;strong&gt;ClassLibrary1:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;a href="http://lh6.ggpht.com/_jBiTiK8T3Jc/StTnve8kxGI/AAAAAAAAAKw/B0tGVC9YEX8/s1600-h/Interface4%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Interface4" border="0" alt="Interface4" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/StTnvmFp_KI/AAAAAAAAAK0/viGohwxKigQ/Interface4_thumb.png?imgmax=800" width="244" height="94" /&gt;&lt;/a&gt; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;The benefit of adding the Interface file as a link is that you can maintain the Interface in one location.&amp;#160; You don’t have to worry about having to copy new versions if you decide to change your contract.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5618777567647953894?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5618777567647953894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5618777567647953894' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5618777567647953894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5618777567647953894'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/10/sharing-interface.html' title='Sharing an Interface (What not to do)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_jBiTiK8T3Jc/StTntTGWDZI/AAAAAAAAAKU/zpYK8BUOl54/s72-c/Interface1_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-4177523792121331960</id><published>2009-08-10T10:12:00.001-07:00</published><updated>2009-08-10T10:12:11.821-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>The Best Things In Life Are Free</title><content type='html'>&lt;p&gt;This post by &lt;a href="http://coolthingoftheday.blogspot.com/2009/08/is-there-free-alternate-to-application.html" target="_blank"&gt;Greg&lt;/a&gt; inspired me to post to my blog about some of the free software utilities and applications that I use at home.&amp;#160; Although some of the things I list may not be the absolute best, it really is hard to beat free.&amp;#160; Plus a lot of times the term “best” is used subjectively and this includes software.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.7-zip.org/" target="_blank"&gt;7-Zip&lt;/a&gt; is a compression utility used for packing and unpacking various file formats.&amp;#160; Think of it as an open source &lt;a href="http://www.winzip.com" target="_blank"&gt;WinZip&lt;/a&gt;.&amp;#160; Below is the main feature list from the &lt;a href="http://www.7-zip.org/" target="_blank"&gt;7-Zip&lt;/a&gt; website:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;High compression ratio in new &lt;a href="http://www.7-zip.org/7z.html"&gt;7z format&lt;/a&gt; with &lt;b&gt;LZMA&lt;/b&gt; compression &lt;/li&gt;    &lt;li&gt;Supported formats:      &lt;ul&gt;       &lt;li&gt;Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR &lt;/li&gt;        &lt;li&gt;Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;For ZIP and GZIP formats, &lt;b&gt;7-Zip&lt;/b&gt; provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip &lt;/li&gt;    &lt;li&gt;Strong AES-256 encryption in 7z and ZIP formats &lt;/li&gt;    &lt;li&gt;Self-extracting capability for 7z format &lt;/li&gt;    &lt;li&gt;Integration with Windows Shell &lt;/li&gt;    &lt;li&gt;Powerful File Manager &lt;/li&gt;    &lt;li&gt;Powerful command line version &lt;/li&gt;    &lt;li&gt;Plugin for FAR Manager &lt;/li&gt;    &lt;li&gt;Localizations for 74 languages &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;---------&lt;/p&gt;  &lt;p&gt;Every Windows user needs and anti-virus application.&amp;#160; The one I use is &lt;a href="http://www.avast.com" target="_blank"&gt;Avast&lt;/a&gt; because it seems to be the least intrusive.&amp;#160; I haven’t had a single problem since I began using &lt;a href="http://www.avast.com" target="_blank"&gt;Avast&lt;/a&gt; over a year ago.&amp;#160; Here are some of the features:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Anti-spyware built-in &lt;/li&gt;    &lt;li&gt;Web Shield &lt;/li&gt;    &lt;li&gt;Anti-rootkit built-in &lt;/li&gt;    &lt;li&gt;Automatic updates &lt;/li&gt;    &lt;li&gt;Strong self-protection &lt;/li&gt;    &lt;li&gt;Virus Chest &lt;/li&gt;    &lt;li&gt;Antivirus kernel &lt;/li&gt;    &lt;li&gt;System integration &lt;/li&gt;    &lt;li&gt;Simple User Interface &lt;/li&gt;    &lt;li&gt;Integrated Virus Cleaner &lt;/li&gt;    &lt;li&gt;Resident protection &lt;/li&gt;    &lt;li&gt;Support for 64-bit Windows &lt;/li&gt;    &lt;li&gt;P2P and IM Shields &lt;/li&gt;    &lt;li&gt;Internationalization &lt;/li&gt;    &lt;li&gt;Network Shield &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;---------&lt;/p&gt;  &lt;p&gt;Ever have issues with your OS or feel that your registry has become a bit dirty?&amp;#160; &lt;a href="http://www.ccleaner.com/" target="_blank"&gt;CCleaner&lt;/a&gt; may help you find the issues.&amp;#160; I use it regularly to clean out unnecessary temporary and log files.&amp;#160; I also use it to check for any registry issues:&lt;/p&gt;  &lt;p&gt;“CCleaner is a freeware PC optimization tool.&amp;#160; It combines a system cleaner that removes unused and temporary files from your system and also a fully featured registry cleaner!&amp;#160; CCleaner allows Windows to run faster, more efficiently and gives you more hard disk space.&amp;#160; The best part is that it's Small, Fast and Free!”&lt;/p&gt;  &lt;p&gt;---------&lt;/p&gt;  &lt;p&gt;&lt;a href="http://cdburnerxp.se/" target="_blank"&gt;CDBurnerXP&lt;/a&gt; is one of the best disc burning applications I’ve ever used, free or otherwise.&amp;#160; It handles everything I throw at it without any issues:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;burn all kinds of discs &lt;/li&gt;    &lt;li&gt;audio-CDs with or without gaps between tracks &lt;/li&gt;    &lt;li&gt;burn and create ISO files &lt;/li&gt;    &lt;li&gt;data verification after burning process &lt;/li&gt;    &lt;li&gt;create bootable discs &lt;/li&gt;    &lt;li&gt;multi-language interface &lt;/li&gt;    &lt;li&gt;bin/nrg → ISO converter, simple cover printing and much more! &lt;/li&gt;    &lt;li&gt;Operating Systems: Windows 2000/XP/2003 Server/Vista/Windows 7 &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;--------- &lt;/p&gt;  &lt;p&gt;Hate scratched audio CDs?&amp;#160; I know I do.&amp;#160; I use &lt;a href="http://cdexos.sourceforge.net/" target="_blank"&gt;CDex&lt;/a&gt; to rip from the original disc so that I don’t have to worry about scratching up the original:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Direct recording of multiple tracks &lt;/li&gt;    &lt;li&gt;Read / store album information from/to the cdplayer.ini file &lt;/li&gt;    &lt;li&gt;Read / store album information from/to a local and/or remote CD Database (CDDB) &lt;/li&gt;    &lt;li&gt;Support CD-Text (if your CD-drive supports it) &lt;/li&gt;    &lt;li&gt;Advanced jitter correction (based on the cd-paranoia ripping library) &lt;/li&gt;    &lt;li&gt;Indicates track progress and jitter control &lt;/li&gt;    &lt;li&gt;Normalization of audio signal &lt;/li&gt;    &lt;li&gt;Supports many CD-Drive from many manufacters &lt;/li&gt;    &lt;li&gt;Conversion of external WAV files &lt;/li&gt;    &lt;li&gt;Support for M3U and PLS play list files &lt;/li&gt;    &lt;li&gt;Best of all, it's free (GPL license, source code available) &lt;/li&gt;    &lt;li&gt;Serveral languages are supported &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;--------- &lt;/p&gt;  &lt;p&gt;Into news feeds?&amp;#160; Then you should be using &lt;a href="www.NewsGator.com/FeedDemon" target="_blank"&gt;FeedDemon&lt;/a&gt;.&amp;#160; It will sync to your Google Reader account:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Newspaper Format&lt;/strong&gt;: When you select a channel, FeedDemon's tabbed browser displays the channel's news items in a newspaper for easy reading. You can display a newspaper of news items for an entire folder or view one feed at a time. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;News Bins&lt;/strong&gt;: Store news items in a central location and provide a handy way to collect items from different channels. If you find an interesting item that you might want to read again, just store it in a news bin for future reference. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Shared Experience&lt;/strong&gt;: See what news is popular with other NewsGator users and find out who is linking to the news you’re reading. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Video&lt;/strong&gt;: Watch embedded video right within the newspaper view. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Panic Button&lt;/strong&gt;: Ever gone on vacation and gotten a little behind on your reading? The Panic Button solves this and many other problems by quickly marking all older items read. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Watches&lt;/strong&gt;: Look for keywords in news items as they're downloaded. After you create a watch, it examines every incoming news item whenever any channel is updated. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;News Comes To You&lt;/strong&gt;: Subscribe to feeds from all over the web or choose some of the dozens of default feeds. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;: Search outside of FeedDemon's subscriptions by selecting a feed search engine, then enter your keyword, and FeedDemon will subscribe to a dynamic channel containing the search results for that keyword. &lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Podcasts&lt;/strong&gt;: Powerful podcasting tools enable you to download audio files and automatically copy them to your iPod or other media player. The bundled FeedStation utility enables you to schedule your downloads so they happen overnight while you're asleep. When you wake up, you'll find new audio waiting on your media player of choice. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;--------- &lt;/p&gt;  &lt;p&gt;Is Photoshop a bit too expensive for you?&amp;#160; Try &lt;a href="http://paint.net/" target="_blank"&gt;Paint.NET&lt;/a&gt;.&amp;#160; I use it for editing images, creating icons, and a myriad of other minor image tasks.&amp;#160; A true power user can do much more than I can with it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Simple, intuitive, and innovative user interface      &lt;br /&gt;Every feature and user interface element was designed to be immediately intuitive and quickly learnable without assistance. In order to handle multiple images easily, Paint.NET uses a tabbed document interface. The tabs display a live thumbnail of the image instead of a text description. This makes navigation very simple and fast. &lt;/li&gt;    &lt;li&gt;Layers      &lt;br /&gt;Usually only found on expensive or complicated professional software, layers form the basis for a rich image composition experience. You may think of them as a stack of transparency slides that, when viewed together at the same time, form one image. &lt;/li&gt;    &lt;li&gt;Active Online Community      &lt;br /&gt;Paint.NET has an online forum with a friendly, passionate, and ever-expanding community. Be sure to check out the constantly growing list of tutorials and plugins!       &lt;br /&gt;Frequently Updated       &lt;br /&gt;Updates usually come about every 4 to 8 weeks, and contain new features, performance improvements, and bug fixes. Upgrading to the latest version is very simple, requiring only two clicks of the mouse. &lt;/li&gt;    &lt;li&gt;Special Effects      &lt;br /&gt;Many special effects are included for enhancing and perfecting your images. Everything from blurring, sharpening, red-eye removal, distortion, noise, and embossing are included. Also included is our unique 3D Rotate/Zoom effect that makes it very easy to add perspective and tilting. &lt;/li&gt;    &lt;li&gt;Adjustments are also included which help you tweak an image's brightness, contrast, hue, saturation, curves, and levels. You can also convert an image to black and white, or sepia-toned. &lt;/li&gt;    &lt;li&gt;Powerful Tools      &lt;br /&gt;Paint.NET includes simple tools for drawing shapes, including an easy-to-use curve tool for drawing splines or Bezier curves. The Gradient tool, new for 3.0, has been cited as an innovative improvement over similar tools provided by other software. The facilities for creating and working with selections is powerful, yet still simple enough to be picked up quickly. Other powerful tools include the Magic Wand for selecting regions of similar color, and the Clone Stamp for copying or erasing portions of an image. There is also a simple text editor, a tool for zooming, and a Recolor tool. &lt;/li&gt;    &lt;li&gt;Unlimited History      &lt;br /&gt;Everybody makes mistakes, and everybody changes their mind. To accommodate this, every action you perform on an image is recorded in the History window and may be undone. Once you've undone an action, you can also redo it. The length of the history is only limited by available disk space. &lt;/li&gt;    &lt;li&gt;Free!      &lt;br /&gt;Paint.NET doesn't cost a dime. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;--------- &lt;/p&gt;  &lt;p&gt;Do you chat with friends that use different IM networks?&amp;#160; &lt;a href="www.ceruleanstudios.com/" target="_blank"&gt;Trillian&lt;/a&gt; is a great application that supports various IM networks.&amp;#160; MSN, AIM, Yahoo, ICQ, and IRC are supported.&lt;/p&gt;  &lt;p&gt;--------- &lt;/p&gt;  &lt;p&gt;How am I writing this blog post?&amp;#160; &lt;a href="http://download.live.com/" target="_blank"&gt;Windows Live Writer&lt;/a&gt; of course. &lt;a href="http://coolthingoftheday.blogspot.com/" target="_blank"&gt;Greg&lt;/a&gt; turned me on to this application and it makes blog posting must simpler:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;“Writer makes it easy to share your photos and videos on almost any blog service—Windows Live, Wordpress, Blogger, LiveJournal, TypePad, and many more.”&lt;/p&gt;&lt;/blockquote&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-4177523792121331960?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/4177523792121331960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=4177523792121331960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4177523792121331960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4177523792121331960'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/08/best-things-in-life-are-free.html' title='The Best Things In Life Are Free'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-236404139752689738</id><published>2009-05-08T16:05:00.001-07:00</published><updated>2009-05-08T16:05:07.855-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WPF'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><title type='text'>WPF Canvas Coordinate System</title><content type='html'>&lt;p&gt;I noticed that the &lt;strong&gt;Canvas&lt;/strong&gt; class doesn’t use the Cartesian coordinate system for mapping points. For instance, here’s a list of points: 0, 0; 15, 5; 25, 18.&amp;#160; Here’s how these points look when drawn to a &lt;strong&gt;Canvas&lt;/strong&gt;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/SgS6oIsfjxI/AAAAAAAAAJo/QoS9tsI92GY/s1600-h/wpfCanvasPoints%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wpfCanvasPoints" border="0" alt="wpfCanvasPoints" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/SgS6oSnWnhI/AAAAAAAAAJs/PjcfQi4hJB0/wpfCanvasPoints_thumb.png?imgmax=800" width="244" height="128" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The above image is fine if that’s what you want to do with the points, but that isn’t the result I wanted.&amp;#160; I had to add a &lt;strong&gt;ScaleTransform&lt;/strong&gt; to the &lt;strong&gt;Canvas&lt;/strong&gt; for it to look the way I wanted.&amp;#160; This can be done in XAML:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Canvas&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MainCanvas&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Background&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AliceBlue&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;400&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;200&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Canvas.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ScaleTransform&lt;/span&gt; &lt;span style="color: #ff0000"&gt;CenterX&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;200&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;CenterY&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;100&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ScaleX&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ScaleY&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;-1&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Canvas.RenderTransform&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Canvas&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;or programmatically (VB.NET here):&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; YScale &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; ScaleTransform

YScale.ScaleX = 1
YScale.ScaleY = -1
YScale.CenterX = MainCanvas.Width / 2
YScale.CenterY = MainCanvas.Height / 2

MainCanvas.RenderTransform = YScale&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You’ll notice the &lt;strong&gt;CenterX &lt;/strong&gt;and &lt;strong&gt;CenterY&lt;/strong&gt; properties are set to the middle of the &lt;strong&gt;Canvas.&amp;#160; &lt;/strong&gt;You can think of this as your pivot point when flipping the &lt;strong&gt;Canvas &lt;/strong&gt;(The &lt;strong&gt;CenterX&lt;/strong&gt; isn’t really needed here since we’re just flipping on the Y axis).The end result is what I was expecting:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_jBiTiK8T3Jc/SgS6oiWz3II/AAAAAAAAAJw/YPDSxgeFlHQ/s1600-h/wpfCanvasPointsYTransform%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="wpfCanvasPointsYTransform" border="0" alt="wpfCanvasPointsYTransform" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/SgS6o6DeEXI/AAAAAAAAAJ0/8JK_DMCWZ8o/wpfCanvasPointsYTransform_thumb.png?imgmax=800" width="244" height="128" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-236404139752689738?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/236404139752689738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=236404139752689738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/236404139752689738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/236404139752689738'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/05/wpf-canvas-coordinate-system.html' title='WPF Canvas Coordinate System'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_jBiTiK8T3Jc/SgS6oSnWnhI/AAAAAAAAAJs/PjcfQi4hJB0/s72-c/wpfCanvasPoints_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-7222169268753130419</id><published>2009-04-27T15:40:00.001-07:00</published><updated>2009-04-27T16:34:04.107-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Unit Testing – System.TypeLoadException</title><content type='html'>&lt;p&gt;So I was trying to write unit tests today and I ran into quite a weird issue.&amp;#160; My test failed on a simple constructor test.&amp;#160; When I looked at the error message I noticed something odd:&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_jBiTiK8T3Jc/SfZA6vbdifI/AAAAAAAAAJg/zFE4ZkvPNlQ/s1600-h/VersionErrorMessage%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VersionErrorMessage" border="0" alt="VersionErrorMessage" src="http://lh3.ggpht.com/_jBiTiK8T3Jc/SfZA6yhVKdI/AAAAAAAAAJk/7XVSbRXmZeI/VersionErrorMessage_thumb.png?imgmax=800" width="244" height="43" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The referenced assembly version in the picture is x.x.x.91, but the current version it should be is a later version.&amp;#160; What gives?&amp;#160; I tried creating a new unit test project because I thought maybe our unit test project got messed up somehow, but the same error message kept on happening.&amp;#160; Another frustrating issue was that when I ran the unit test in debug mode, it passed correctly.&amp;#160; &lt;/p&gt;  &lt;p&gt;After some searching on the web I ran into this &lt;a href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=123306" target="_blank"&gt;page&lt;/a&gt;, which led me to check the project’s code coverage instrumentation section.&amp;#160; Sure enough, the project was pointing to an assembly that no longer existed.&amp;#160; The red one was the non-existent assembly, the green one is the correct one.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_jBiTiK8T3Jc/SfY0YbBBYvI/AAAAAAAAAJQ/QTHzOdOPhYk/s1600-h/WrongArtifact%5B2%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WrongArtifact" border="0" alt="WrongArtifact" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/SfY0Yif5YbI/AAAAAAAAAJU/eVtE2_ECFPs/WrongArtifact_thumb.png?imgmax=800" width="244" height="107" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My guess as to why this happened was because initially, the solution was setup to build against &lt;strong&gt;Any CPU&lt;/strong&gt; and this was changed to &lt;strong&gt;x86&lt;/strong&gt; somewhere along the way.&amp;#160; The &lt;strong&gt;LocalTestRun.testrunconfig&lt;/strong&gt; probably never got updated.&amp;#160; After pointing to the correct assembly, the test passes and no odd version issues exist.&amp;#160; &lt;/p&gt;  &lt;p&gt;Incidentally, I asked &lt;a href="http://coolthingoftheday.blogspot.com/" target="_blank"&gt;Greg&lt;/a&gt; if his laptop ran into some slowness lately because my hard drive would thrash and adding unit tests literally took me longer than 5 minutes via right-click.&amp;#160; Correcting the instrumented assembly corrected this issue as well.&amp;#160; One would think that &lt;strong&gt;Visual Studio&lt;/strong&gt; would let the user know that something was up :)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-7222169268753130419?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/7222169268753130419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=7222169268753130419' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7222169268753130419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7222169268753130419'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/04/visual-studio-unit-testing.html' title='Visual Studio Unit Testing – System.TypeLoadException'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_jBiTiK8T3Jc/SfZA6yhVKdI/AAAAAAAAAJk/7XVSbRXmZeI/s72-c/VersionErrorMessage_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3974648478561507801</id><published>2009-04-21T09:08:00.001-07:00</published><updated>2009-04-21T09:10:31.170-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>MS Tech Ed 2009</title><content type='html'>&lt;p&gt;I’ll be attending &lt;a href="http://www.msteched.com/teched/" target="_blank"&gt;Tech Ed&lt;/a&gt; this year, which is the first conference of this kind for me. So here’s my badge:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/Se3vduh0f-I/AAAAAAAAAJA/ZdCjghyHqDg/s1600-h/TENA_blgr1_imattending%5B2%5D.gif"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="TENA_blgr1_imattending" border="0" alt="TENA_blgr1_imattending" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/Se3vdpaOBpI/AAAAAAAAAJE/9ar6Ya0HJl8/TENA_blgr1_imattending_thumb.gif?imgmax=800" width="184" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can get your badges for Tech Ed &lt;a href="http://www.msteched.com/teched/badges.aspx" target="_blank"&gt;here&lt;/a&gt;.&amp;#160; &lt;a href="http://coolthingoftheday.blogspot.com/2009/03/its-official-im-booth-bound-for-tech-ed.html" target="_blank"&gt;Greg&lt;/a&gt; will also be there, so stop by his booth to say hi and take a picture with him or something.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3974648478561507801?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3974648478561507801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3974648478561507801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3974648478561507801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3974648478561507801'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/04/ms-tech-ed-2009.html' title='MS Tech Ed 2009'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_jBiTiK8T3Jc/Se3vdpaOBpI/AAAAAAAAAJE/9ar6Ya0HJl8/s72-c/TENA_blgr1_imattending_thumb.gif?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8981516644497362098</id><published>2009-03-24T12:19:00.001-07:00</published><updated>2009-03-24T12:19:01.018-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Excel and CSV files</title><content type='html'>&lt;p&gt;Have you ever tried to open a comma delimited &lt;strong&gt;.csv&lt;/strong&gt; file in MS Excel and gotten these dialogs?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_jBiTiK8T3Jc/SckyIcoUONI/AAAAAAAAAIw/vlZCzHsCjOg/s1600-h/ExcelCSV%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExcelCSV" border="0" alt="ExcelCSV" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/SckyIlwM5bI/AAAAAAAAAI0/dSlAfgAWxj8/ExcelCSV_thumb%5B1%5D.png?imgmax=800" width="402" height="62" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_jBiTiK8T3Jc/SckyI4M1AdI/AAAAAAAAAI4/NlUHNPRLnYw/s1600-h/ExcelCSV2%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ExcelCSV2" border="0" alt="ExcelCSV2" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/SckyJGAeDCI/AAAAAAAAAI8/VR_us2r1trE/ExcelCSV2_thumb%5B1%5D.png?imgmax=800" width="407" height="63" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;There might actually be nothing wrong with your file.&amp;#160; If the first item happens to be &lt;strong&gt;ID &lt;/strong&gt;(case sensitive), you will get this dialog in Excel (I’ve had this happen to me in 2003 and 2007).&amp;#160; If you don’t want this dialog to keep coming up, you’ll have to rename the first item or just change the casing of &lt;strong&gt;ID &lt;/strong&gt;to &lt;strong&gt;id&lt;/strong&gt;, &lt;strong&gt;Id&lt;/strong&gt;, or &lt;strong&gt;iD&lt;/strong&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8981516644497362098?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8981516644497362098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8981516644497362098' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8981516644497362098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8981516644497362098'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2009/03/excel-and-csv-files.html' title='Excel and CSV files'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_jBiTiK8T3Jc/SckyIlwM5bI/AAAAAAAAAI0/dSlAfgAWxj8/s72-c/ExcelCSV_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2683545709287449519</id><published>2008-12-09T10:51:00.001-08:00</published><updated>2008-12-09T10:52:14.915-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Software Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Unit Testing – Reducing Redundant Tests</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;When I first started unit testing, I tested as many methods as I could.&amp;#160; These included &lt;strong&gt;public&lt;/strong&gt; and &lt;strong&gt;private&lt;/strong&gt; ones.&amp;#160; A bit of searching on the web about public versus private method testing will yield mixed results.&amp;#160; I personally test both since I aim for at least 70% code coverage.&amp;#160; Visual Studio creates &lt;strong&gt;Accessor&lt;/strong&gt; classes for private methods and properties for you so testing private methods is easy.&lt;/p&gt;  &lt;p&gt;I used to write at least one test per method (some require more than one to test conditional code paths), but this can get redundant.&amp;#160; The steps I take to reduce redundancy today are as follows.&amp;#160; First, I turn on code coverage.&amp;#160; This will give a visual indicator of what has been covered in my classes.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/ST6-IjOX4QI/AAAAAAAAAHs/l1FaaCO3Mf4/s1600-h/SetCodeCoverage%5B2%5D.png"&gt;&lt;img title="SetCodeCoverage" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="88" alt="SetCodeCoverage" src="http://lh5.ggpht.com/_jBiTiK8T3Jc/ST6-JR8N0wI/AAAAAAAAAHw/W8ao-CM1mE4/SetCodeCoverage_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_jBiTiK8T3Jc/ST6-KbJYMHI/AAAAAAAAAH0/GdZUN8wGNGc/s1600-h/SetCodeCoverage2%5B2%5D.png"&gt;&lt;img title="SetCodeCoverage2" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="176" alt="SetCodeCoverage2" src="http://lh4.ggpht.com/_jBiTiK8T3Jc/ST6-LNIlsDI/AAAAAAAAAH4/t8pKuzEemTQ/SetCodeCoverage2_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;When I run my tests, code that has been covered is in blue and the code that hasn’t been covered is in red.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_jBiTiK8T3Jc/ST6-Lbbbp0I/AAAAAAAAAH8/ZFh-nymZNJc/s1600-h/bluered%5B2%5D.png"&gt;&lt;img title="bluered" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="91" alt="bluered" src="http://lh6.ggpht.com/_jBiTiK8T3Jc/ST6-LsRdxyI/AAAAAAAAAIA/mBqf85SLnAg/bluered_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;I test my constructors first, then public methods, and finally private methods.&amp;#160; Doing it in this order gives me a better idea of what private methods need to be tested.&amp;#160; Most of the time public methods will call private methods so writing a single test will cover those methods as well.&amp;#160; I collapse whatever has been covered each time I create and run a test.&amp;#160; Doing my tests this way has greatly reduced the number of redundant tests written and has kept the same amount of code coverage.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2683545709287449519?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2683545709287449519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2683545709287449519' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2683545709287449519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2683545709287449519'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/12/visual-studio-unit-testing-reducing.html' title='Visual Studio Unit Testing – Reducing Redundant Tests'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_jBiTiK8T3Jc/ST6-JR8N0wI/AAAAAAAAAHw/W8ao-CM1mE4/s72-c/SetCodeCoverage_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-895152078532069372</id><published>2008-09-04T09:52:00.001-07:00</published><updated>2008-09-04T09:52:19.825-07:00</updated><title type='text'>ADO.NET Asynchronous Transactions</title><content type='html'>&lt;p&gt;Searching on the web and on the MSDN forums for &lt;strong&gt;Asynchronous Transactions&lt;/strong&gt; didn’t give me what I was looking for.&amp;#160; I knew a bit about both, so I decided trying to combine the two to get the result I wanted.&amp;#160; This was the general outline of what I came up with.&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; DoLongSQLOperation()
    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ConnectionStringBuilder &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; SqlClient.SqlConnectionStringBuilder

    ConnectionStringBuilder.IntegratedSecurity = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;
    ConnectionStringBuilder.DataSource = &lt;span style="color: #006080"&gt;&amp;quot;SQLSERVER&amp;quot;&lt;/span&gt;
    ConnectionStringBuilder.InitialCatalog = &lt;span style="color: #006080"&gt;&amp;quot;DATABASE&amp;quot;&lt;/span&gt;
    ConnectionStringBuilder.AsynchronousProcessing = &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; MySQLConnection &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; SqlConnection(ConnectionStringBuilder.ToString)
    MySQLConnection.Open()

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; LongSQLCommand &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; SqlCommand(&lt;span style="color: #006080"&gt;&amp;quot;sp_LongOperation&amp;quot;&lt;/span&gt;, MySQLConnection)

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; MySQLTrans &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; SqlTransaction = MySQLConnection.BeginTransaction

    LongSQLCommand.Transaction = MySQLTrans
    LongSQLCommand.CommandType = CommandType.StoredProcedure

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; Callback &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; AsyncCallback(&lt;span style="color: #0000ff"&gt;AddressOf&lt;/span&gt; CallbackMethod)

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; Result &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; IAsyncResult = LongSQLCommand.BeginExecuteNonQuery(Callback, LongSQLCommand)

    &lt;span style="color: #0000ff"&gt;While&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Not&lt;/span&gt; Result.IsCompleted
      &lt;span style="color: #008000"&gt;'do something if needed&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;While&lt;/span&gt;

  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;

  &lt;span style="color: #0000ff"&gt;Private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; CallbackMethod(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; result &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; IAsyncResult)
    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; LongSQLCommand &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; SqlCommand

    LongSQLCommand = &lt;span style="color: #0000ff"&gt;DirectCast&lt;/span&gt;(result.AsyncState, SqlCommand)
    LongSQLCommand.EndExecuteNonQuery(result)

    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; MyTransaction &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; SqlTransaction = LongSQLCommand.Transaction

    &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;
      MyTransaction.Commit()
    &lt;span style="color: #0000ff"&gt;Catch&lt;/span&gt; ex &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Exception
      &lt;span style="color: #008000"&gt;'Try to rollback on a commit exception&lt;/span&gt;
      &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;
        MyTransaction.Rollback()
      &lt;span style="color: #0000ff"&gt;Catch&lt;/span&gt; exRollback &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Exception
        &lt;span style="color: #008000"&gt;'Rollback failed&lt;/span&gt;
      &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Try&lt;/span&gt;

    &lt;span style="color: #008000"&gt;'Dispose of your objects&lt;/span&gt;
    MyTransaction.Dispose()
    LongSQLCommand.Dispose()
    LongSQLCommand.Connection.Dispose()

  &lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I used the &lt;strong&gt;Asynchronous Callback&lt;/strong&gt; method of doing what I needed.&amp;#160; &lt;strong&gt;CallbackMethod&lt;/strong&gt; gets called when the asynchronous operation completes.&amp;#160; Within my callback method is where I commit my transaction and dispose of any data resources.&amp;#160; I’ve kept the error handling to a minimum in my example for brevity, but you’ll definitely want to add them where they’re needed.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-895152078532069372?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/895152078532069372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=895152078532069372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/895152078532069372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/895152078532069372'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/09/adonet-asynchronous-transactions.html' title='ADO.NET Asynchronous Transactions'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8329773549628749901</id><published>2008-07-24T11:16:00.001-07:00</published><updated>2008-07-24T11:16:42.398-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio and Data Driven Unit Tests</title><content type='html'>&lt;p&gt;Unit testing can be tedious when you have a battery of data to test against.&amp;#160; If you’re just testing against a small number of different data, then using Data Driven Unit Tests might be a bit overkill.&amp;#160; However, Data Driven Unit Tests gives you is a single location of data that can be used throughout your unit testing project.&amp;#160; Instead of modifying the data you typed in your unit test code, you can just modify it in your data file.&amp;#160; I used &lt;a href="http://msdn.microsoft.com/en-us/library/ms182527.aspx" target="_blank"&gt;this&lt;/a&gt; MSDN entry as a starting point.&lt;/p&gt;  &lt;p&gt;The method we’ll be testing is shown below.&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; SomeMethod(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; data &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Integer&lt;/span&gt;
   &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; data.Length
&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Function&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You create the unit test for &lt;strong&gt;SomeMethod&lt;/strong&gt; as usual.&amp;#160; Now what about our data file?&amp;#160; I’ll use an XML data file that just holds a few strings named &lt;strong&gt;test.xml&lt;/strong&gt;. &lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Samples&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Sample0&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;My Sample&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Sample0&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Sample1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;This is another sample&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Sample1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Samples&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now you have your simple data file.&amp;#160; To hook it into your unit test project, open up the &lt;strong&gt;Test List Editor&lt;/strong&gt; in Visual Studio.&amp;#160; Find the test that you want to use &lt;strong&gt;test.xml&lt;/strong&gt; with and click on that test.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SIjG_MebOAI/AAAAAAAAAEw/l5yik_zt_sM/s1600-h/testlisteditor%5B5%5D.png"&gt;&lt;img title="testlisteditor" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="103" alt="testlisteditor" src="http://lh3.ggpht.com/peterchoi77/SIjG_fE1MXI/AAAAAAAAAE0/uLr3K1lNq5Q/testlisteditor_thumb%5B1%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;In the &lt;strong&gt;Properties&lt;/strong&gt;, find the &lt;strong&gt;Data Connection String&lt;/strong&gt; entry and press the ellipses button.&amp;#160; This will bring up the &lt;strong&gt;New Test Data Source Wizard&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/peterchoi77/SIjG_gTrTVI/AAAAAAAAAE4/4-L5FNazjqk/s1600-h/properties%5B2%5D.png"&gt;&lt;img title="properties" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="218" alt="properties" src="http://lh6.ggpht.com/peterchoi77/SIjHAZl4rnI/AAAAAAAAAE8/_R1JM7w7yfM/properties_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SIjHAeP2UyI/AAAAAAAAAFA/llyiXbhyxyo/s1600-h/wizard1%5B2%5D.png"&gt;&lt;img title="wizard1" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="221" alt="wizard1" src="http://lh5.ggpht.com/peterchoi77/SIjHAnNaJxI/AAAAAAAAAFE/ebRVuWRgfbs/wizard1_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Select &lt;strong&gt;XML File&lt;/strong&gt; and press &lt;strong&gt;Next&lt;/strong&gt; to bring up the next screen.&amp;#160; Press the ellipses button and find &lt;strong&gt;test.xml&lt;/strong&gt;.&amp;#160; This should fill in &lt;strong&gt;Table&lt;/strong&gt; and &lt;strong&gt;Preview data&lt;/strong&gt; for you.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SIjHA2y18TI/AAAAAAAAAFI/0ccVfIOhnLI/s1600-h/wizard2%5B2%5D.png"&gt;&lt;img title="wizard2" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="221" alt="wizard2" src="http://lh5.ggpht.com/peterchoi77/SIjHBA9si2I/AAAAAAAAAFM/VFi1ztltIUc/wizard2_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Pressing &lt;strong&gt;Next &lt;/strong&gt;will bring you to the final page of the wizard.&amp;#160; Highlight the table and press &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SIjHBejvg4I/AAAAAAAAAFQ/ZTcg17bw5to/s1600-h/wizard3%5B2%5D.png"&gt;&lt;img title="wizard3" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="221" alt="wizard3" src="http://lh3.ggpht.com/peterchoi77/SIjHBldQMTI/AAAAAAAAAFU/YZZGDt8rP9I/wizard3_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;You’ll see a dialog after the previous step.&amp;#160; Press &lt;strong&gt;Yes&lt;/strong&gt; and Visual Studio will add &lt;strong&gt;test.xml&lt;/strong&gt; to your unit test project.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh6.ggpht.com/peterchoi77/SIjHB9aeAqI/AAAAAAAAAFY/KpNOhv-asLk/s1600-h/wizarddialog%5B2%5D.png"&gt;&lt;img title="wizarddialog" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="72" alt="wizarddialog" src="http://lh3.ggpht.com/peterchoi77/SIjHB9-DgZI/AAAAAAAAAFc/AjH7NZYIpp0/wizarddialog_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SIjHCAqX0sI/AAAAAAAAAFg/awrdKwnLQks/s1600-h/dataadded%5B2%5D.png"&gt;&lt;img title="dataadded" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="235" alt="dataadded" src="http://lh5.ggpht.com/peterchoi77/SIjHCay_tgI/AAAAAAAAAFk/miwb_lVOimw/dataadded_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;If you look at your &lt;strong&gt;Data Connection String&lt;/strong&gt; property, it should now point to &lt;strong&gt;test.xml&lt;/strong&gt; within your unit test project.&amp;#160; The next step is using the data in your unit test.&amp;#160; Here’s a simple example of how to use your data.&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;lt;DataSource(&lt;span style="color: #006080"&gt;&amp;quot;Microsoft.VisualStudio.TestTools.DataSource.XML&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;|DataDirectory|\test.xml&amp;quot;&lt;/span&gt;, &lt;span style="color: #006080"&gt;&amp;quot;Samples&amp;quot;&lt;/span&gt;, DataAccessMethod.Sequential)&amp;gt; _
&amp;lt;DeploymentItem(&lt;span style="color: #006080"&gt;&amp;quot;TestProject1\test.xml&amp;quot;&lt;/span&gt;)&amp;gt; _
&amp;lt;TestMethod()&amp;gt; _
&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt; SomeMethodTest()
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; target &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Form1 = &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; Form1
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; data &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; = &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;.Empty

  Assert.IsTrue(target.SomeMethod(TestContext.DataRow(&lt;span style="color: #006080"&gt;&amp;quot;Sample0&amp;quot;&lt;/span&gt;)) = TestContext.DataRow(&lt;span style="color: #006080"&gt;&amp;quot;Sample0&amp;quot;&lt;/span&gt;).ToString.Length)
&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Sub&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The attributes for &lt;strong&gt;SomeMethodTest&lt;/strong&gt; get automatically added when you add &lt;strong&gt;test.xml&lt;/strong&gt; to your &lt;strong&gt;Data Connection String&lt;/strong&gt; property.&amp;#160; The main point here is that &lt;strong&gt;TestContext.DataRow&lt;/strong&gt;() is used to access your data.&lt;/p&gt;

&lt;p&gt;One issue that I’ve run into was that I wanted to move my data into a sub folder called &lt;strong&gt;Data&lt;/strong&gt; within my unit test project.&amp;#160; This will work, but the path to &lt;strong&gt;test.xml&lt;/strong&gt; is a hard path.&amp;#160; Why does this matter?&amp;#160; I’m part of a team and having a hard path breaks the unit test since not all of our workspace paths are the same.&amp;#160; If you look at the &lt;strong&gt;Data Connection String &lt;/strong&gt;property, you’ll notice that &lt;strong&gt;|DataDirectory| &lt;/strong&gt;is at the beginning before the xml file location.&amp;#160; This transfers fine over different workspaces, however you’ll have to leave the data file where it gets inserted into the project by default.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8329773549628749901?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8329773549628749901/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8329773549628749901' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8329773549628749901'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8329773549628749901'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/07/visual-studio-and-data-driven-unit.html' title='Visual Studio and Data Driven Unit Tests'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/peterchoi77/SIjG_fE1MXI/AAAAAAAAAE0/uLr3K1lNq5Q/s72-c/testlisteditor_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3155028040545240292</id><published>2008-07-16T08:51:00.001-07:00</published><updated>2008-07-16T08:51:52.217-07:00</updated><title type='text'>TeamBuild and WiX</title><content type='html'>&lt;p&gt;Have you ever run into this error using TeamBuild to build a WiX setup project?&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;light.exe : error LGHT0217: An unexpected external UI message was received: The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Done building project &amp;quot;Setup.wixproj&amp;quot; -- FAILED.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;It seems this problem is rampant on Vista build machines.&amp;#160; The &lt;a href="http://blogs.msdn.com/astebner/archive/2008/04/01/8349448.aspx" target="_blank"&gt;solution&lt;/a&gt; usually had something to do with the vbscript engine, but I’ve tried all of those solutions and we were still failing WiX builds.&amp;#160; Besides, we’re using XP for our build machines.&lt;/p&gt;  &lt;p&gt;I decided to login to our build machine using our build service account and manually build the WiX project through the IDE.&amp;#160; The project compiled fine so I kicked off another build.&amp;#160; That didn’t fix anything.&amp;#160; I then decided to compile the project using &lt;strong&gt;devenv.exe&lt;/strong&gt; from the command line.&amp;#160; That compiled fine, but I noticed an &lt;strong&gt;ICE## &lt;/strong&gt;warning.&amp;#160; At first I didn’t think anything of it because after this second step, our builds started to work.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://coolthingoftheday.blogspot.com/" target="_blank"&gt;Greg&lt;/a&gt;, being the manager that he is, told me to repeat the steps on our other build machine to see if that was indeed the fix to our problem.&amp;#160; I was hopeful, but it didn’t seem to work on the other machine.&amp;#160; Then he said to reboot the original build machine and repeat the steps.&amp;#160; Again, I was hopeful, but it looked like the steps I took before wasn’t the solution.&lt;/p&gt;  &lt;p&gt;Later on in the day I tried to login to our build machine again using our service account to repeat the steps from before.&amp;#160; Firing a build didn’t work again, but this time that &lt;strong&gt;ICE##&lt;/strong&gt; warning really caught my eye.&amp;#160; I remembered that the WiX project property page had some settings for ICE validation:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SH4ZEkt4GvI/AAAAAAAAAEo/jgQDa7oqslY/s1600-h/wix%5B2%5D.png"&gt;&lt;img title="wix" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="122" alt="wix" src="http://lh5.ggpht.com/peterchoi77/SH4ZF3ijIpI/AAAAAAAAAEs/JhNpooUtz-0/wix_thumb.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Although the &lt;strong&gt;ICE##&lt;/strong&gt; message being returned by the build process was a warning, it was causing our build to fail.&amp;#160; Checking &lt;strong&gt;Supress ICE validation&lt;/strong&gt; was the key and we now have an automated build for our WiX setup project.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3155028040545240292?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3155028040545240292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3155028040545240292' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3155028040545240292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3155028040545240292'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/07/teambuild-and-wix.html' title='TeamBuild and WiX'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/peterchoi77/SH4ZF3ijIpI/AAAAAAAAAEs/JhNpooUtz-0/s72-c/wix_thumb.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-8969005961874324354</id><published>2008-07-11T10:41:00.001-07:00</published><updated>2008-07-11T10:41:10.284-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software Development'/><title type='text'>My Thoughts On Scrum (Part 1)</title><content type='html'>&lt;p&gt;If you’ve been following &lt;a href="http://coolthingoftheday.blogspot.com/" target="_blank"&gt;Greg's Blog&lt;/a&gt;, you’d know that our team (and our whole development group for that matter) is now using the &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)" target="_blank"&gt;Scrum&lt;/a&gt; methodology for software development.&amp;#160; I think it’s natural for anyone to get excited or somewhat nervous when a change in day to day operations gets implemented.&amp;#160; &lt;/p&gt;  &lt;p&gt;Some people thrive on a dynamic lifestyle while others can’t handle change very well.&amp;#160; For a software developer, the only things that are certain are death, taxes, and change.&amp;#160; Being thrown into something new shouldn’t make your world flip upside-down.&lt;/p&gt;  &lt;p&gt;Before Scrum, our team didn’t have a distinctly defined system.&amp;#160; It was definitely iterative and agile, but there were no hard release dates and no administrative tasks associated with our development.&amp;#160; Our team is very customer focused, so transitioning to Scrum didn’t really change our mentality on what we delivered, just how we delivered it.&lt;/p&gt;  &lt;p&gt;The hardest part for me when we transitioned to Scrum was the administrative tasks.&amp;#160; Updating statuses, work hours, and general commenting on work items was new to me (and I’m still learning to get used to it).&amp;#160; However, I do understand the importance of these tasks since our sprint burndown chart gives us a great visual representation of our status.&lt;/p&gt;  &lt;p&gt;I was assigned to my own project before Scrum and I felt solely responsible for it. Now that we’re Scrumming and there are four of us are working on the same project, I feel a deeper sense of camaraderie.&amp;#160; There’s less sense of &lt;strong&gt;I&lt;/strong&gt; and more of &lt;strong&gt;us&lt;/strong&gt;.&amp;#160; &lt;/p&gt;  &lt;p&gt;I think our first sprint is going very well and I’m very happy about what we’re going to give to our customers at the end of this sprint.&amp;#160; As we become more experienced with Scrum, I’ll share some more of my thoughts.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-8969005961874324354?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/8969005961874324354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=8969005961874324354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8969005961874324354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/8969005961874324354'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/07/my-thoughts-on-scrum-part-1.html' title='My Thoughts On Scrum (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-28834447586091562</id><published>2008-06-19T16:41:00.001-07:00</published><updated>2008-06-19T16:41:03.295-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ClickOnce'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>TeamBuild ClickOnce – Auto Incrementing Your Version Information</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;Using &lt;a href="http://code.msdn.microsoft.com/AssemblyInfoTaskvers" target="_blank"&gt;AssemblyInfoTask&lt;/a&gt; within your &lt;strong&gt;TFSBuild.proj&lt;/strong&gt; file, you can set your builds to automatically increment your &lt;strong&gt;AssemblyVersion&lt;/strong&gt; and &lt;strong&gt;AssemblyFileVersion&lt;/strong&gt;.&amp;#160; You can also keep your application’s &lt;strong&gt;Publish Version&lt;/strong&gt; in sync, which is useful if you’re publishing your application via &lt;strong&gt;ClickOnce.&amp;#160; &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The &lt;strong&gt;Publish Version&lt;/strong&gt; is important because that’s what &lt;strong&gt;ClickOnce&lt;/strong&gt; looks at to see if there’s a new version available when the user runs the application.&amp;#160; Updating the &lt;strong&gt;AssemblyVersion &lt;/strong&gt;or &lt;strong&gt;AssemblyFileVersion&lt;/strong&gt; doesn’t tell &lt;strong&gt;ClickOnce&lt;/strong&gt; that there’s a new version of your application to download.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;There are a ton of blog posts like &lt;a href="http://blogs.msdn.com/nikhilsi/archive/2008/06/12/how-to-autoincrement-version-with-each-build-using-team-foundation-server-build-with-a-little-help-from-assemblyinfotask.aspx" target="_blank"&gt;this one&lt;/a&gt; that tell you how to check in/out files from your &lt;strong&gt;TFS&lt;/strong&gt; so I won’t repeat those steps.&amp;#160; The actual version updates happen inside the &lt;strong&gt;&amp;lt;AssemblyInfo&amp;gt;&lt;/strong&gt; task:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100.38%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; height: 400px; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Import&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(MSBuildExtensionsPath)\Microsoft\AssemblyInfoTask\Microsoft.VersionNumber.Targets&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    ...
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AfterGet&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;In After Get&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;CreateItem&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(SolutionRoot)\My Project\AssemblyInfo.vb&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Output&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ItemName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AssemblyInfoFiles&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;TaskParameter&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Include&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;CreateItem&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Exec&lt;/span&gt; &lt;span style="color: #ff0000"&gt;WorkingDirectory&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(SolutionRoot)\My Project\&amp;quot;&lt;/span&gt;
            &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(TF) checkout AssemblyInfo.vb&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;AssemblyInfo&lt;/span&gt; &lt;span style="color: #ff0000"&gt;AssemblyInfoFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;@(AssemblyInfoFiles)&amp;quot;&lt;/span&gt;
            &lt;span style="color: #ff0000"&gt;AssemblyRevisionType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AutoIncrement&amp;quot;&lt;/span&gt;
            &lt;span style="color: #ff0000"&gt;AssemblyRevisionFormat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;
            &lt;span style="color: #ff0000"&gt;AssemblyFileRevisionType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AutoIncrement&amp;quot;&lt;/span&gt;
            &lt;span style="color: #ff0000"&gt;AssemblyFileRevisionFormat&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

          &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Output&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ItemName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MaxAssemblyVersion&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;TaskParameter&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;MaxAssemblyVersion&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;AssemblyInfo&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;For our project, we only want to update a specific &lt;strong&gt;AssemblyInfo.vb&lt;/strong&gt; as opposed to recursively checking out all &lt;strong&gt;AssemblyInfo&lt;/strong&gt; files to modify.&amp;#160; We used the &lt;strong&gt;&amp;lt;CreateItem&amp;gt;&lt;/strong&gt; task to store the &lt;strong&gt;AssemblyInfo&lt;/strong&gt; files into an array.&amp;#160; In our case it’s just one file (That’s why the &lt;strong&gt;&amp;lt;Exec&amp;gt;&lt;/strong&gt; task looks a bit different than most examples out there on the web).&amp;#160; &lt;/p&gt;

&lt;p&gt;Inside the &lt;strong&gt;&amp;lt;AssemblyInfo&amp;gt;&lt;/strong&gt; task is pretty self-explanitory.&amp;#160; Setting the type and format of the &lt;strong&gt;Revision&lt;/strong&gt; (you can do this to your &lt;strong&gt;Major&lt;/strong&gt;, &lt;strong&gt;Minor&lt;/strong&gt;, and &lt;strong&gt;Build &lt;/strong&gt;as well) to &lt;strong&gt;AutoIncrement&lt;/strong&gt; is what does the trick.&amp;#160; You don’t have to have an &amp;lt;&lt;strong&gt;Output&amp;gt;&lt;/strong&gt; element, but I wanted to keep our &lt;strong&gt;Publish Version&lt;/strong&gt; and &lt;strong&gt;Assembly Version&lt;/strong&gt; in sync.&amp;#160; &lt;/p&gt;

&lt;p&gt;We can use the variable &lt;strong&gt;@(MaxAssemblyVersion),&lt;/strong&gt; which stems from the &lt;strong&gt;ItemName&lt;/strong&gt; attribute, to hold our new &lt;strong&gt;Assembly Version.&amp;#160; &lt;/strong&gt;I’ve previously posted about modifying the &lt;strong&gt;vbproj&lt;/strong&gt; file to update the &lt;strong&gt;Publish Version&lt;/strong&gt; so I won’t go into the details, but finding and replacing the needed element isn’t difficult.&amp;#160; Lastly you’ll want to check in your new &lt;strong&gt;AssemblyInfo&lt;/strong&gt; file so that the next build increments your versions.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-28834447586091562?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/28834447586091562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=28834447586091562' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/28834447586091562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/28834447586091562'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/06/teambuild-clickonce-auto-incrementing.html' title='TeamBuild ClickOnce – Auto Incrementing Your Version Information'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-1958559247084375587</id><published>2008-06-03T10:11:00.001-07:00</published><updated>2008-06-03T10:14:50.759-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ClickOnce'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>TeamBuild ClickOnce – Publishing To Different Locations</title><content type='html'>&lt;p&gt;Our team's goal with TeamBuild is to keep things as automated as possible.&amp;#160; We currently have two separate publishing locations for production and beta releases.&amp;#160; Wouldn't it be nice if we didn't have to put the publishing location manually each time we put out a build?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SEV7TjvFEkI/AAAAAAAAAEg/GaE3NETUe2E/s1600-h/publish2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="152" alt="publish" src="http://lh4.ggpht.com/peterchoi77/SEV7U-zPK8I/AAAAAAAAAEk/oi-v3br51K4/publish_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;What I found interesting inside my project's &lt;strong&gt;vbproj&lt;/strong&gt; file (which is just XML) was that the information I needed was located within the &lt;strong&gt;&amp;lt;PublishUrl&amp;gt; &lt;/strong&gt;element:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DefaultTargets&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Build&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ToolsVersion&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;3.5&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;PublishUrl&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;http://somelocation/&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;PublishUrl&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;PropertyGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Great, we can now have two different build definitions for production and beta releases without having to manually enter the publishing location.&amp;#160; All we need to do is write the location in the &lt;strong&gt;vbproj&lt;/strong&gt; file before we compile.&amp;#160; The problem is that TFS has the &lt;strong&gt;vbproj&lt;/strong&gt; file (and I’m pretty sure all other files within your project) as read-only during a build. &lt;/p&gt;

&lt;p&gt;My first thought was that I just needed to checkout the &lt;strong&gt;vbproj&lt;/strong&gt; file, do my modification, then just check it in.&amp;#160; This worked fine, but was all that really necessary?&amp;#160; I thought of using &lt;strong&gt;attrib.exe&lt;/strong&gt; to remove the read-only attribute from the file, but I didn’t know if it’d work because of the TFS source control files.&amp;#160; I got confirmation from a &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3431028&amp;amp;SiteID=1" target="_blank"&gt;post&lt;/a&gt; that &lt;strong&gt;attrib.exe&lt;/strong&gt; would do the job so that’s what I ended up doing in my &lt;strong&gt;TFSBuild.proj&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt; ...&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt; &lt;span style="color: #0000ff"&gt;=&amp;quot;BeforeCompile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;In Before Compile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Making vbproj file writable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Exec&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;attrib -R &amp;amp;quot;$(SolutionRoot)\project.vbproj&amp;amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        ...
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Now we just have to modify the &lt;strong&gt;&amp;lt;PublishUrl&amp;gt;&lt;/strong&gt; element with our publishing location.&amp;#160; If you’ve read my previous posts you know that we use the &lt;a href="http://www.codeplex.com/sdctasks" target="_blank"&gt;SDC Tasks Library&lt;/a&gt; for XML manipulation.&amp;#160; So the first stab I took at placing our publishing locations into the &lt;strong&gt;vbproj&lt;/strong&gt; file was using the &lt;strong&gt;&amp;lt;XmlFile.SetValue&amp;gt;&lt;/strong&gt; task.&amp;#160; The problem here is that the default namespace in the &lt;strong&gt;vbproj&lt;/strong&gt; file isn’t prefixed so getting the XPath I needed didn’t work.&amp;#160; The solution was to use the &lt;strong&gt;&amp;lt;File.RegEx&amp;gt;&lt;/strong&gt; task:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt; ...&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt; &lt;span style="color: #0000ff"&gt;=&amp;quot;BeforeCompile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;In Before Compile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Making vbproj file writable&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Exec&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Command&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;attrib -R &amp;amp;quot;$(SolutionRoot)\project.vbproj&amp;amp;quot;&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Replacing PublishUrl&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
       &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;File.RegEx&lt;/span&gt;
         Path=&amp;quot;$(SolutionRoot)\project.vbproj&amp;quot;
         RegularExpression=&amp;quot;&lt;span style="color: #ff0000"&gt;&amp;amp;lt;&lt;/span&gt;PublishUrl&lt;span style="color: #ff0000"&gt;&amp;amp;gt;&lt;/span&gt;(.*?)&lt;span style="color: #ff0000"&gt;&amp;amp;lt;&lt;/span&gt;/PublishUrl&lt;span style="color: #ff0000"&gt;&amp;amp;gt;&lt;/span&gt;&amp;quot;
         NewValue=&amp;quot;&lt;span style="color: #ff0000"&gt;&amp;amp;lt;&lt;/span&gt;PublishUrl&lt;span style="color: #ff0000"&gt;&amp;amp;gt;&lt;/span&gt;http://YourSpecifiedLocation/&lt;span style="color: #ff0000"&gt;&amp;amp;lt;&lt;/span&gt;/PublishUrl&lt;span style="color: #ff0000"&gt;&amp;amp;gt;&lt;/span&gt;&amp;quot;
       &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    ...
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;When the project compiles, it’ll use the updated &lt;strong&gt;vbproj’s &lt;/strong&gt;information so the manifests will have the correct publishing information when built.&amp;#160; Using this method, you can still manually publish your ClickOnce without messing up your build definitions and also have various build definitions to specify different publishing locations.&amp;#160; &lt;/p&gt;

&lt;p&gt;One thing to note is that the &lt;strong&gt;Publish Version&lt;/strong&gt; in the IDE is the &lt;strong&gt;&amp;lt;ApplicationVersion&amp;gt;&lt;/strong&gt; element in your &lt;strong&gt;vbproj &lt;/strong&gt;file.&amp;#160; If you modify this in your IDE then this will also affect your builds.&amp;#160; I found that keeping your &lt;strong&gt;Assembly Version&lt;/strong&gt; and &lt;strong&gt;Publish Version&lt;/strong&gt; in sync the best way to do things.&amp;#160; This way nobody gets confused as to which version you might be talking about.&amp;#160; Also, ClickOnce checks your &lt;strong&gt;Publish Version &lt;/strong&gt;when doing automatic updates so keep that in mind.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-1958559247084375587?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/1958559247084375587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=1958559247084375587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1958559247084375587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/1958559247084375587'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/06/teambuild-clickonce-publishing-to.html' title='TeamBuild ClickOnce – Publishing To Different Locations'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/peterchoi77/SEV7U-zPK8I/AAAAAAAAAEk/oi-v3br51K4/s72-c/publish_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-4140262237397898014</id><published>2008-05-19T16:55:00.001-07:00</published><updated>2008-06-03T10:15:46.391-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ClickOnce'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>TeamBuild ClickOnce – Versioning</title><content type='html'>&lt;p&gt;It seems many people have had issues getting the version number correctly within their &lt;strong&gt;tfsbuild.proj&lt;/strong&gt; files to use in their ClickOnce html files.&amp;#160; The solutions I've seen were very complicated, but this may be because the examples I've seen were in TFS 2005 or they were using different tasks.&lt;/p&gt;  &lt;p&gt;My coworker added the &lt;a href="http://www.codeplex.com/sdctasks" target="_blank"&gt;SDC&lt;/a&gt; tasks to our build server because there is functionality for XML and file manipulation.&amp;#160; From his starting point I went on to look further into two specific tasks: &lt;strong&gt;Xml.GetValue&lt;/strong&gt; and &lt;strong&gt;File.RegEx.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;My &lt;a href="http://www.coolthingoftheday.blogspot.com/" target="_blank"&gt;boss&lt;/a&gt; directed me to where I can find the version number that I needed, which resides in the application manifest file.&amp;#160; The trickiest part of the &lt;strong&gt;Xml.GetValue&lt;/strong&gt; task to me was understanding XPath.&amp;#160; The biggest point that I missed was that I needed to define the namespace within the application manifest to get to the element.&amp;#160; &lt;/p&gt;  &lt;p&gt;If you look inside the application manifest of your program (not the program.exe.manifest, but program.application as I'm dealing with publishing), you'll find something similar to this:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #800000"&gt;xml&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;utf-8&amp;quot;&lt;/span&gt;?&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;asmv1:assembly&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xsi:schemaLocation&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v1 assembly.adaptive.xsd&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;manifestVersion&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns:asmv3&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v3&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns:dsig&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/2000/09/xmldsig#&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns:co&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;v1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:clickonce.v1&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v2&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns:asmv1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns:asmv2&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v2&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;xmlns:xrml&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:mpeg:mpeg21:2003:01-REL-R-NS&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns:xsi&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
  
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;assemblyIdentity&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;program.application&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;1.0&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;publicKeyToken&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;abcdedf892929&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;language&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;neutral&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;processorArchitecture&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;x86&amp;quot;&lt;/span&gt; 
        &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;urn:schemas-microsoft-com:asm.v1&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
...
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;asmv1&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I thought I could just use an XPath like this &lt;strong&gt;/asmv1:assembly/assemblyIdentity/@version&lt;/strong&gt; to get the value that I wanted.&amp;#160; Nope, my build threw errors saying that the namespace &lt;strong&gt;asmv1&lt;/strong&gt; was not defined.&amp;#160; Then I defined the &lt;strong&gt;asmv1&lt;/strong&gt; namespace, but I wasn't getting a value returned.&amp;#160;&amp;#160; You'll notice in the snippet above that &lt;strong&gt;assemblyIdentity&lt;/strong&gt; adds its own namespace, but it's same as &lt;strong&gt;asmv1 &lt;/strong&gt;defined above.&amp;#160; In the end it was because I didn't prefix the &lt;strong&gt;asmv1&lt;/strong&gt; namespace before &lt;strong&gt;assemblyIdentity&lt;/strong&gt; as well.&lt;/p&gt;

&lt;p&gt;I manually published my project to get the &lt;strong&gt;publish.htm &lt;/strong&gt;file.&amp;#160; I then made it a part of my project so that I could copy it to my published application's directory and modify the version number.&amp;#160; I edited the html file and put a &lt;strong&gt;#VERSION#&lt;/strong&gt; tag so that the &lt;strong&gt;File.RegEx&lt;/strong&gt; task could find it and replace it with the &lt;strong&gt;$(ResultsItem)&lt;/strong&gt; variable.&amp;#160; We get &lt;strong&gt;$(ResultsItem)&lt;/strong&gt; from the &lt;strong&gt;ItemName&lt;/strong&gt; attribute of the &lt;strong&gt;Output&lt;/strong&gt; element within the &lt;strong&gt;Xml.GetValue&lt;/strong&gt; task element.&amp;#160; The following is the snippet of my &lt;strong&gt;tfsbuild.proj&lt;/strong&gt; file that does the versioning of the &lt;strong&gt;publish.htm&lt;/strong&gt; file:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
...
    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AfterCompile&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Copy&lt;/span&gt; &lt;span style="color: #ff0000"&gt;SourceFiles&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(SolutionRoot)\SupportFiles\publish.htm&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;DestinationFolder&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(OutDir)&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AfterDropBuild&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Extracting version from Application manifest...&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Xml.GetValue&lt;/span&gt;
            NameSpaces=&amp;quot;asmv1=urn:schemas-microsoft-com:asm.v1&amp;quot;
            Path=&amp;quot;$(DropLocation)\$(BuildNumber)\x86\Release\program.application&amp;quot;
            XPath=&amp;quot;/asmv1:assembly/asmv1:assemblyIdentity/@version&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
      
            &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Output&lt;/span&gt; &lt;span style="color: #ff0000"&gt;TaskParameter&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Results&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;ItemName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;ResultsItem&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Xml.GetValue&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Message&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Updating publish.htm to version @(ResultsItem)&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;File.RegEx&lt;/span&gt;
            Path=&amp;quot;$(DropLocation)\$(BuildNumber)\x86\Release\publish.htm&amp;quot;
            RegularExpression=&amp;quot;#VERSION#&amp;quot;
            NewValue=&amp;quot;@(ResultsItem)&amp;quot; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Target&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
...
&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Project&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;

&lt;div&gt;&amp;#160;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-4140262237397898014?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/4140262237397898014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=4140262237397898014' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4140262237397898014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4140262237397898014'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/teambuild-clickonce-versioning.html' title='TeamBuild ClickOnce – Versioning'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5739724172444165773</id><published>2008-05-16T10:42:00.001-07:00</published><updated>2008-06-03T10:15:13.599-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ClickOnce'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>TeamBuild ClickOnce – Automation</title><content type='html'>&lt;p&gt;I've had a ton of issues trying to get ClickOnce to work with MS Team Build starting from TFS 2005; we're now using TFS 2008.&amp;#160; Getting a bootstrap package to work with TeamBuild took some work, but I was able to do it with success early on.&amp;#160; &lt;/p&gt;  &lt;p&gt;In our 2005 environment, I had to place the signing certificate that I was using onto our build server and place it in the certificate store in order for any of my builds to work.&amp;#160; Without the stored certificate my builds would not complete.&amp;#160; Fine, my bootstrap packages work, but my ClickOnce builds didn't.&amp;#160; I didn't feel too bad because a ton of people out there have had issues with ClickOnce and Team Build.&amp;#160; &lt;/p&gt;  &lt;p&gt;Fast forward to our 2008 environment.&amp;#160; I had some minor issues with my bootstrap package as I posted about when I started my blog, but nothing compared to the ClickOnce issues I've had.&amp;#160; I decided to create a new build for my project in VS 2008 and start fresh.&amp;#160; I still got the same result: my build would hang and return no warnings.&amp;#160; &lt;/p&gt;  &lt;p&gt;My coworker got ClickOnce automation working on his project and I happy someone finally got it to work.&amp;#160; I really couldn't find any difference in our processes as far as the build automation went.&amp;#160; My project has a lot more dependencies, but that didn't seem to be the cause of my problems.&amp;#160; &lt;/p&gt;  &lt;p&gt;Every time I published my application manually, the certificate asked for a password.&amp;#160; This was the same password that I used to store the certificate on our build server.&amp;#160; My coworker's publishing didn't require him to enter one.&amp;#160; So then I thought to myself, maybe a password dialog is just sitting there waiting for input.&amp;#160; &lt;/p&gt;  &lt;p&gt;The reason I came to this conclusion was that I did some testing and looked at the output directory of where my files were being published.&amp;#160; Everything was being created and copied except my &amp;quot;.application&amp;quot; file.&amp;#160; That triggered the thought that my certificate wasn't signing the application manifest because of a certificate password window just sitting there waiting for input.&amp;#160; The build process can't handle window pop ups.&lt;/p&gt;  &lt;p&gt;My solution was to just create a new signing certificate with no password and this time I didn't place it in our build server's certificate store.&amp;#160; After adding the certificate to my project I ran my ClickOnce build and it worked...FINALLY!&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5739724172444165773?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5739724172444165773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5739724172444165773' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5739724172444165773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5739724172444165773'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/teambuild-clickonce-automation.html' title='TeamBuild ClickOnce – Automation'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-4879922014351755218</id><published>2008-05-15T14:29:00.001-07:00</published><updated>2008-05-15T14:29:39.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>MS Team Build Bug</title><content type='html'>&lt;p&gt;Today while scouring the MSDN forums I found something &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=107349&amp;amp;SiteID=1" target="_blank"&gt;interesting&lt;/a&gt;.&amp;#160; If you choose &amp;quot;Any CPU&amp;quot; as your platform in your &amp;quot;TFSBuild.proj&amp;quot; file, solution files will build correctly:&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;...
&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SolutionToBuild&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(BuildProjectFolderPath)/../../project.sln&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Targets&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Publish&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Targets&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;SolutionToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
 
 &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ConfigurationToBuild&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Release|Any CPU&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FlavorToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Release&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;FlavorToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;PlatformToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Any CPU&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;PlatformToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
 &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ConfigurationToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
...&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The problem is that I tried to publish a solution and for some reason it didn't work.&amp;#160; Actually, the reason was that I had references in my solution to non-publishable projects.&amp;#160; So it made sense then to just publish the project within the solution.&amp;#160; When I replaced the solution file with my VB Project file in the &amp;quot;SolutionToBuild&amp;quot; element, I got errors saying that the location of my executable couldn't be found.&amp;#160; I followed the suggestions on MSDN and changed my platform to x86. After making the change I was able to build both solution and project files:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;...
&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;SolutionToBuild&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;$(BuildProjectFolderPath)/../../project.vbproj&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Targets&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Publish&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Targets&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Properties&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;SolutionToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
 
 &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ConfigurationToBuild&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Release|x86&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;FlavorToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Release&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;FlavorToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
     &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;PlatformToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;x86&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;PlatformToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
 &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ConfigurationToBuild&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;

&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ItemGroup&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;
...&lt;/pre&gt;
&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-4879922014351755218?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/4879922014351755218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=4879922014351755218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4879922014351755218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/4879922014351755218'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/ms-team-build-bug.html' title='MS Team Build Bug'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-496825463179022086</id><published>2008-05-13T16:14:00.001-07:00</published><updated>2008-05-13T16:14:03.559-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>Visual Studio Bootstrapping (Part 3)</title><content type='html'>&lt;p&gt;My project has various prerequisites for it to run and the install location is set to download from the vendor's web site.&amp;#160; Unfortunately, the option to specify the location of the prerequisites affects all of them and you can't choose per prerequisite:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/peterchoi77/SCogs98EFMI/AAAAAAAAADM/Nqt64vPGdy8/s1600-h/prereqsvs%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="196" alt="prereqsvs" src="http://lh4.ggpht.com/peterchoi77/SCogtd8EFNI/AAAAAAAAADU/tJnzx1nEv6w/prereqsvs_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;BMG&lt;/a&gt; you can set the download URL of your prerequisite file by setting the &amp;quot;HomeSite URL&amp;quot; property:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SCogtt8EFOI/AAAAAAAAADc/BDzHrIYBA1w/s1600-h/homesite%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="198" alt="homesite" src="http://lh6.ggpht.com/peterchoi77/SCogt98EFPI/AAAAAAAAADk/tD8diGJAC1c/homesite_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I intentionally left mine blank as I wasn't sure if the download location would change frequently or not.&amp;#160; When I built my project, I got a build warning:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="39" alt="warning" src="http://lh3.ggpht.com/peterchoi77/SCoguN8EFQI/AAAAAAAAADs/gpJiXMG_iqs/warning%5B4%5D.jpg?imgmax=800" width="658" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Putting a &amp;quot;HomeSite URL&amp;quot; will exclude your prerequisite file from your setup package.&amp;#160; Instead your bootstrapper will depend on the URL to download the prerequisite.&amp;#160; If you put an invalid location, you'll get an error:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SCogud8EFRI/AAAAAAAAAD0/G--npP7c45A/s1600-h/installerror%5B2%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="198" alt="installerror" src="http://lh5.ggpht.com/peterchoi77/SCogut8EFSI/AAAAAAAAAD8/uNGXmjYT2_w/installerror_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As I mentioned before, I wasn't sure how often the links get updated and this was why I chose to include my prerequisite with my setup package.&amp;#160; &lt;/p&gt;  &lt;p&gt;If you're using a build server like our team is, make sure to copy your prerequisite package to your build server.&amp;#160; The default location for Visual Studio 2008's packages is &amp;quot;&lt;strong&gt;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages&lt;/strong&gt;&amp;quot;&amp;#160; Be sure to update your &amp;quot;tfsbuild.proj&amp;quot; file to take into account any copying of your prerequisite as well.&lt;/p&gt;  &lt;p&gt;Overall, &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;BMG&lt;/a&gt; is a great tool with some quirks and bugs.&amp;#160; Even with the issues I ran into, I'll still be using this utility to create any prerequisite packages that I might need.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-496825463179022086?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/496825463179022086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=496825463179022086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/496825463179022086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/496825463179022086'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/visual-studio-bootstrapping-part-3.html' title='Visual Studio Bootstrapping (Part 3)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/peterchoi77/SCogtd8EFNI/AAAAAAAAADU/tJnzx1nEv6w/s72-c/prereqsvs_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2081479867692533616</id><published>2008-05-13T15:27:00.001-07:00</published><updated>2008-05-13T15:27:12.999-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Bootstrapping (Part 2)</title><content type='html'>&lt;p&gt;Setting up system checks for prerequisites in &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;BMG&lt;/a&gt; is pretty straight forward.&amp;#160; The only option I chose was the MSI Product Check:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/peterchoi77/SCoVuN8EFEI/AAAAAAAAACM/hO4tHM5g2Qo/s1600-h/systemchecks4.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="189" alt="systemchecks" src="http://lh4.ggpht.com/peterchoi77/SCoVud8EFFI/AAAAAAAAACU/8b5Hyha7Iko/systemchecks_thumb2.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can either get your product code from the msi file that you're including or from your computer's installed applications.&amp;#160; They should return the same product code either way.&amp;#160; The &amp;quot;Property for Result&amp;quot; is just a variable name that you'll use to check against on the &amp;quot;Install Conditions&amp;quot; tab.&lt;/p&gt;  &lt;p&gt;After looking at the help file (which was another painful and buggy experience), these were the return codes I was supposed to check against:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/peterchoi77/SCoVut8EFGI/AAAAAAAAACc/IL78wWCiVCQ/s1600-h/helpfile4.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="104" alt="helpfile" src="http://lh3.ggpht.com/peterchoi77/SCoVvN8EFHI/AAAAAAAAACk/h6Bdh0tdrWU/helpfile_thumb2.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;However, even with my prerequisite installed, my &amp;quot;setup.exe&amp;quot; kept wanting to install my prerequisite.&amp;#160; I had to intentionally make my setup package fail so that I could snoop into the installation log.&amp;#160; What I found was that the return code that I needed to check against wasn't in the help file, the value I was supposed to check against was &amp;quot;5&amp;quot;:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SCoVvd8EFII/AAAAAAAAACs/eaeflsh_Uo4/s1600-h/Installconditions4.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="189" alt="Installconditions" src="http://lh5.ggpht.com/peterchoi77/SCoVvt8EFJI/AAAAAAAAAC0/OFZY_1OI4xM/Installconditions_thumb2.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After adding the above condition, my prerequisite checks worked correctly, but my installation failed due to an exit code issue.&amp;#160; On the &amp;quot;Exit Codes&amp;quot; tab, I had to insert a success for exit code &amp;quot;0&amp;quot; in order for my setup package to determine that my prerequisite installed correctly:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/peterchoi77/SCoVv98EFKI/AAAAAAAAAC8/p1euK279bjM/s1600-h/exitcodes2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="197" alt="exitcodes" src="http://lh3.ggpht.com/peterchoi77/SCoVwN8EFLI/AAAAAAAAADE/unPfAE5ao4c/exitcodes_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2081479867692533616?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2081479867692533616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2081479867692533616' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2081479867692533616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2081479867692533616'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/visual-studio-bootstrapping-part-2.html' title='Visual Studio Bootstrapping (Part 2)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/peterchoi77/SCoVud8EFFI/AAAAAAAAACU/8b5Hyha7Iko/s72-c/systemchecks_thumb2.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-6292556861262398817</id><published>2008-05-13T14:39:00.001-07:00</published><updated>2008-05-13T15:22:05.261-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Bootstrapping (Part 1)</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;p&gt;We added a new feature to my current project that required a third party application as a prerequisite. Hooking this into Visual Studio seemed pretty straight forward; just use a bootstrapping program to create the necessary bootstrap package for Visual Studio. You can also create your own manually.&lt;/p&gt;  &lt;p&gt;I used &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;Bootstrapper Manifest Generator&lt;/a&gt; to generate my bootstrap package.&amp;#160; Although this application was quite buggy for me, in the end it got the job done.&amp;#160; However, it wasn't as easy as it should have been to get the whole process going.&lt;/p&gt;  &lt;p&gt;The current version of &lt;a href="http://www.codeplex.com/bmg" target="_blank"&gt;BMG&lt;/a&gt; for Visual Studio 2008 is still in beta, so that may account for the numerous bugs I encountered when running this application.&amp;#160; I also had some issues figuring out how to get things to work the way I wanted.&amp;#160; For instance, if you want a progress bar for your prerequisite's installation, you'll need to put in an installation time:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/peterchoi77/SCoUiN8EFDI/AAAAAAAAAB4/3L26V-9Sqcg/s1600-h/BMGProperties.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="196" alt="BMGProperties" src="http://lh6.ggpht.com/peterchoi77/SCoKi98EFAI/AAAAAAAAACA/GBoaj6OybN4/BMGProperties_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you don't put a time (which is just a guess anyway), you'll end up with a screen like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/peterchoi77/SCoKjd8EFBI/AAAAAAAAACE/rZvn6VrOr8Q/s1600-h/prereqinstall%5B1%5D.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="100" alt="prereqinstall" src="http://lh6.ggpht.com/peterchoi77/SCoKj98EFCI/AAAAAAAAACI/mjIUnDteMCQ/prereqinstall_thumb.jpg?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The prerequisite will install, but you'll have no progress bar.&amp;#160; Not a show stopper, but I found this to be unappealing.&amp;#160; Also, if you overshoot your installation time, the progress bar will never reach the end before exiting this screen.&amp;#160; If you undershoot it, the progress bar will go to the end and start over.&amp;#160; I chose the latter.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-6292556861262398817?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/6292556861262398817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=6292556861262398817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6292556861262398817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6292556861262398817'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/05/visual-studio-bootstrapping-part-1.html' title='Visual Studio Bootstrapping (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/peterchoi77/SCoKi98EFAI/AAAAAAAAACA/GBoaj6OybN4/s72-c/BMGProperties_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2481935846271878132</id><published>2008-04-23T19:36:00.001-07:00</published><updated>2008-04-23T19:50:41.585-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><title type='text'>Iterating Through "My.Resources"</title><content type='html'>&lt;p&gt;The &amp;quot;My&amp;quot; namespace in VB.NET is indispensable. Settings and resources among other things can be easily accessed by using it. You can place items such as files or images in &amp;quot;My.Resources&amp;quot; and access them in your code in a very simple manner:&amp;#160; &lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; MyObject &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; 

MyObject = My.Resources.ObjectName&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;However, iterating through My.Resources is another issue. You might think you could do it this way: &lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; My.Resources 
   &lt;span style="color: #008000"&gt;'more code here &lt;/span&gt;
&lt;span style="color: #0000ff"&gt;Next&lt;/span&gt; &lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;You can't. &amp;quot;My.Resources&amp;quot; is a namespace and not a collection that implements IEnumerable. So what do you do? You have to enumerate the objects in &amp;quot;My.Resources&amp;quot; if you want to iterate through them. I started out on the MSDN forums looking for a &lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=486693&amp;amp;SiteID=1" target="_blank"&gt;starting point&lt;/a&gt; and I came up with this implementation: &lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; GetMyResourcesDictionary() &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Dictionary(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;) 
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ItemDictionary &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; Dictionary(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;) 
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ItemEnumerator &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; System.Collections.IDictionaryEnumerator 
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ItemResourceSet &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; Resources.ResourceSet 
  &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; ResourceNameList &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) 

  ItemResourceSet = My.Resources.ResourceManager.GetResourceSet(&lt;span style="color: #0000ff"&gt;New&lt;/span&gt; System.Globalization.CultureInfo(&lt;span style="color: #006080"&gt;&amp;quot;en&amp;quot;&lt;/span&gt;), &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;True&lt;/span&gt;) 

  &lt;span style="color: #008000"&gt;'Get the enumerator for My.Resources &lt;/span&gt;
  ItemEnumerator = ItemResourceSet.GetEnumerator 

  &lt;span style="color: #0000ff"&gt;Do&lt;/span&gt; &lt;span style="color: #0000ff"&gt;While&lt;/span&gt; ItemEnumerator.MoveNext 
    ResourceNameList.Add(ItemEnumerator.Key.ToString) 
  &lt;span style="color: #0000ff"&gt;Loop&lt;/span&gt; 

  &lt;span style="color: #0000ff"&gt;For&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Each&lt;/span&gt; resourceName &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt; &lt;span style="color: #0000ff"&gt;In&lt;/span&gt; ResourceNameList 
    ItemDictionary.Add(resourceName, GetItem(resourceName)) 
  &lt;span style="color: #0000ff"&gt;Next&lt;/span&gt; 

  ResourceNameList = &lt;span style="color: #0000ff"&gt;Nothing&lt;/span&gt; 

  &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; ItemDictionary 
&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; 

&lt;span style="color: #0000ff"&gt;Public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Function&lt;/span&gt; GetItem(&lt;span style="color: #0000ff"&gt;ByVal&lt;/span&gt; resourceName &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;) &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt; 
  &lt;span style="color: #0000ff"&gt;Return&lt;/span&gt; My.Resources.ResourceManager.GetObject(resourceName) 
&lt;span style="color: #0000ff"&gt;End&lt;/span&gt; Function&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;The reason I did it this way was so that I could call GetMyResourcesDictionary once and I'd have a Dictionary object that I could iterate through.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2481935846271878132?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2481935846271878132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2481935846271878132' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2481935846271878132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2481935846271878132'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/iterating-through.html' title='Iterating Through &amp;quot;My.Resources&amp;quot;'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-6887767479751501819</id><published>2008-04-15T12:58:00.001-07:00</published><updated>2008-04-15T12:58:35.579-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Unit Testing (Part 2)</title><content type='html'>&lt;p&gt;Our team aims for at least 70% code coverage with our unit tests.&amp;#160; I've read that quite a few people only test public methods as the private methods will eventually be reached this way. From my experience this isn't always the case. &lt;/p&gt;  &lt;p&gt;We use Visual Studio 2008's built in unit testing framework.&amp;#160; The nice thing about this framework is that it's integrated into the IDE and simply right-clicking on a method or class will bring up options to create unit tests.&amp;#160; Along with this, accessor classes are created so that you have access to private fields and methods.&lt;/p&gt;  &lt;p&gt;I test both public and private methods just to be exhaustive. Sometimes I run into conditional statements that I can't test fully without the class accessors.&amp;#160; I've hit 80%+ code coverage on my current project, but I will be looking into &lt;a href="http://www.codeplex.com/white" target="_blank"&gt;white&lt;/a&gt; to test the UI in my project as well. This will certainly boost code coverage.&lt;/p&gt;  &lt;p&gt;Order matters in unit tests.&amp;#160; For example, I have classes that depend on other classes to work.&amp;#160; The unit test stubs that get inserted by the IDE do not account for this, it merely gives you a very trivial skeleton.&amp;#160; It is up to you to make sure that you have all of the dependent classes instantiated before testing the class that you actually want to test.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-6887767479751501819?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/6887767479751501819/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=6887767479751501819' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6887767479751501819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/6887767479751501819'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/unit-testing-part-2.html' title='Unit Testing (Part 2)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5096546917322635402</id><published>2008-04-14T12:19:00.001-07:00</published><updated>2008-04-14T12:19:45.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unit Testing'/><title type='text'>Unit Testing (Part 1)</title><content type='html'>&lt;p&gt;I've heard about unit testing before I started here at KPMG, but had zero experience with it.&amp;#160; My software developer friends have experience with unit testing because most of them are part of huge development teams and deal with mission critical software.&amp;#160; I understood the concept, but really didn't understand its value... until I added unit testing to my current project. &lt;/p&gt;  &lt;p&gt;I'll be honest, I don't find writing unit tests fun.&amp;#160; I'd much rather be developing new stuff or even fixing bugs, but I found numerous bugs that I wouldn't have found without unit tests. Users would most likely have found these bugs while using the application which would require tracking the issue, fixing the problem, testing the solution, and finally releasing a new version.&amp;#160; This is a lot of time (and money) wasted.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5096546917322635402?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5096546917322635402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5096546917322635402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5096546917322635402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5096546917322635402'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/unit-testing-part-1.html' title='Unit Testing (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-7470904045525350418</id><published>2008-04-10T11:59:00.001-07:00</published><updated>2008-04-24T09:44:31.616-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Basic'/><category scheme='http://www.blogger.com/atom/ns#' term='LINQ'/><title type='text'>Generic Lists and LINQ</title><content type='html'>&lt;p&gt;When LINQ was introduced I was pretty uninterested. I thought to myself, &amp;quot;what's the point?&amp;quot; Well, after using it I think it's an invaluable part of the .NET Framework.&lt;/p&gt;  &lt;p&gt;Ever since our team was given the go to update our environment to VS 2008 and .NET 3.5, I've been including LINQ in my current project. Granted I'm only using LINQ to objects, but I see myself using LINQ to XML when I come to that point.&lt;/p&gt;  &lt;p&gt;I use Generic Lists all over the place in my project. Today I ran across something I found interesting while I was doing something that required copying of a List. Copying List contents to another List without LINQ is pretty simple.&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; CopyList &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;New&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;)

CopyList.AddRange(OriginalList)&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Now with LINQ, you can use the ToList extension method and you don't have to create a New CopyList up front.&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; CopyList &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; List(Of &lt;span style="color: #0000ff"&gt;Object&lt;/span&gt;)

CopyList = OriginalList.ToList&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;Also, from my testing (admittedly light and crude) the ToList extension method is faster at completing the copy.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-7470904045525350418?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/7470904045525350418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=7470904045525350418' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7470904045525350418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/7470904045525350418'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/generic-lists-and-linq.html' title='Generic Lists and LINQ'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-2707273165588275118</id><published>2008-04-08T12:03:00.001-07:00</published><updated>2008-04-08T12:49:36.615-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>MS Team Foundation Server / Team Build (Part 2)</title><content type='html'>&lt;p&gt;Creating a stand alone setup.exe/msi wasn't as easy for me as it should have been. Following Microsoft's &lt;a href="http://msdn2.microsoft.com/en-us/library/ms404859.aspx" target="_blank"&gt;suggestion&lt;/a&gt; of adding the .vdproj file to my &amp;quot;AfterCompile&amp;quot; target in my TFSBuild.proj file did not work; I got a compile error. &lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
...
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;AfterCompile&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Exec&lt;/span&gt; &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;amp;quot;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv&amp;amp;quot;&amp;amp;quot;$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\HelloWorldTestInstaller.vdproj /Build &amp;amp;quot;Debug|Any CPU&amp;amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; 
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\HelloWorldTestInstaller.msi&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(OutDir)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; 
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(SolutionRoot)\HelloWorldTest\HelloWorldTestInstaller\Debug\setup.exe&amp;quot;&lt;/span&gt; 
&lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(OutDir)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; 
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;font face="Verdana"&gt;What I ended up doing was replacing the .vdproj file with the entire .sln file. Then I copied the setup.exe and .msi files out to the specified drop directory.&lt;/font&gt;&lt;/pre&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
...
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt; &lt;span class="attr"&gt;Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;AfterCompile&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Exec&lt;/span&gt; &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;del &amp;amp;quot;$(OutDir)*&amp;amp;quot; /q&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Exec&lt;/span&gt; &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;amp;quot;C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv&amp;amp;quot; &amp;amp;quot;$(SolutionRoot)\Project.sln&amp;amp;quot; /Build &amp;amp;quot;Debug|Any CPU&amp;amp;quot;&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(SolutionRoot)\ProjectSetup.msi&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(OutDir)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(SolutionRoot)\setup.exe&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;$(OutDir)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Target&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Project&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-2707273165588275118?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/2707273165588275118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=2707273165588275118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2707273165588275118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/2707273165588275118'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/ms-team-foundation-server-team-build_08.html' title='MS Team Foundation Server / Team Build (Part 2)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-3896214369476972804</id><published>2008-04-08T11:46:00.001-07:00</published><updated>2008-04-08T12:48:18.043-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><title type='text'>MS Team Foundation Server / Team Build (Part 1)</title><content type='html'>&lt;p&gt;I've had to setup my current project at work so that it uses TFS's build automation. &amp;quot;F5 is not a compile solution&amp;quot; as I've been told by my &lt;a href="http://coolthingoftheday.blogspot.com/"&gt;boss&lt;/a&gt;. I completely agree with this because I've run into the whole &amp;quot;well it works on my machine&amp;quot; syndrome many times. &lt;/p&gt;  &lt;p&gt;Having a dedicated server to compile my solution gives me a better grasp of how things would work on a machine that didn't have all of my development tools on it (aside from what's required by Team Build).&lt;/p&gt;  &lt;p&gt;I also had the pleasure (more like pain) of upgrading my TFS 2005 build script to 2008 when we upgraded. This in itself is really simple to do, you just simply move it on over and TFS 2008 just runs the 2005 version in compatibility mode. &lt;/p&gt;  &lt;p&gt;However, I didn't want to just run an older version so I just copied out the part that I wanted from the 2005 version, re-ran the wizard to build a 2008 version, and pasted the chunk of text. Much to my disappointment, the build script didn't work anymore. &lt;/p&gt;  &lt;p&gt;I looked at my file over and over again. I and others on the MSDN forums found nothing wrong with it. Finally, it was suggested I just delete the TFSBuild.proj file on the build server so that TFS copies it to the build server again... it worked. &lt;/p&gt;  &lt;p&gt;Lesson learned: be sure to check out the TFSBuild.proj file when making edits and don't modify in memory if that message box comes up. I spent a good part of a whole week trying to figure out why it wasn't working.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-3896214369476972804?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/3896214369476972804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=3896214369476972804' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3896214369476972804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/3896214369476972804'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/ms-team-foundation-server-team-build.html' title='MS Team Foundation Server / Team Build (Part 1)'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7049316631692964922.post-5938188650085687730</id><published>2008-04-07T20:08:00.000-07:00</published><updated>2008-04-08T12:50:59.837-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='General'/><title type='text'>My first post...</title><content type='html'>My &lt;a href="http://coolthingoftheday.blogspot.com/"&gt;boss&lt;/a&gt; suggested I share my software development experiences (aka trials and tribulations) from work. This blog will be my medium to do that. I will share things that I've learned and gone through to possibly ease someone else's pain.  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7049316631692964922-5938188650085687730?l=myramserialize.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myramserialize.blogspot.com/feeds/5938188650085687730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7049316631692964922&amp;postID=5938188650085687730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5938188650085687730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7049316631692964922/posts/default/5938188650085687730'/><link rel='alternate' type='text/html' href='http://myramserialize.blogspot.com/2008/04/my-first-post.html' title='My first post...'/><author><name>Peter Choi</name><uri>http://www.blogger.com/profile/07402729528155082461</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
