<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Joe Wrobel </title><subtitle type="html" /><id>http://weblogs.asp.net/joewrobel/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/joewrobel/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-01-30T17:47:00Z</updated><entry><title>Web Profile Builder 2.0.0.0</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2013/03/28/web-profile-builder-2-0-0-0.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2013/03/28/web-profile-builder-2-0-0-0.aspx</id><published>2013-03-28T07:19:22Z</published><updated>2013-03-28T07:19:22Z</updated><content type="html">&lt;div style="direction: ltr"&gt;   &lt;div style="direction: ltr; margin-left: 0in; margin-top: 0in; width: 8.5in"&gt;     &lt;div style="direction: ltr; margin-left: 0in; margin-top: 0in; width: 8.5in"&gt;       &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;It's been over five years since I've made any updates to this project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I had basically &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;left it for dead because I personally no longer have a need for it.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I know a lot of &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;people do still rely on it though.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I had some free time recently so I decided to give &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;the project a little bump to make it easier to use and more accessible to those who do &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;still use it.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;span style="text-decoration: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&lt;strong&gt;&lt;u&gt;What's changed?&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="disc"&gt;         &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Most importantly, this is no longer required to be installed in the GAC.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;             &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="circle"&gt;             &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;There is no installer at all anymore!&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;              &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Now it can be included in the project source control and referenced                      &lt;br /&gt;locally.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/li&gt;          &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Added support to install using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;&lt;a href="https://nuget.org/"&gt;&lt;span style="font-family: "&gt;&lt;font color="#0066cc" face="Consolas"&gt;NuGet&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;             &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="circle"&gt;             &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;PM&amp;gt; Install-Package WebProfileBuilder&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/li&gt;          &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Simplified the configuration.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;             &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="circle"&gt;             &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Support for configuration via Web.config has been removed. This was                      &lt;br /&gt;more of a &amp;quot;nice to have&amp;quot; feature and added unneeded complexity to                       &lt;br /&gt;the code base.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;              &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;All configurable options are still supported, but now it has to be                      &lt;br /&gt;configured in the web project file.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;See below for a complete                       &lt;br /&gt;example of the configuration.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/li&gt;          &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Moved project home to &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;&lt;a href="http://www.codeplex.com/"&gt;&lt;span style="font-family: "&gt;&lt;font color="#0066cc" face="Consolas"&gt;CodePlex&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;             &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="circle"&gt;             &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;a href="https://webprofilebuilder.codeplex.com/"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt" color="#0066cc"&gt;https://webprofilebuilder.codeplex.com/&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/a&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/li&gt;          &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;Added build automation to the source code using &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt;&lt;a href="http://nant.sourceforge.net/"&gt;&lt;span style="font-family: "&gt;&lt;font color="#0066cc" face="Consolas"&gt;NAnt&lt;/font&gt;&lt;/span&gt;&lt;/a&gt;&lt;/font&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;       &lt;/ul&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;span style="text-decoration: "&gt;&lt;strong&gt;&lt;u&gt;&lt;font style="font-size: 11pt"&gt;IMPORTANT NOTES:&lt;/font&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;font style="font-size: 11pt"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="disc"&gt;         &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;The core code base has not been changed.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;I didn't want to introduce any bugs, so                   &lt;br /&gt;I only changed the code necessary to achieve my goal.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;All code changes were                   &lt;br /&gt;related to configuration.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;If you are new to WebProfileBuilder, know the following:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;             &lt;ul style="margin-bottom: 0in; unicode-bidi: embed; direction: ltr; margin-left: 0.375in; margin-top: 0in" type="circle"&gt;             &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;The generated profile class does not get automatically included into the                      &lt;br /&gt;project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You must use the Solution Explorer to show all files, then                       &lt;br /&gt;manually include the generated class into your project.&lt;span style="mso-spacerun: yes"&gt;&amp;#160; &lt;/span&gt;You only                       &lt;br /&gt;need to do this once.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;              &lt;li style="margin-bottom: 0px; vertical-align: middle; margin-top: 0px"&gt;&lt;span style="font-family: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;You also must create the &amp;quot;Profile&amp;quot; property in your Page class. See                      &lt;br /&gt;below for an example.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/li&gt;           &lt;/ul&gt;         &lt;/li&gt;       &lt;/ul&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;span style="text-decoration: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&lt;strong&gt;&lt;u&gt;Example web project file:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: yellow"&gt;&lt;font style="background-color: #ffff00" color="#ff0000"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;?&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;xml&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;version&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;1.0&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;encoding&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;utf-8&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: ; mso-highlight: yellow"&gt;&lt;font style="font-size: 10pt; background-color: #ffff00" color="#ff0000"&gt;?&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;&amp;lt;Project&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;ToolsVersion&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;4.0&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;DefaultTargets&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;Build&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;http://schemas.microsoft.com/developer/msbuild/2003&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;strong&gt;&amp;#160;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;&amp;lt;!-- ... other project content ... --&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;&amp;lt;!--WebProfileBuilder setup.--&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;UsingTask&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;TaskName&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;BuildWebProfile&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;AssemblyFile&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;..\packages\WebProfileBuilder.2.0.0.0\tools\                   &lt;br /&gt;WebProfileBuilder.dll&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;Target&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;BeforeBuild&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;&amp;lt;!--WebSiteRoot, RootNamespace, and Language are required.--&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;&amp;lt;!--ClassName, Directory, and FileName are optional for additional customization.--&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;BuildWebProfile&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;WebSiteRoot&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;$(ProjectDir)&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;RootNamespace&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;$(RootNamespace)&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;Language&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;$(Language)&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;ClassName&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;MyWebProfile&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;Directory&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;CodeFiles&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#ff0000"&gt;FileName&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;=&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;&lt;strong&gt;&amp;quot;MyWebProfile&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;lt;/Target&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;&amp;lt;!-- ... other project content ... --&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&lt;strong&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="margin-bottom: 8pt; font-family: ; color: ; margin-top: 0pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#0000ff"&gt;&amp;lt;/Project&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;span style="text-decoration: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 11pt"&gt;&lt;strong&gt;&lt;u&gt;Example page class:&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;using&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; System&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;using&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; System&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;Collections&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;Generic&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;using&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; System&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;Web&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;UI&lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;&lt;font style="font-size: 10pt"&gt;namespace&lt;/font&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; CsExample &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; partial &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;class&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; _Default &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;:&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; Page &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;//... other class content ...&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;public&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#8000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; MyWebProfile Profile &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;get &lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 10pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#0000ff"&gt;&lt;strong&gt;return&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; MyWebProfile&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;Current&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font color="#000080"&gt;&lt;strong&gt;;&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt; &lt;/span&gt;&lt;/font&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; color: ; margin: 0in"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#008000"&gt;//... other class content ...&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="font-family: ; margin: 0in"&gt;&lt;font face="Courier New"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font style="font-size: 10pt"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%; color: "&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;        &lt;p style="margin-bottom: 8pt; font-family: ; color: ; margin-top: 0pt"&gt;&lt;span style="background-image: none; background-repeat: repeat; background-attachment: scroll; background-position: 0% 0%"&gt;&lt;font face="Courier New"&gt;&lt;font style="font-size: 10pt" color="#000080"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=10061639" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="Profile" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx" /><category term="WAP" scheme="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx" /><category term="Web Application Project" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx" /></entry><entry><title>Conditional Project Reference</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2013/02/14/conditional-project-reference.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2013/02/14/conditional-project-reference.aspx</id><published>2013-02-15T06:59:27Z</published><updated>2013-02-15T06:59:27Z</updated><content type="html">&lt;p&gt;I develop a lot of different applications. They range from large inventory tracking websites, to Windows services, to user interfaces encapsulating scripts written by someone else. I get asked to make many different things. It can sometimes be difficult to keep from reinventing the wheel in different projects. So it's very useful to maintain a common library to reference from the different projects. Regardless of what you keep in the library, utilities, base classes, or the dreaded &amp;quot;helper methods&amp;quot;, it does become challenging to work with.&lt;/p&gt;  &lt;p&gt;The common library source code is kept separate from the project I'm actively working on. Because of this, I keep the compiled binaries from the common library checked into the source control of the active project. I do this to assure that the active project will always build because it is only dependent on the common library binaries, not the common library project.&lt;/p&gt;  &lt;p&gt;As I work in the active project, I often want to move code into the common library. It's easy to make a project reference to the common library project, but I don't want to commit the files into source control this way. I want to commit with a normal reference to the binary. It would be a pain to keep switching the reference back and forth every time I make a commit.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;What I have been using for this is a second solution file and conditional references in the active project files. &lt;/p&gt;  &lt;p&gt;The second solution file is a duplicate of the primary solution file, but it also includes a project link for the external common library project and is named with &amp;quot;_Externals&amp;quot; appended to the name. For example, &amp;quot;Project1_Externals.sln&amp;quot;.&lt;/p&gt;  &lt;p&gt;The project files of the active project, contain a &amp;quot;Choose&amp;quot; condition based on the name of the solution file. So if I open the &amp;quot;_Externals&amp;quot; solution file, then I get the project reference to the external common library. And if I open the primary solution file, then I get a normal reference to the common library binary.&lt;/p&gt;  &lt;p&gt;My projects are always setup with a script I can double click to build the project. The build script is configured to use the primary solution file and will ignore the &amp;quot;_Externals&amp;quot; solution file.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4"&gt;   &lt;div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;     &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Choose&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;When&lt;/span&gt;&amp;#160;&lt;span style="color: #ff0000"&gt;Condition&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot; '$(SolutionName)' == 'Project1_Externals' &amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160; &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;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008000"&gt;&amp;lt;!--Reference to external project.--&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;ProjectReference&lt;/span&gt;&amp;#160;&lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;..\..\..\Robolize\src\Robolize.Common\Robolize.Common.csproj&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &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;{D96C6B47-C277-420B-BA20-E6EB004766A4}&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;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Robolize.Common&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;ProjectReference&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160; &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;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;When&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Otherwise&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160; &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;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #008000"&gt;&amp;lt;!--Reference to the local binary in source control.--&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Reference&lt;/span&gt;&amp;#160;&lt;span style="color: #ff0000"&gt;Include&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Robolize.Common&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;HintPath&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;..\lib\Robolize.Common\Robolize.Common.dll&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;HintPath&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Reference&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&amp;#160;&amp;#160;&amp;#160; &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;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Otherwise&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Choose&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;Update:&lt;/h2&gt;

&lt;p&gt;The workflow involved goes something like this:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;The majority of the time, I open the &amp;quot;_Externals&amp;quot; solution as I work.&lt;/li&gt;

  &lt;li&gt;If I've made any changes to the external common library code when I'm ready to commit, then I rebuild the common library and include the newly compiled binaries with the commit.&lt;/li&gt;

  &lt;ul&gt;
    &lt;li&gt;The common library project is part of a solution with other projects which live in their own source control repository. This is also configured with a build script I can double click to build the common library solution. The build script includes things like versioning, testing, and moving files around to construct the final output in a specified build folder.&lt;/li&gt;

    &lt;li&gt;To streamline the process of updating the binaries for the commit, I create a quick and dirty script. This script will call the build script of the common library solution, then take the output binaries of the common library and copy them over to a &amp;quot;lib&amp;quot; folder which is part of the active project and will be included in the commit.&lt;/li&gt;
  &lt;/ul&gt;
&lt;/ol&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9874690" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term=".NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/.NET/default.aspx" /><category term="Visual Studio" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Visual+Studio/default.aspx" /></entry><entry><title>Automating ClickOnce Deployment</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2013/02/06/automating-clickonce-deployment.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2013/02/06/automating-clickonce-deployment.aspx</id><published>2013-02-07T04:43:00Z</published><updated>2013-02-07T04:43:00Z</updated><content type="html">&lt;P&gt;Building a ClickOnce deployment outside of Visual Studio can be a difficult task. One point I want to make clear is that there is no magic going on to make your application deployable using ClickOnce. Well, unless you are using the tooling inside of Visual Studio, in which case there is a lot of magic happening. Much to its credit, Visual Studio does make it very easy to setup and publish a ClickOnce deployment for your application. That said, my suggestion would be to just use Visual Studio if it fits your workflow. However, if you need a fully automated solution to create a ClickOnce deployment outside of Visual Studio, then continue reading. In my environment, my builds are automated using NAnt, which are then built on a build server using CruseControl.Net.&lt;/P&gt;
&lt;P&gt;My end goal with automating the ClickOnce deployment was to mimic the output as created by Visual Studio.&amp;nbsp; I didn't have to do this, but I wanted to just incase I might ever need to resort back to using Visual Studio.&amp;nbsp; I didn't want to get caught in a situation where my automated ClickOnce deployment files conflict with the files generated by Visual Studio.&lt;/P&gt;
&lt;P&gt;In general, a ClickOnce deployment requires two files. An application manifest and a deployment manifest. The application manifest contains details of the application. Some of these details include dependencies, security privileges, and a complete listing of every file required by the application.&lt;/P&gt;
&lt;P&gt;The deployment manifest contains details of, you guessed it, the deployment. For this file, my focus is primarily on the deployment strategy. It is also worth noting that this file will contain a dependency which is basically a pointer to the application manifest.&lt;/P&gt;
&lt;P&gt;I know I'm only scratching the surface of what these two files actually contain. I'm calling out the details which are directly relevant here. I'm trying hard to avoid using the phrase, "beyond the scope of this article", but there it is. As much as I dislike that phrase, I'm using it anyway. Really, if you want to know more about these two files, look at the &lt;A href="http://msdn.microsoft.com/en-us/library/t71a733d.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/t71a733d.aspx"&gt;Microsoft documentation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;As I went through this process, I did find a &lt;A href="http://msdn.microsoft.com/en-us/library/xc3tc5xx.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/xc3tc5xx.aspx"&gt;walkthrough&lt;/A&gt; in the Microsoft documentation that you may find helpful. I followed the steps myself, but it didn't take me where I wanted to go and was hard to follow due to lack of detail. When I finished the walkthrough, I had more questions than when I started. But it did help to guide me in the right direction, so I want to point it out.&lt;/P&gt;
&lt;H3&gt;Steps to automate a ClickOnce application&lt;/H3&gt;
&lt;P&gt;&lt;STRONG&gt;1.&lt;/STRONG&gt; Obtain or create a ".pfx" key file for signing the manifest files. The key file can also be used to sign the assembly/executable of the application if wanted, but not required. You can create a key file using the "Signing" tab of the project properties window. I think there are other kinds of keys that can be used for signing, but I am not an expert in this area so I'm saying as little about it as possible. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;2.&lt;/STRONG&gt; Add an "app.manifest" file to the project. This will give you a physical file that you can make custom edits to if needed. I personally didn't need to make any custom edits, but at least I have that option if I ever need to. This file will get updated post build using the Mage.exe utility. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;3.&lt;/STRONG&gt; Build the project/application to get all the files required for the application to run. Also, copy any extra files needed to deploy with the app such as the main app icon. The goal here is to create a folder containing your entire application. All your resource files, data files, help files, referenced dlls, everything.&amp;nbsp; I use NAnt to automate this process. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;4.&lt;/STRONG&gt; Make any last changes to configuration files or whatever content you need to change for the deployment target.&amp;nbsp; This is important. &lt;STRONG&gt;Do not change any application content after the application manifest has been updated&lt;/STRONG&gt; because it will make the application manifest invalid. The application manifest contains hash codes for every file. This is a security measure to prevent any tampering with the files. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;5.&lt;/STRONG&gt; Use Mage.exe to update the application manifest. Note, if you are using the ".deploy" extension for your files, you'll want to do this step before appending the ".deploy" extension to the files. If this doesn't make sense right now, don't worry about it yet. I'll explain more about this with web hosted deployment.&amp;nbsp; Below is an example of this command. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#4bacc6&gt;mage.exe -Update build\ClickOnceExample-Release\ClickOnceExample.exe.manifest &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -ToFile "build\ClickOnceExample-Release\Application Files\1.1.0.6125\ClickOnceExample.exe.manifest" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -FromDirectory "build\ClickOnceExample-Release\Application Files\1.1.0.6125" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Version 1.1.0.6125&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;6.&lt;/STRONG&gt; Use Mage.exe to sign the application manifest using your personal ".pfx" key file. Once the file is signed, your done with it. Leave it alone. Below is an example of this command. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#4bacc6&gt;mage.exe -Sign "build\ClickOnceExample-Release\Application Files\1.1.0.6125\ClickOnceExample.exe.manifest" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -CertFile src\Robolize.ClickOnceExample\ClickOnceExample.pfx &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Password ClickOnceExample&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;7.&lt;/STRONG&gt; Create a deployment manifest file. This is the most troublesome part and I'll do my best to explain. I didn't find any single good solution to generate this file. One thing I can't explain is that once I added the app.manifest to the project, Visual Studio started generating a deployment manifest as well. I guess it's one of those magic tricks that Visual Studio performs. I didn't find a way to make this file not generate. I wouldn't mind, but I couldn't use the file as it was and I don't know of a way to set any properties for the generation of the file to make it useable. But in the end it doesn't really matter because it will get overwritten anyway. &lt;BR&gt;This became a two-step process because not all the desired properties of the deployment manifest can be set using one method or the other. When using Mage.exe, you cannot set the update strategy to "beforeApplicationStartup", which is what I wanted. Someone else did some in-depth research on this issue and discovered a brick wall. I took his word for it, but you can see for yourself &lt;A href="http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/2d32037b-e43a-4c4f-b55d-27eab1b7bd58/" target=_blank mce_href="http://social.msdn.microsoft.com/forums/en-US/winformssetup/thread/2d32037b-e43a-4c4f-b55d-27eab1b7bd58/"&gt;here&lt;/A&gt;.&amp;nbsp; When using the "GenerateDeploymentManifest" task, you cannot properly set the "EntryPoint" because the final output of the application files will have a different directory structure than the default flat output from building inside of Visual Studio. So here's what to do. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;7a.&lt;/STRONG&gt; First, setup the "GenerateDeploymentManifest" task in the "AfterBuild" target of the main project file. This will generate a usable deployment manifest file. &lt;BR&gt;&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;lt;?&lt;/SPAN&gt;&lt;SPAN class=html&gt;xml&lt;/SPAN&gt; &lt;SPAN class=attr&gt;version&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="1.0"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;encoding&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="utf-8"&lt;/SPAN&gt;?&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &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=attr&gt;ToolsVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="4.0"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;DefaultTargets&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Build"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;    &lt;SPAN class=attr&gt;xmlns&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="http://schemas.microsoft.com/developer/msbuild/2003"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;  &lt;SPAN class=rem&gt;&amp;lt;!-- Other project content... --&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;  &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   7:  &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;="AfterBuild"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;GenerateDeploymentManifest&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;AssemblyName&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="ClickOnceExample.application"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;Product&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="ClickOnceExample"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;Install&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="true"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;UpdateEnabled&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="true"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;UpdateMode&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Foreground"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;CreateDesktopShortcut&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="true"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;OutputManifest&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(OutputPath)\ClickOnceExample.application"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;EntryPoint&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="$(OutputPath)ClickOnceExample.exe.manifest"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;TargetFrameworkVersion&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="4.5"&lt;/SPAN&gt; &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;        &lt;SPAN class=attr&gt;TargetFrameworkMoniker&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;=".NETFramework,Version=v4.5"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=alt&gt;&lt;SPAN class=lnum&gt;  19:  &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;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  20:  &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;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;BR&gt;&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;The most important properties to set in the "GenerateDeploymentManifest" task are the following: 
&lt;UL&gt;
&lt;LI&gt;Install="true" &lt;/LI&gt;
&lt;LI&gt;UpdateEnabled="true" &lt;/LI&gt;
&lt;LI&gt;UpdateMode="Foreground" &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;7b.&lt;/STRONG&gt; Next, use Mage.exe to update the deployment manifest file. This step assumes that the application directory structure has been setup either manually or as part of the build script. One important note to make for updating the deployment manifest with Mage.exe, &lt;STRONG&gt;Do not set the "Install" flag here&lt;/STRONG&gt; because it will wipe out the settings set by the "GenerateDeploymentManifest" task and defeat the purpose of having used it in the first place.&amp;nbsp; Below is an example of this command. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#4bacc6&gt;mage.exe -Update build\ClickOnceExample-Release\ClickOnceExample.application &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -AppManifest "build\ClickOnceExample-Release\Application Files\1.1.0.6125\ClickOnceExample.exe.manifest" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -AppCodeBase "Application Files\1.1.0.6125\ClickOnceExample.exe.manifest" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Publisher "Robolize Division" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Version 1.1.0.6125 &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -ProviderUrl file://YourServerName/YourShareName/ClickOnceExample/ClickOnceExample.application&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The most important properties to set here are the following: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;AppManifest &lt;/LI&gt;
&lt;LI&gt;AppCodeBase &lt;/LI&gt;
&lt;LI&gt;Publisher (defaults to "Microsoft" if not set.) &lt;/LI&gt;
&lt;LI&gt;Version &lt;/LI&gt;
&lt;LI&gt;ProviderUrl &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;8.&lt;/STRONG&gt; Use Mage.exe to sign the deployment manifest using your personal ".pfx" key file. As with the application manifest, once you sign it, you're done with it. Leave it alone.&amp;nbsp; Below is an example of this command. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#4bacc6&gt;mage.exe -Sign build\ClickOnceExample-Release\ClickOnceExample.application &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -CertFile src\Robolize.ClickOnceExample\ClickOnceExample.pfx &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -Password ClickOnceExample&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;9.&lt;/STRONG&gt; Optionally copy the deployment manifest file to the location of the application manifest file for safe keeping.&amp;nbsp; This is not required, but it may come in useful if you ever need to revert to an earlier version. You could just replace the current deployment manifest with an old version pointing to the old version of the application. &lt;/P&gt;
&lt;H3&gt;Web Hosted Deployment&lt;/H3&gt;
&lt;P&gt;I mentioned earlier that I would explain the ".deploy" extension. The ".deploy" extension is primarily used when the ClickOnce deployment is being hosted within a website. By default, the web server will not allow downloading files with specific extensions like ".exe", ".config", and others. The web server can be configured to allow these file extensions to be downloaded, but for security reasons, you really don't want to do that. It is better to just give every file a ".deploy" extension so there is only that one extension to be concerned with. If you need to use the ".deploy" extension, the setting MapFileExtensions="true" in the "GenerateDeploymentManifest" task should do the trick. I personally am using the file share deployment so I don't have the need to do this. I have not gone through the steps to verify that what I'm saying actually works, but I don’t see any reason why it wouldn't work.&lt;/P&gt;
&lt;H3&gt;Other Thoughts&lt;/H3&gt;
&lt;P&gt;Apparently there is a way to publish a ClickOnce deployment by executing MSBuild on a project file and specifying the "publish" target.&amp;nbsp; This didn't work for me and I assume it's because I execute MSBuild on a solution file, not a project file.&amp;nbsp; I always use solution files because everything I work on is made up of multiple projects.&amp;nbsp; I didn't go far down this path, but you can have a look &lt;A href="http://www.codewrecks.com/blog/index.php/2009/06/18/publish-a-project-with-clickonce-via-nant-and-ccnet/" target=_blank mce_href="http://www.codewrecks.com/blog/index.php/2009/06/18/publish-a-project-with-clickonce-via-nant-and-ccnet/"&gt;here&lt;/A&gt; and &lt;A href="http://devopsnet.com/2011/04/21/building-clickonce-applications-with-nant/" target=_blank mce_href="http://devopsnet.com/2011/04/21/building-clickonce-applications-with-nant/"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The Mage.exe tool, on my system, is located here, C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe &lt;BR&gt;It could be located somewhere else on your system.&lt;/P&gt;
&lt;P&gt;Looking at the entire process I describe here, it might be confusing to follow because the interweaving of steps between NAnt and MSBuild.&amp;nbsp; To help with understanding, I created a simple demo solution utilizing the entire process.&amp;nbsp; &lt;A href="https://dl.dropbox.com/u/4598532/Blogs/ASP.NET%20Blog/Automation%20ClickOnce%20Deployment/ClickOnceExample.zip" mce_href="https://dl.dropbox.com/u/4598532/Blogs/ASP.NET%20Blog/Automation%20ClickOnce%20Deployment/ClickOnceExample.zip"&gt;You can download and inspect my demo example here.&lt;/A&gt;&amp;nbsp; This demo I created is actually a good example of using NAnt for build automation.&amp;nbsp; It contains the core aspects which are present in all applications I manage. &lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=9848017" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="Automation" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Automation/default.aspx" /><category term="ClickOnce" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ClickOnce/default.aspx" /><category term="NAnt" scheme="http://weblogs.asp.net/joewrobel/archive/tags/NAnt/default.aspx" /><category term="Deployment" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Deployment/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/.NET/default.aspx" /></entry><entry><title>Conditional Formatting in the Silverlight DataGrid</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2009/01/25/conditional-formatting-in-the-silverlight-datagrid.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2009/01/25/conditional-formatting-in-the-silverlight-datagrid.aspx</id><published>2009-01-26T06:57:00Z</published><updated>2009-01-26T06:57:00Z</updated><content type="html">&lt;P&gt;I’ve been an asp.net developer for some time now and I was excited to jump on to Silverlight when it 2.0 &lt;BR&gt;was released a few months ago.&amp;nbsp; One thing I really struggled with was applying conditional formatting to &lt;BR&gt;the individual cells in the DataGrid control.&amp;nbsp; Coming from an asp.net background, I carried a lot of &lt;BR&gt;assumptions with me (big mistake).&amp;nbsp; I thought I could get a hold of the rows or cells collection and have &lt;BR&gt;my way with it, but no such luck.&amp;nbsp; I stumbled down several paths which all ultimately lead to dead ends.&amp;nbsp; &lt;BR&gt;After killing hours (maybe days) on trying to figure this out, I had to let it go and move on.&amp;nbsp; Now a month &lt;BR&gt;later I decided to give it another shot and I finally got it.&amp;nbsp; The answer was right in front of me all along.&amp;nbsp; &lt;BR&gt;I knew about the IValueConverter interface, but I didn’t fully understand its capabilities.&amp;nbsp; I thought it was &lt;BR&gt;only used for converting an object into a text representation or vice versa.&amp;nbsp; Actually, you can return &lt;BR&gt;anything you want from it.&amp;nbsp; So you can return a Button, Grid, or whatever.&lt;/P&gt;
&lt;P&gt;Another aspect I couldn’t figure out was how to get access to page members from within the Convert &lt;BR&gt;method.&amp;nbsp; For example, I wanted to render a button in the cell and wire up the button’s click event to a &lt;BR&gt;method in the page.&amp;nbsp; Sure, you could do this to a certain extent using templates, but then I couldn’t &lt;BR&gt;find a way to change the template conditionally based on a value in the bound data item.&lt;/P&gt;
&lt;P&gt;The solution I came up with was to create a delegate along with a class which implemented the &lt;BR&gt;IValueConverter interface and exposed two events.&amp;nbsp; One for converting and the other for converting &lt;BR&gt;back.&amp;nbsp; I can then declare this converter in the resources collection and setup a handler in the page &lt;BR&gt;as shown below.&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;UserControl.Resources&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;local:UniversalConverter&lt;/SPAN&gt; &lt;SPAN class=attr&gt;x:Key&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="ageConverter"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Converting&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="ConvertAge"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;local:UniversalConverter&lt;/SPAN&gt; &lt;SPAN class=attr&gt;x:Key&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="nameConverter"&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Converting&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="ConvertName"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;UserControl.Resources&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;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the markup i used in the “First Name” column of the DataGrid.&lt;/P&gt;&lt;PRE class=csharpcode&gt;&lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;data:DataGridTemplateColumn&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Header&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="First Name"&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;data:DataGridTemplateColumn.CellTemplate&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;            &lt;SPAN class=kwrd&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class=html&gt;ContentControl&lt;/SPAN&gt; &lt;SPAN class=attr&gt;Content&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="{Binding Converter={StaticResource nameConverter}}"&lt;/SPAN&gt;&lt;BR&gt;                &lt;SPAN class=attr&gt;HorizontalContentAlignment&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Stretch"&lt;/SPAN&gt;  &lt;BR&gt;                &lt;SPAN class=attr&gt;VerticalContentAlignment&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;="Stretch"&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;/&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;        &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;DataTemplate&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;    &lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;data:DataGridTemplateColumn.CellTemplate&lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;&amp;gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;SPAN class=kwrd&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN class=html&gt;data:DataGridTemplateColumn&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;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the “ConvertName” method I wired up from the converter defined in the resources collection.&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;private&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; ConvertName(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                      &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;    Employee employee = &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;as&lt;/SPAN&gt; Employee;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (employee == &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (employee.FirstName.Contains(&lt;SPAN class=str&gt;'a'&lt;/SPAN&gt;)) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;        Button btn = &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; Button();&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;        btn.Content = employee.FirstName;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;        btn.Click += ((sender, e) =&amp;gt; {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;          HtmlPage.Window.Alert(&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;string&lt;/SPAN&gt;.Format(&lt;BR&gt;                   &lt;SPAN class=str&gt;"There is a button here because \"{0}\" contains an \"a\"."&lt;/SPAN&gt;, &lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;            employee.FirstName));&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;        });&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; btn;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;new&lt;/SPAN&gt; TextBlock {Text = employee.FirstName};&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  19:  &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 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the IConverter class and delegate I created to handle the conversions.&lt;/P&gt;
&lt;DIV class=csharpcode&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   1:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;class&lt;/SPAN&gt; UniversalConverter : IValueConverter {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   2:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   3:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; Convert(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                         &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   4:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;this&lt;/SPAN&gt;.OnConverting(&lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, targetType, &lt;BR&gt;                                        parameter, culture);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   5:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   6:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   7:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; ConvertBack(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                         &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   8:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;this&lt;/SPAN&gt;.OnConvertingBack(&lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, targetType, &lt;BR&gt;                                            parameter, culture);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;   9:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  10:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  11:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;protected&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; OnConverting(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                            &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  12:  &lt;/SPAN&gt;        UniversalConverterHandler handler = &lt;SPAN class=kwrd&gt;this&lt;/SPAN&gt;.Converting;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  13:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (handler != &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  14:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; handler(&lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, targetType, parameter, culture);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  15:  &lt;/SPAN&gt;        }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  16:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  17:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  18:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  19:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;protected&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; OnConvertingBack(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                            &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  20:  &lt;/SPAN&gt;        UniversalConverterHandler handler = &lt;SPAN class=kwrd&gt;this&lt;/SPAN&gt;.ConvertingBack;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  21:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;if&lt;/SPAN&gt; (handler != &lt;SPAN class=kwrd&gt;null&lt;/SPAN&gt;) {&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  22:  &lt;/SPAN&gt;            &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; handler(&lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, targetType, parameter, culture);&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  23:  &lt;/SPAN&gt;        }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  24:  &lt;/SPAN&gt;        &lt;SPAN class=kwrd&gt;return&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  25:  &lt;/SPAN&gt;    }&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  26:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  27:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;event&lt;/SPAN&gt; UniversalConverterHandler Converting;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  28:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  29:  &lt;/SPAN&gt;    &lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;event&lt;/SPAN&gt; UniversalConverterHandler ConvertingBack;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  30:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  31:  &lt;/SPAN&gt;}&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  32:  &lt;/SPAN&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=lnum&gt;  33:  &lt;/SPAN&gt;&lt;SPAN class=kwrd&gt;public&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;delegate&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; UniversalConverterHandler(&lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; &lt;SPAN class=kwrd&gt;value&lt;/SPAN&gt;, Type targetType, &lt;BR&gt;                              &lt;SPAN class=kwrd&gt;object&lt;/SPAN&gt; parameter, CultureInfo culture);&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 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And finally, here is a screenshot of the DataGrid. (Ugly, I know, but it proves my point.) &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/image_6FD4DF33.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/image_6FD4DF33.png"&gt;&lt;IMG title=image style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=233 alt=image src="http://weblogs.asp.net/blogs/joewrobel/image_thumb_73E1BDB6.png" width=434 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/image_thumb_73E1BDB6.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/SlGridDemo1.zip" target=_blank mce_href="http://weblogs.asp.net/blogs/joewrobel/SlGridDemo1.zip"&gt;Here is a link to the complete solution. &lt;/A&gt;&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;I hope you find this useful and I look forward to hearing feedback and suggestions.&amp;nbsp; &lt;BR&gt;Most importantly, let me know if you know of a better way to do this.&lt;/P&gt;
&lt;P&gt;Thanks &lt;BR&gt;-Joe&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6860520" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="C#" scheme="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Silverlight/default.aspx" /></entry><entry><title>Web Profile Builder 1.3</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/05/04/web-profile-builder-1-3.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/05/04/web-profile-builder-1-3.aspx</id><published>2008-05-05T05:33:00Z</published><updated>2008-05-05T05:33:00Z</updated><content type="html">&lt;FONT face=Calibri size=3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;I released a new build of Web Profile Builder.&lt;BR&gt;Not much has changed for the 1.3 release.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The focus of this release was to revert an undesirable change I made for version 1.2.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I did however add one new feature so I changed the version to 1.3.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What was the new feature added?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I changed the generated profile class to be a partial class.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now you can easily add any custom code to the profile class (in a separate code file) without losing your changes when the profile class gets regenerated.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Files can be downloaded from the MSDN Code Gallery &lt;A class="" title=here href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=WebProfileBuilder&amp;amp;ReleaseId=980" target=_blank mce_href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=WebProfileBuilder&amp;amp;ReleaseId=980"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Thanks&lt;BR&gt;-Joe&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6158303" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author></entry><entry><title>Web Profile Builder 1.2.0.0 Released</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/04/16/web-profile-builder-1-2-0-0-released.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/04/16/web-profile-builder-1-2-0-0-released.aspx</id><published>2008-04-17T04:16:03Z</published><updated>2008-04-17T04:16:03Z</updated><content type="html">&lt;p&gt;Files can be downloaded from the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/a&gt; project page.    &lt;br /&gt;If you are unfamiliar with Web Profile Builder, you can read my initial blog post about it &lt;a href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx" target="_blank" mce_href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx"&gt;here&lt;/a&gt;.    &lt;br /&gt;Details of this release can be found on the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder/Release/ProjectReleases.aspx?ReleaseId=918" target="_blank"&gt;Code Gallery web site&lt;/a&gt;.    &lt;br /&gt;I had a little time to put together some basic documentation.&amp;#160; It is available from the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder/Release/ProjectReleases.aspx?ReleaseId=918" target="_blank"&gt;release download&lt;/a&gt; section.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;-Joe&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6104723" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx" /><category term="Profile" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx" /><category term="WAP" scheme="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx" /><category term="Web Application Project" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx" /></entry><entry><title>Web Profile Builder 1.1.0.0 Released</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/03/17/web-profile-builder-1-1-0-0-released.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/03/17/web-profile-builder-1-1-0-0-released.aspx</id><published>2008-03-17T06:00:00Z</published><updated>2008-03-17T06:00:00Z</updated><content type="html">&lt;P&gt;Files can be downloaded from the &lt;A href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/A&gt; project page.&lt;/P&gt;
&lt;P&gt;If you are unfamiliar with Web Profile Builder, you can read my initial blog post about it &lt;A href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx" target=_blank mce_href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Changes made for release 1.1.0.0:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Added the ability to detect changes made to the profile section of the web.config file &lt;BR&gt;and only rebuild the Profile class if changes have been made.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Notes:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you used the previous release, remember to uninstall it first.&lt;/LI&gt;
&lt;LI&gt;Also, if you used the previous release and added the customize section in the &lt;BR&gt;web.config file, remember to update the assembly reference to &lt;BR&gt;“WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=1.1.0.0, &lt;BR&gt;Culture=neutral, PublicKeyToken=01d50f1f82943b0c”.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thank you to everybody who provided me with valuable feedback.&amp;nbsp; This release should address &lt;BR&gt;all of your concerns.&lt;/P&gt;
&lt;P&gt;Thanks &lt;BR&gt;-Joe&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5981513" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx" /><category term="Profile" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx" /><category term="WAP" scheme="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx" /><category term="Web Application Project" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx" /></entry><entry><title>ClientID Problem In External JavaScript Files Solved</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/02/19/clientid-problem-in-external-javascript-files-solved.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/02/19/clientid-problem-in-external-javascript-files-solved.aspx</id><published>2008-02-20T06:18:00Z</published><updated>2008-02-20T06:18:00Z</updated><content type="html">&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Well, at least for me it is.&amp;nbsp; I say that because this solution might &lt;BR&gt;not appeal to the masses, but it works great for me.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The binary and source files can be downloaded from the MSDN Code Gallery. &lt;BR&gt;Here is the direct link. &lt;BR&gt;&lt;A title=http://code.msdn.microsoft.com/RegClientControls href="http://code.msdn.microsoft.com/RegClientControls" mce_href="http://code.msdn.microsoft.com/RegClientControls"&gt;http://code.msdn.microsoft.com/RegClientControls&lt;/A&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Up until lately, I have been writing my JavaScript in the .aspx file. &lt;BR&gt;That way I could use the ClientID trick.&amp;nbsp; &lt;STRONG&gt;&amp;lt;%=TextBox1.ClientID%&amp;gt;&lt;/STRONG&gt; &lt;BR&gt;I just began working with a team who prefers to write all JavaScript in &lt;BR&gt;external .js files.&amp;nbsp; What they had been doing is hard coding the &lt;BR&gt;ClientID prefixes caused by the container controls.&amp;nbsp; I guess this works &lt;BR&gt;fine.&amp;nbsp; It has been working for them so far.&amp;nbsp; I personally can't do this. &lt;BR&gt;It just feels wrong.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;I took some time to figure out a better way to deal with the ClientID in &lt;BR&gt;an external JavaScript file.&amp;nbsp; I found an interesting article &lt;/FONT&gt;&lt;A href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects" target=_blank mce_href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects"&gt;&lt;FONT face="Courier New" size=2&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" size=2&gt; about &lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects" target=_blank mce_href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects"&gt;&lt;FONT face="Courier New" size=2&gt;Creating JavaScript objects from ASP.NET objects&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" size=2&gt;.&amp;nbsp; I liked David's technique, &lt;BR&gt;but it still required manually writing JavaScript on the .aspx page. I wrote &lt;BR&gt;a control called "RegClient" that encapsulates and automates this technique. &lt;BR&gt;If you place this control on your page anywhere below the Script Manager, &lt;BR&gt;then all you have to do to access the controls from JavaScript is something &lt;BR&gt;like "&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;var&lt;/FONT&gt; controlObj = PageControls.TextBox1;&lt;/STRONG&gt;".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The RegClient control is dependant on Microsoft ASP.NET AJAX 1.0.&amp;nbsp; The &lt;BR&gt;source could easily be targeted to .NET 3.5 if you wanted.&amp;nbsp; I'm sure &lt;BR&gt;that with a little work it could even be library independent, but I &lt;BR&gt;didn't have that requirement.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The RegClient control has two modes, "Marked" and "All".&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;Marked:&lt;/FONT&gt;&lt;/STRONG&gt; &lt;BR&gt;With the RegClient control set to Marked, only the controls marked with &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;RegClient="true" or ClientControlID="{yourClientName}" will be registered.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=598&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Robo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RegClient&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="RegClient1"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;runat&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="server"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: red"&gt;ClientControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Marked"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;All:&lt;/FONT&gt;&lt;/STRONG&gt; &lt;BR&gt;With the RegClient control set to All, every control in master &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;and content pages will &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;be registered unless RegClient="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;false".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=600&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Robo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RegClient&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="RegClient1"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;runat&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="server" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: red"&gt;ClientControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="All"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H6&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;To access the controls in the external JavaScript file, handle &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;the &lt;BR&gt;"ready" event of &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;the "PageControls" object like shown here.&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=598&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.add_ready(&lt;SPAN style="COLOR: blue"&gt;function&lt;/SPAN&gt;(){ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: green"&gt;//Write your code here. &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;});&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;All of the controls that have been registered will be available from &lt;BR&gt;the "PageControls" object in JavaScript.&amp;nbsp; Here is an example of accessing &lt;BR&gt;the controls. &lt;BR&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=600&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.add_ready(&lt;SPAN style="COLOR: blue"&gt;function&lt;/SPAN&gt;(){&amp;nbsp; &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $addHandler($get(&lt;SPAN style="COLOR: #a31515"&gt;'Button2'&lt;/SPAN&gt;), &lt;SPAN style="COLOR: #a31515"&gt;'click'&lt;/SPAN&gt;,&amp;nbsp; &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function&lt;/SPAN&gt;() {&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.Label1.innerHTML = PageControls.tbText.value;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;}&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;);&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;});&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#ff0000&gt;One caution I would make for using this control is to be careful when you &lt;BR&gt;have the ClientControls setting to "All".&amp;nbsp; This control will find and &lt;BR&gt;register every control that derives from WebControl.&amp;nbsp; If you're using &lt;BR&gt;a GridView or something similar on the page, then there could be many &lt;BR&gt;extra controls that you don't want to get registered.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;Here is a screen shot of the RegClient control.&amp;nbsp; There really is only one &lt;BR&gt;setting for this control, but I added a big blob of text as a reminder of &lt;BR&gt;how to use it with other controls.&lt;/FONT&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=575 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb.png" width=513 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;When the page renders, this is what the generated output looks like at &lt;BR&gt;at the bottom of the page.&lt;/FONT&gt; &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_4.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=195 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb_1.png" width=579 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;So, that's it.&amp;nbsp; I hope you find this useful and if you know of any ways &lt;BR&gt;this control could be improved, please let me know.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Thanks &lt;BR&gt;-Joe&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5826121" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx" /><category term="ClientID" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ClientID/default.aspx" /></entry><entry><title>Web Profile Builder for Web Application Projects</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx</id><published>2008-02-03T10:21:00Z</published><updated>2008-02-03T10:21:00Z</updated><content type="html">&lt;P&gt;Files can be downloaded from the &lt;A class="" href="http://code.msdn.microsoft.com/WebProfileBuilder" target=_blank mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/A&gt; project page.&lt;/P&gt;
&lt;P&gt;If you use Web Application Projects, you have probably run into the issue of not being &lt;BR&gt;able to access the Profile at design time.&lt;/P&gt;
&lt;P&gt;Thankfully, some nice people created an Add-In for Visual Studio 2005 that will generate &lt;BR&gt;a wrapper class as a workaround.&amp;nbsp; That project can be found &lt;A href="http://www.codeplex.com/WebProfile" target=_blank mce_href="http://www.codeplex.com/WebProfile"&gt;here&lt;/A&gt;.&amp;nbsp; I wanted to contribute &lt;BR&gt;to the &lt;A href="http://www.codeplex.com/WebProfile" target=_blank mce_href="http://www.codeplex.com/WebProfile"&gt;Web Profile Generator&lt;/A&gt; project, but my emails went unanswered.&amp;nbsp; I decided to start &lt;BR&gt;a new project.&lt;/P&gt;
&lt;P&gt;This project picks up where that one left off and is based on their source code.&amp;nbsp; I started &lt;BR&gt;out rebuilding that project as it stood to add support for Visual Studio 2008.&amp;nbsp; I got it to &lt;BR&gt;work, but I wanted to do more.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I decided to go ahead and address the issues listed on the original &lt;A href="http://www.codeplex.com/WebProfile/WorkItem/List.aspx" target=_blank mce_href="http://www.codeplex.com/WebProfile/WorkItem/List.aspx"&gt;project site&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here is a summary of the changes made.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;First of all, this is no longer an Add-In.&amp;nbsp; Instead, it is a Build Task.&lt;/LI&gt;
&lt;LI&gt;Works for Visual Studio 2005 and 2008.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the file name.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the directory the file gets created in.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the class name.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the name space.&lt;/LI&gt;
&lt;LI&gt;Added an extra method as requested &lt;A href="http://www.codeplex.com/WebProfile/Thread/View.aspx?ThreadId=20291" target=_blank mce_href="http://www.codeplex.com/WebProfile/Thread/View.aspx?ThreadId=20291"&gt;here&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Usage:&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run the installer.&lt;/LI&gt;
&lt;LI&gt;Add this Import statement to your project file.&amp;nbsp; (see special notes below) &lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;Import&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;Done.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;The profile will get generated every time you build the project.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;STRONG&gt;Special Notes:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;After you modify the project file by adding the import statement, you will get this security &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;warning when the project loads.&amp;nbsp; Choose the "Load project normally" option and press OK. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=440 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_thumb.png" width=655 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;STRONG&gt;Extended Usage:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;If you want to customize the web profile, you can add the following sections to your web.config.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;This section needs to be at the top of the file just under the opening configuration tag. &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;configSections&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;sectionGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;robo.webProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;section&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;webProfileSettings&lt;/SPAN&gt;"&lt;FONT color=#0000ff&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;type&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=01d50f1f82943b0c&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;allowLocation&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;allowDefinition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;Everywhere&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;sectionGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;configSections&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;This section can be anywhere under the configuration section. &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;robo.webProfile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;webProfileSettings&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;className&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;MyWebProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: red"&gt;nameSpace&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CustomNameSpace&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: red"&gt;directory&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CodeFiles&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;fileName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;MyWebProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;robo.webProfile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;The directory name is not a virtual directory, but is in reference to the root of the Web Application. &lt;BR&gt;The fileName is just the name of the file and should not include an extension. &lt;BR&gt;The className and nameSpace are as you would expect. &lt;BR&gt;None of these settings are required.&amp;nbsp; You don't even need to define this section at all.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;If you would like to use Web Profile Builder, it can be downloaded &lt;A href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;here&lt;/A&gt;. &lt;BR&gt;Also available is the complete source code and examples in VB and C#.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;Thanks &lt;BR&gt;-Joe&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5699163" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="Profile" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx" /><category term="WAP" scheme="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx" /><category term="Web Application Project" scheme="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx" /></entry><entry><title>A more elegant solution to display GridView header and footer when the data source is empty.</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/joewrobel/archive/2008/01/30/a-more-elegant-solution-to-display-gridview-header-and-footer-when-the-data-source-is-empty.aspx" /><id>http://weblogs.asp.net/joewrobel/archive/2008/01/30/a-more-elegant-solution-to-display-gridview-header-and-footer-when-the-data-source-is-empty.aspx</id><published>2008-01-31T00:47:00Z</published><updated>2008-01-31T00:47:00Z</updated><content type="html">&lt;P&gt;I think the need to always show the header and footer of a GridView is pretty common. &lt;BR&gt;When I first ran into this problem, I went to Google and found lots of content about this. &lt;BR&gt;Some suggest tampering with the data source to add an extra row if it’s empty.&amp;nbsp; &lt;BR&gt;Others show overriding the CreateChildControls method.&lt;/P&gt;
&lt;P&gt;I was not satisfied with either of these solutions. I didn’t like that dirty feeling I had by tampering &lt;BR&gt;with the data source.&amp;nbsp; And I didn’t like overriding the CreateChildControls method because it &lt;BR&gt;simply didn’t work of me anyway.&amp;nbsp; This solution only gave the appearance of the header and &lt;BR&gt;footer existing.&amp;nbsp; I ran into issues because I was programmatically adding controls to the header.&amp;nbsp; &lt;BR&gt;Upon postback, if the data source was empty, the control hierarchy would not be the same as &lt;BR&gt;before thus causing an error.&lt;/P&gt;
&lt;P&gt;So here is my solution.&amp;nbsp; I'll cover the main points of interest and if you want to see more, I have &lt;BR&gt;uploaded all the source and example to the new MSDN Code Gallery. &lt;BR&gt;&lt;A title=http://code.msdn.microsoft.com/AlwaysShowHeaderFoot href="http://code.msdn.microsoft.com/AlwaysShowHeaderFoot" mce_href="http://code.msdn.microsoft.com/AlwaysShowHeaderFoot"&gt;http://code.msdn.microsoft.com/AlwaysShowHeaderFoot&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Start out by extending the GridView control and add the following structure.&amp;nbsp; &lt;BR&gt;The most important part here is to override the PerformDataBinding method. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=458 alt=ClassStructure src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_thumb.png" width=677 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see here.&amp;nbsp; I am intercepting the data and making sure there is at lease one row.&amp;nbsp; &lt;BR&gt;If there is, the control behaves normally. &lt;BR&gt;On the line with the red arrow, I am checking if the binding source is a DataView.&amp;nbsp; &lt;BR&gt;If it is, I can just add a row here and be done with it. &lt;BR&gt;If the binding source is not a DataView (or DataSet), then I fire an event that will need to be handled. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_14.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_14.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=678 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_6.png" width=720 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The event "MustAddARow", as seen here, will provide access to the binding data and allow you to add a row. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_16.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_16.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=195 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_7.png" width=730 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Here is a snippet from a page where I handle the MustAddARow event. &lt;BR&gt;In this case, I am binding a List of Products to the GridView. &lt;BR&gt;As you can see, I'm just adding a new Product to the list.&amp;nbsp; It doesn't matter what data you add here &lt;BR&gt;because it will get hidden in back in the GridView. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_10.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=165 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_4.png" width=600 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;And finally back in the GridView, I override the OnDataBound method so I can hide that extra row. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_18.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_18.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=276 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_8.png" width=658 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_8.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So there you have it.&amp;nbsp; This is my first blog post ever.&amp;nbsp;&lt;BR&gt;Hopefully someone will get some use out of this. &lt;/P&gt;
&lt;P&gt;Thanks &lt;BR&gt;-Joe&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5678649" width="1" height="1"&gt;</content><author><name>robolize</name><uri>http://weblogs.asp.net/members/robolize.aspx</uri></author><category term="GridView" scheme="http://weblogs.asp.net/joewrobel/archive/tags/GridView/default.aspx" /><category term="ASP.NET" scheme="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx" /><category term="C#" scheme="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx" /></entry></feed>