<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1410597247241545505</id><updated>2011-10-13T12:26:00.522-04:00</updated><category term='Visual Studio'/><category term='Plugin'/><category term='Windows Vista'/><category term='ASP.NET 2.0'/><category term='How To'/><category term='Performance'/><category term='Team Build'/><category term='SQL'/><category term='DB Pro'/><category term='MSI Factory'/><category term='AJAX'/><category term='Membership'/><category term='Windows Live Writer'/><category term='Role'/><category term='Security'/><category term='ARITHABORT'/><category term='ASP.NET'/><category term='VSTS'/><category term='TFS SDK'/><category term='Windows Installer'/><category term='NHibernate'/><category term='Custom Action'/><category term='Customize'/><category term='Extender'/><category term='Test Template'/><category term='Provider'/><title type='text'>Leo Vildosola's Blog</title><subtitle type='html'>&lt;i&gt;Give a geek some code you help him for a day; on day two he'll come back and tell you everything that's wrong with it... go figure!&lt;/i&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-7159098490725508973</id><published>2009-04-16T06:46:00.001-04:00</published><updated>2009-04-16T06:56:44.134-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MSI Factory'/><category scheme='http://www.blogger.com/atom/ns#' term='Custom Action'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Installer'/><title type='text'>MSI Factory &amp; Passing Command Line Arguments to a Custom Action</title><content type='html'>&lt;p&gt;I created an installer using &lt;a title="MSI Factory Home" href="http://www.indigorose.com/products/msi-factory/" target="_blank"&gt;MSI Factory&lt;/a&gt;. Part of my setup logic is to launch an application at the end of the installation so that the user can complete the configuration process that requires them to deploy some customizations to their &lt;a title="Team Foundation Server Home" href="http://msdn.microsoft.com/en-us/teamsystem/dd408382.aspx" target="_blank"&gt;Team Foundation Server&lt;/a&gt; (TFS). I accomplish this by using &lt;a title="Custom Action on MSDN" href="http://msdn.microsoft.com/en-us/library/aa368066(VS.85).aspx" target="_blank"&gt;Custom Actions&lt;/a&gt; and pass the executable as one of its parameters the installation folder or the value of INSTALLDIR, for example. The results, however, are not as expected.&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;In my installer I set the &lt;strong&gt;Command line arguments&lt;/strong&gt; option in the &lt;strong&gt;Run Executable&lt;/strong&gt; dialog of the &lt;strong&gt;Custom Actions&lt;/strong&gt; editor to the following:&lt;/p&gt;    &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;-p “[INSTALLDIR]”&lt;/pre&gt;

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

  &lt;div id="codeSnippetWrapper"&gt;One would expect that the property INSTALLDIR would be replaced by the actual value. At first I thought it did not since researching about it seemed to indicate that this was the case, as it was reported that way by many.&lt;/div&gt;

  &lt;p&gt;To test the case further I decided to “hard-code” the value of the expected path to pass as an argument in the installer Custom Action and things seem to work as expected.&lt;/p&gt;

  &lt;p&gt;So, I added logic in my executable code to write to the Event Log the possible causes of this issue (errors and the actual arguments passed). The following entry would happen when I execute my application as part of my installer through a Custom Action.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;Event Type:    Warning&lt;br /&gt;Event Source:    Process Template Item Deployer&lt;br /&gt;Event Category:    None&lt;br /&gt;Event ID:    0&lt;br /&gt;Date:        4/12/2009&lt;br /&gt;Time:        3:57:28 PM&lt;br /&gt;User:        N/A&lt;br /&gt;Computer:    TFSRTM&lt;br /&gt;Description:&lt;br /&gt;Timestamp: 4/12/2009 7:57:28 PM&lt;br /&gt;Message: System.ArgumentException: Illegal characters in path.&lt;br /&gt;   at System.IO.Path.CheckInvalidPathChars(String path)&lt;br /&gt;   at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)&lt;br /&gt;   at System.IO.Path.NormalizePath(String path, Boolean fullCheck)&lt;br /&gt;   at System.IO.Path.GetFullPathInternal(String path)&lt;br /&gt;   at System.IO.DirectoryInfo.ctor(String path)&lt;br /&gt;   at InCycle.Tools.Forms.ImportProcessTemplateItem.GetSupportedFilesFromPath(String path)&lt;br /&gt;Category: General&lt;br /&gt;Priority: -1&lt;br /&gt;EventId: 0&lt;br /&gt;Severity: Warning&lt;br /&gt;Title:&lt;br /&gt;Machine: TFSRTM&lt;br /&gt;Application Domain: ProcessTemplateItemDeployer.exe&lt;br /&gt;Process Id: 3956&lt;br /&gt;Process Name: ProcessTemplateItemDeployer.exe&lt;br /&gt;Win32 Thread Id: 3580&lt;br /&gt;Thread Name: &lt;br /&gt;Extended Properties: &lt;br /&gt;&lt;br /&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/pre&gt;

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

  &lt;p&gt;I then decided to inspect previous Event Log entries and found the following interesting entry.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;Event Type:    Information&lt;br /&gt;Event Source:    Process Template Item Deployer&lt;br /&gt;Event Category:    None&lt;br /&gt;Event ID:    0&lt;br /&gt;Date:        4/12/2009&lt;br /&gt;Time:        3:57:27 PM&lt;br /&gt;User:        N/A&lt;br /&gt;Computer:    LEOV-TFSRTM&lt;br /&gt;Description:&lt;br /&gt;Timestamp: 4/12/2009 7:57:27 PM&lt;br /&gt;Message: Attempting to load files from &amp;quot;C:\Temp\InstallFolder&amp;quot;&amp;quot;&lt;br /&gt;Category: General&lt;br /&gt;Priority: -1&lt;br /&gt;EventId: 0&lt;br /&gt;Severity: Verbose&lt;br /&gt;Title:&lt;br /&gt;Machine: LEOV-TFSRTM&lt;br /&gt;Application Domain: ProcessTemplateItemDeployer.exe&lt;br /&gt;Process Id: 3956&lt;br /&gt;Process Name: C:\Program Files\InCycle Software\InCycle Add-ons\bin\ProcessTemplateItemDeployer.exe&lt;br /&gt;Win32 Thread Id: 3580&lt;br /&gt;Thread Name: &lt;br /&gt;Extended Properties: &lt;br /&gt;&lt;br /&gt;For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.&lt;/pre&gt;

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

  &lt;p&gt;As you can see, for some reason “[INSTALLDIR]” is expanded correctly with one small problem, it seems to pass an extra quote at the end.&lt;/p&gt;

  &lt;p&gt;I then changed my code to add logic to fix the path that I expect as an argument before I use it elsewhere in my code. The following code snippet shows you the argument extraction with the added line that fixes the problem.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #008000"&gt;// Determine if a default path has been specified from which to load files.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #006080"&gt;&amp;quot;-P&amp;quot;&lt;/span&gt;.Equals(args[0].ToUpperInvariant()))&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Assign it for later use.&lt;/span&gt;&lt;br /&gt;    loadFilesFromPath = args[1];&lt;br /&gt;    &lt;span style="color: #008000"&gt;// When launched from a MSI there may be invalid characters. Therefore,&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;// make sure to remove all such characters before proceeding.&lt;/span&gt;&lt;br /&gt;    loadFilesFromPath = loadFilesFromPath.Trim(Path.GetInvalidPathChars());&lt;br /&gt;    &lt;span style="color: #008000"&gt;// Display debugging details.&lt;/span&gt;&lt;br /&gt;    Logger.WriteDebug(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.Format(CultureInfo.InstalledUICulture, &lt;span style="color: #006080"&gt;&amp;quot;Attempting to load files from \&amp;quot;{0}\&amp;quot;&amp;quot;&lt;/span&gt;, loadFilesFromPath));&lt;br /&gt;}&lt;/pre&gt;

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

  &lt;p&gt;Using &lt;strong&gt;string.Trim&lt;/strong&gt; with &lt;strong&gt;Path.GetInvalidPathChars()&lt;/strong&gt; allowed me to clean the errors from the given path.&lt;/p&gt;

  &lt;p&gt;I don’t know whether the problem lies in MSI Factory or in any underlying component, but this fixed it for me. Unfortunately, I don’t really have a way to fix this for executables for which I don’t have the code. Perhaps, writing a bootstrap application may help. But that’s another post.&lt;/p&gt;
&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-7159098490725508973?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/7159098490725508973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=7159098490725508973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/7159098490725508973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/7159098490725508973'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2009/04/msi-factory-passing-command-line.html' title='MSI Factory &amp;amp; Passing Command Line Arguments to a Custom Action'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-2644748431621380957</id><published>2009-04-13T07:11:00.001-04:00</published><updated>2009-04-16T07:05:02.768-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='TFS SDK'/><category scheme='http://www.blogger.com/atom/ns#' term='VSTS'/><category scheme='http://www.blogger.com/atom/ns#' term='Customize'/><title type='text'>Team Foundation Server (TFS) Customizations in x64 Environments</title><content type='html'>&lt;p&gt;While testing one of the &lt;a title="Team System Home" href="http://msdn.microsoft.com/en-us/teamsystem/default.aspx" target="_blank"&gt;Visual Studio Team System&lt;/a&gt; (VSTS) extensions I wrote I came across a scenario where the assembly was failing to load under the 64-bit version of &lt;a title="Windows 7 Home" href="http://www.microsoft.com/windows/windows-7/" target="_blank"&gt;Windows 7&lt;/a&gt;. It turns out that by default when one creates a project in &lt;a title="Visual Studio Home at MSDN" href="http://msdn.microsoft.com/en-us/vstudio/default.aspx" target="_blank"&gt;Visual Studio 2008&lt;/a&gt; the target is set to &lt;strong&gt;Any CPU&lt;/strong&gt;. This in turn sets the &lt;strong&gt;Processor Architecture&lt;/strong&gt; of the resulting assembly to &lt;strong&gt;MSIL&lt;/strong&gt;, which essentially lets the Operating System (OS) decide which .NET Framework version and flavor to use (for all intense and purposes). This causes a problem when writing extensions for VSTS such as &lt;a title="Work Item Tracking Custom Controls at MSDN" href="http://msdn.microsoft.com/en-us/library/bb286959.aspx" target="_blank"&gt;Work Item Tracking Custom Controls&lt;/a&gt; and other applications that leverage the &lt;a title="Team Foundation Server SDK at MSDN" href="http://msdn.microsoft.com/en-us/library/bb130146.aspx" target="_blank"&gt;Team Foundation Server SDK&lt;/a&gt;.&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;When loading such an assembly (of type MSIL, the default created when using the target Any CPU) in a x64 environment it will use the corresponding .NET Framework assemblies, which are in this case also 64-bit. The problem is that since all Team Foundation assemblies are 32-bit (or specifically of type x86) the mix causes the application to fail loading, in my case with the following error (as displayed in the Windows Event Log).&lt;/p&gt;    &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;Faulting application ProcessTemplateItemDeployer.exe, version 1.0.0.0, time stamp 0x49de2a19, faulting module KERNEL32.dll, version 6.0.6001.18000, time stamp 0x4791ada5, exception code 0xe0434f4d, fault offset 0x000000000002649d, process id 0x%9, application start time 0x%10.&lt;br /&gt;&lt;/pre&gt;

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

  &lt;p&gt;As you can see this is not very helpful. More details can be retrieved, however, from the error dialog itself that shows up when the application falters. In my case, the following snippet is displayed (extras removed for brevity).&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px; maximum-height: 200px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; padding-top: 0px" id="codeSnippet"&gt;See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.&lt;br /&gt;************** Exception Text **************&lt;br /&gt;System.InvalidProgramException: Common Language Runtime detected an invalid program.&lt;br /&gt;   at InCycle.Tools.Forms.ImportProcessTemplateItem.ImportProcessTemplateItem_Load(Object sender, EventArgs e)&lt;br /&gt;… (extra text removed …)&lt;br /&gt;************** Loaded Assemblies **************&lt;br /&gt;mscorlib    Assembly Version: 2.0.0.0    Win32 Version: 2.0.50727.3521 (NetFXspW7.050727-3500)&lt;br /&gt;    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll&lt;/pre&gt;

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

  &lt;p&gt;What is interesting here is the last line. Notice that the &lt;strong&gt;mscorlib.dll &lt;/strong&gt;that my application is referencing comes from the &lt;strong&gt;Framework64&lt;/strong&gt; folder of the .NET 2.0 Framework.&lt;/p&gt;

  &lt;div&gt;The solution I found, after quite a bit of research and trial and error, is to force the extensions to specifically target &lt;strong&gt;x86&lt;/strong&gt;. Doing so forces the OS to load the 32-bit framework assemblies at run time, even in a 64-bit OS.&lt;/div&gt;

  &lt;p&gt;Refer to the article &lt;a title="How to: Optimize an Application for a Specific CPU Type on MSDN" href="http://msdn.microsoft.com/en-us/library/5b4eyb0k.aspx" target="_blank"&gt;How to: Optimize an Application for a Specific CPU Type&lt;/a&gt; on &lt;a title="MSDN Home" href="http://msdn.microsoft.com/" target="_blank"&gt;MSDN&lt;/a&gt; for specific details on how to change the Processor Architecture.&lt;/p&gt;
&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-2644748431621380957?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/2644748431621380957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=2644748431621380957' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2644748431621380957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2644748431621380957'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2009/04/team-foundation-server-tfs.html' title='Team Foundation Server (TFS) Customizations in x64 Environments'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-7136997371293501747</id><published>2009-04-06T07:54:00.001-04:00</published><updated>2009-04-06T07:54:26.088-04:00</updated><title type='text'>Sys is undefined when registering script via RegisterClientScriptBlock</title><content type='html'>&lt;p&gt;Writing web applications using ASP.NET, most often than not, requires you to implement &lt;a title="JavaScript definition at Wikipedia" href="http://en.wikipedia.org/wiki/JavaScript" target="_blank"&gt;JavaScript&lt;/a&gt; code. If you are using &lt;a title="ASP.NET AJAX Home" href="http://www.asp.net/ajax/" target="_blank"&gt;AJAX&lt;/a&gt; and embed the script code as part of your page rendering you may run into the vague &lt;strong&gt;Sys is undefined&lt;/strong&gt; error.&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;I have found that the error &lt;strong&gt;Sys is undefined&lt;/strong&gt; is often caused when registering script using &lt;a title="ClientScriptManager.RegisterClientScriptBlock Method (Type, String, String)" href="http://msdn.microsoft.com/en-us/library/btf44dc9.aspx" target="_blank"&gt;&lt;font face="Courier New"&gt;RegisterClientScriptBlock&lt;/font&gt;&lt;/a&gt;. The reason is that the &lt;a title="ScriptManager Class" href="http://msdn.microsoft.com/en-ca/library/system.web.ui.scriptmanager.aspx" target="_blank"&gt;AJAX Script Manager&lt;/a&gt; has yet to initialize. When using &lt;font face="Courier New"&gt;RegisterClientScriptBlock&lt;/font&gt; the script is placed immediately after the start of the &lt;a title="HTML form tag" href="http://www.w3schools.com/TAGS/tag_form.asp" target="_blank"&gt;&lt;font face="Courier New"&gt;form&lt;/font&gt;&lt;/a&gt; tag. In contrast, &lt;a title="ClientScriptManager.RegisterStartupScript Method (Type, String, String)" href="http://msdn.microsoft.com/en-us/library/asz8zsxy.aspx" target="_blank"&gt;&lt;font face="Courier New"&gt;RegisterStartupScript&lt;/font&gt;&lt;/a&gt; places the script just before the closing &lt;font face="Courier New"&gt;form&lt;/font&gt; tag.&lt;/p&gt;    &lt;p&gt;Therefore, the solution for this issue is to use &lt;font face="Courier New"&gt;RegisterStartupScript&lt;/font&gt; instead of &lt;font face="Courier New"&gt;RegisterClientScriptBlock&lt;/font&gt;.&lt;/p&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-7136997371293501747?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/7136997371293501747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=7136997371293501747' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/7136997371293501747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/7136997371293501747'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2009/04/sys-is-undefined-when-registering.html' title='Sys is undefined when registering script via RegisterClientScriptBlock'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-1390083580474946109</id><published>2009-03-18T01:11:00.001-04:00</published><updated>2009-03-18T01:33:43.271-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live Writer'/><category scheme='http://www.blogger.com/atom/ns#' term='Plugin'/><title type='text'>Code Snippet plugin for Windows Live Writer v2.0.0</title><content type='html'>&lt;p&gt;It's been a while since I looked at this plugin, just as it's been a while since I blogged (but that's another story). I have spent the last day or two implementing most of the features listed below in the current code base. This release is &lt;b&gt;fully functional&lt;/b&gt; and I am looking for some of you folks to help me determine its stability in other environments.&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;Here's a list of what is included in this release:&lt;/p&gt;    &lt;h4&gt;Screenshots&lt;/h4&gt;    &lt;p&gt;Please take a look at some of the screenshots I posted in &lt;a title="Code Snippet Home at CodePlex" href="http://wlwplugincollection.codeplex.com/Wiki/View.aspx?title=Code%20Snippet&amp;amp;referringTitle=Home" target="_blank"&gt;Code Snippet plugin for Windows Live Writer&lt;/a&gt; section of the the &lt;a title="Plugin Collection for Windows Live Writer Home at CodePlex" href="http://wlwplugincollection.codeplex.com/" target="_blank"&gt;Plugin Collection for Windows Live Writer&lt;/a&gt; project at &lt;a title="CodePlex" href="http://www.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt;.&lt;/p&gt;    &lt;h4&gt;New Languages&lt;/h4&gt; The following formats have been added to the list of supported languages:     &lt;ul&gt;     &lt;li&gt;AutoIt (never heard of it, saw someone looking for such support elsewhere and decided to add it, &lt;i&gt;why not!&lt;/i&gt;) &lt;/li&gt;      &lt;li&gt;ColdFusion &lt;/li&gt;      &lt;li&gt;Java &lt;/li&gt;      &lt;li&gt;PHP &lt;/li&gt;      &lt;li&gt;Regular Expression &lt;/li&gt;   &lt;/ul&gt;    &lt;h4&gt;New Options Dialog&lt;/h4&gt; One of the things I wanted to do for a long time was expose some of the configuration parameters for the plugin. In previous versions, some of these configuration parameters were available in the configuration file. But now, you can edit them through a dialog and more of the options have been exposed.     &lt;h4&gt;New Features&lt;/h4&gt;    &lt;h5&gt;Customize Styles&lt;/h5&gt; In previous releases the styles used to apply the syntax highlighting were exposed in a very limited fashion. You could only get the cascading style sheet to include as a reference in your website. However, this works great only if your audience is viewing your posts in your website. If you want to make sure your RSS feeds, for example, have the proper formatting, you need to embed the styles.     &lt;br /&gt;Now, you can change the look of your code snippets by modifying these styles through the &lt;b&gt;Options&lt;/b&gt; dialog. The changes are stored in the configuration file and will be used to apply to any future code snippets you insert in your posts.     &lt;h5&gt;Edit Code Snippets&lt;/h5&gt; In the original implementation, I did not want to use the in-place editing features of the Windows Live Writer API. So, I opted for a different implementation where you can highlight existing snippets of code, whether or not these were inserted using this plugin. Basically, any highlighted text can be converted to a code snippet. This is a great feature, if I may say so myself, for re-applying style changes, if you previously embedded the styles in your post.     &lt;h5&gt;Convert Any Text to a Code Snippet&lt;/h5&gt; Using the same feature for editing snippets of code, you can now select any text in your post and convert it to a code snippet.     &lt;h4&gt;Miscellaneous Enhancements&lt;/h4&gt; Here's a list of additional enhancements to the plugin. These enhancements are not visible to the end user but in my opinion make the package more robust and complete.     &lt;ul&gt;     &lt;li&gt;Refactored style logic to allow exposure through &lt;strong&gt;Options&lt;/strong&gt; dialog. &lt;/li&gt;      &lt;li&gt;Migrated solution to &lt;strong&gt;Visual Studio 2008 SP1&lt;/strong&gt;. &lt;/li&gt;      &lt;li&gt;Verified / Updated all source code documentation for completeness and to ensure it is as accurate as possible. &lt;/li&gt;      &lt;li&gt;Localized all string resources, including those used in the Options dialog using some custom classes, such as &lt;b&gt;Attribute&lt;/b&gt; classes, for use in the &lt;b&gt;PropertyGrid&lt;/b&gt; control. &lt;em&gt;(Anyone interested in translating these resources?)&lt;/em&gt; &lt;/li&gt;      &lt;li&gt;Added stand-alone application to launch the Code Snippet plugin outside of the context of the Windows Live Writer editor. This is helpful for debugging, or when you just want to get some formatted HTML to post in a forum or something. (&lt;i&gt;This is not pat of the deployment - let me know if you think it should be&lt;/i&gt;.) &lt;/li&gt;      &lt;li&gt;Analyzed the source code through the Code Analysis feature of Visual Studio 2008. &lt;/li&gt;      &lt;li&gt;Fixed the source code based on &lt;a title="JetBrains ReSharper 4.1" href="http://www.jetbrains.com/resharper/"&gt;ReSharper 4.1&lt;/a&gt; and Code Analysis recommendations. &lt;/li&gt;   &lt;/ul&gt; &lt;/span&gt;  &lt;p&gt;Please refer to &lt;a title="Code Snippet plugin for Windows Live Writer" href="http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html" target="_blank"&gt;my original&lt;/a&gt; post for details on some of the other features the plugin offers.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-1390083580474946109?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/1390083580474946109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=1390083580474946109' title='74 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/1390083580474946109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/1390083580474946109'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2009/03/code-snippet-plugin-for-windows-live.html' title='Code Snippet plugin for Windows Live Writer v2.0.0'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>74</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-2490263555251525798</id><published>2007-07-15T08:04:00.001-04:00</published><updated>2007-07-15T09:26:59.471-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Vista'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Installer'/><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Making Web Setup projects run on Windows Vista</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:79b5b01c-e3fb-4bfc-b855-4f02db1f93f4" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type='text/javascript'&gt;&lt;!--
digg_title = 'Making Web Setup projects run on Windows Vista';
digg_bodytext = 'Windows Vista offers many enhancements over previous operating systems. Unfortunately for us developers it also presents some challenges. One such challenge is making a Web Setup project run&amp;nbsp;on Windows Vista. This post shows step-by-step how to make it work.';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;Windows Vista offers many enhancements over previous operating systems. Unfortunately for us developers it also presents some challenges. One such challenge is making a Web Setup project run&amp;nbsp;on Windows Vista. This post shows step-by-step how to make it work.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;Windows Vista comes pre-configured with IIS 7. Unfortunately, Web Setup projects do not recognize IIS 7 and therefore will fail when you attempt to run it on Windows Vista. In my case, the failure is presented as shown in the following figure.&lt;/p&gt; &lt;p align="center"&gt;&lt;a title="Failed Web Setup dialog (click for full image)" href="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_failed_setup.png" target="_blank" atomicselection="true"&gt;&lt;img src="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_failed_setup_small.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Doing a lot of searching in Google presented me&amp;nbsp;with nothing really obvious. As&amp;nbsp;you can see from the figure above, the error message is not really helpful. Luckily, while searching for something else, I stumbled onto a MSDN article titled &lt;a title="Troubleshooting Windows Installer Deployment page at MSDN" href="http://msdn2.microsoft.com/en-us/library/kz0ke5xt(vs.80).aspx" target="_blank"&gt;Troubleshooting Windows Installer Deployment&lt;/a&gt;. In the article I found the&amp;nbsp;section &lt;strong&gt;Web Setup deployment projects in Visual Studio 2005 on Windows Vista&lt;/strong&gt;, as a new section for Visual Studio 2005 SP1. The section says&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;When you create a Web Setup deployment project in Visual Studio 2005 on Windows Vista, you need to turn on the Windows feature &lt;strong&gt;IIS Metabase and IIS 6 configuration compatibility&lt;/strong&gt;, and you need to be logged on as an Administrator; otherwise you will be unable to run setup.exe to install the project.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;font color="#666666"&gt;In order to turn on the Windows feature you can follow these steps:&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font color="#666666"&gt;&lt;strong&gt;1.&lt;/strong&gt; Launch &lt;strong&gt;Control Panel&lt;/strong&gt; and select &lt;strong&gt;Programs&lt;/strong&gt;. This will display the Programs options.&lt;/font&gt;&lt;/p&gt; &lt;p align="center"&gt;&lt;a title="Control Panel dialog with Programs option highlighted (click for full image)" href="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_cp.png" target="_blank" atomicselection="true"&gt;&lt;img src="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_cp_small.png"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; In the &lt;strong&gt;Programs&lt;/strong&gt; options select &lt;strong&gt;Turn Windows features on or off&lt;/strong&gt;. This will display the &lt;strong&gt;Windows Features&lt;/strong&gt; dialog.&lt;/p&gt; &lt;p align="center"&gt;&lt;a title="Control Panel Programs and Features with Turn Windows Features on or off highligthed (click for full image)" href="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_cp_pgms.png" target="_blank" atomicselection="true"&gt;&lt;img src="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_cp_pgms_small.png"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; In the &lt;strong&gt;Windows Features&lt;/strong&gt; dialog expand the branch as shown in the following figure to finally select &lt;strong&gt;IIS Metabase and IIS 6 configuration compatibility&lt;/strong&gt;. Select &lt;strong&gt;OK&lt;/strong&gt; to install the feature.&lt;/p&gt; &lt;p align="center"&gt;&lt;img src="http://blogs.incyclesoftware.com/lvildosola/images/mwspw/mwspw_windows_features_iis.png"&gt;&lt;/p&gt; &lt;p&gt;Let&amp;nbsp;Windows&amp;nbsp;complete the installation. Once complete you will be able to run your Web Setup project on Windows Vista.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-2490263555251525798?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/2490263555251525798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=2490263555251525798' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2490263555251525798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2490263555251525798'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/07/making-web-setup-projects-run-on.html' title='Making Web Setup projects run on Windows Vista'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-3006181828396488765</id><published>2007-05-31T06:59:00.001-04:00</published><updated>2007-05-31T07:04:47.167-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Build'/><category scheme='http://www.blogger.com/atom/ns#' term='VSTS'/><title type='text'>Automatically launch a silent remote MSI installation from Team Build</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:3aef045d-abdf-425a-bc18-e107d38d693e" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type='text/javascript'&gt;&lt;!--
digg_title = 'Automatically launch a silent remote MSI installation from Team Build';
digg_bodytext = 'If you need to maintain an up-to-date test machine with the latest installation of the product you are testing, this post shows you how you can trigger the automatic installation of the latest components as a result of a successful build.';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;If you need to maintain an up-to-date test machine with the latest installation of the product you are testing, this post shows you how you can trigger the automatic installation of the latest components as a result of a successful build.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;The logic has been tested using &lt;a title="Overview of Team Foundation Build" href="http://msdn2.microsoft.com/en-us/library/ms181710(VS.80).aspx" target="_blank"&gt;Team Build&lt;/a&gt;. However, since the underlying technology is &lt;a title="MSBuild Overview" href="http://msdn2.microsoft.com/en-us/library/ms171452(VS.80).aspx" target="_blank"&gt;MSBuild&lt;/a&gt;, the information described here does not require Team Build.&lt;/p&gt; &lt;h3&gt;Prerequisites&lt;/h3&gt; &lt;p&gt;MSBuild, and therefore Team Build, is unable to natively build &lt;a title="Setup and Deployment Projects" href="http://msdn2.microsoft.com/en-us/library/wx3b589t(VS.80).aspx" target="_blank"&gt;Setup projects&lt;/a&gt;. In order to build a Setup project from within a &lt;abbr title="Provides an interface which lets the user define the build steps and build parameters needed for their builds."&gt;Build Type&lt;/abbr&gt; you need to use the Visual Studio environment via the command line. This implies you will need to have access to Visual Studio. Preferably, the&amp;nbsp;Visual Studio environment should be installed&amp;nbsp;on the &lt;abbr title="The build computer(s) on which the Build Service runs the build steps on instructions from the Team Build Web service."&gt;Build Machine&lt;/abbr&gt;.&lt;/p&gt; &lt;p&gt;In addition, because the Build Machine will be triggering the execution of the installation remotely, the user account under which the build process executes should have remote, administrative access to the &lt;abbr title="Isolated Test computer(s) on which Team Tests are carried out."&gt;Test Machine&lt;/abbr&gt; on which the installation will occur. Alternatively, you may use another user credentials to&amp;nbsp;execute the&amp;nbsp;installation but this means that these credentials will need to be part of the command that will launch the remote process, and therefore part of the Build Type project file.&lt;/p&gt; &lt;h3&gt;Required Tools&lt;/h3&gt; &lt;p&gt;&lt;strong&gt;Devenv&lt;/strong&gt; - Executable used to launch &lt;em&gt;Visual Studio&lt;/em&gt;. It can be used to&amp;nbsp;build Setup projects from the command line, amongst other things. For details on all command line switches for &lt;strong&gt;Devenv&lt;/strong&gt; refer to the &lt;a title="Devenv Command Line Switches" href="http://msdn2.microsoft.com/en-us/library/xee0c8y7(VS.80).aspx" target="_blank"&gt;MSDN online documentation&lt;/a&gt;. For details on building Setup projects using Team Build, please refer to the article &lt;a title="Walkthrough: Configuring Team Foundation Build to Build a Visual Studio Setup Project" href="http://msdn2.microsoft.com/en-us/library/ms404859(VS.80).aspx" target="_blank"&gt;Walkthrough: Configuring Team Foundation Build to Build a Visual Studio Setup Project&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;PsExec&lt;/strong&gt; - Allows execution of processes on other systems. &lt;a title="PsExec v1.82 by Mark Russinovich at Microsoft TechNet" href="http://www.microsoft.com/technet/sysinternals/utilities/psexec.mspx" target="_blank"&gt;&lt;strong&gt;PsExec&lt;/strong&gt;&lt;/a&gt;&amp;nbsp;is part of the &lt;a title="Windows Sysinternals Home at Microsoft TechNet" href="http://www.microsoft.com/technet/sysinternals/default.mspx" target="_blank"&gt;Windows Sysinternals&lt;/a&gt; download and it is hosted at &lt;a title="Microsoft TechNet Home" href="http://technet.microsoft.com/en-us/default.aspx" target="_blank"&gt;Microsoft TechNet&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Msiexec&lt;/strong&gt; - The resulting &lt;a title="Windows Installer definition at Wikipedia" href="http://en.wikipedia.org/wiki/Windows_Installer" target="_blank"&gt;MSI&lt;/a&gt; from a Setup project is not an executable. In order to perform actions outside of its default association, you require the use of a tool called &lt;strong&gt;&lt;a title="Msiexec - Windows XP Professional Product Documentation" href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/msiexec.mspx?mfr=true" target="_blank"&gt;Msiexec&lt;/a&gt;&lt;/strong&gt;. This tool &lt;em&gt;provides the means to install, modify, and perform operations on Windows Installer from the command line&lt;/em&gt;. Silent execution of these Windows Installer files can be accomplished through Msiexec.&lt;/p&gt; &lt;h3&gt;Combining the Tools&lt;/h3&gt; &lt;p&gt;In order to build a Setup project you need to use an &lt;span class="code"&gt;Exec&lt;/span&gt; task in the &lt;span class="code"&gt;AfterCompile&lt;/span&gt; target, as the following code snippet shows.&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt; &lt;div class="csharpcode"&gt;&lt;pre class="alt"&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;="AfterCompile"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alteven"&gt;  ...&lt;/pre&gt;&lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Exec&lt;/span&gt; &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;="$(DevEnv) &amp;amp;quot;$(SolutionRoot)\Setup\Setup.vdproj&amp;amp;quot; /Build &amp;amp;quot;Release|Any CPU&amp;amp;quot;"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alteven"&gt;  ...&lt;/pre&gt;&lt;pre class="alt"&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;/div&gt;&lt;/div&gt;
&lt;p&gt;Once you have access to the resulting MSI file, you can use the following command to execute a remote installation. Note that you will need to replace the information such as Server Name&amp;nbsp;(&lt;span class="code"&gt;MyServerName&lt;/span&gt; in the example below)&amp;nbsp;and paths with yours.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&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;="AfterCompile"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alteven"&gt;  ...&lt;/pre&gt;&lt;pre class="alt"&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Copy&lt;/span&gt; &lt;span class="attr"&gt;SourceFiles&lt;/span&gt;&lt;span class="kwrd"&gt;="$(SolutionRoot)\Setup\Release\Setup.msi"&lt;/span&gt; &lt;span class="attr"&gt;DestinationFolder&lt;/span&gt;&lt;span class="kwrd"&gt;="\\MyServerName\C$\Temp\Setup"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alteven"&gt;  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Exec&lt;/span&gt; &lt;span class="attr"&gt;Command&lt;/span&gt;&lt;span class="kwrd"&gt;="$(PsExec) &lt;a href="file://\\MyServerName"&gt;\\MyServerName&lt;/a&gt; -w &amp;amp;quot;C:\Temp\Setup&amp;amp;quot; msiexec /i &amp;amp;quot;C:\Temp\Setup\Setup.msi&amp;amp;quot; -quiet"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;  ...&lt;/pre&gt;&lt;pre class="alteven"&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;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; There have been cases where PsExec causes MSBuild to hang in the middle of a remote installation. I have yet to figure out why this may happen. If you run into this scenario and are able to fix it please share your experiences.&lt;/p&gt;
&lt;h3&gt;Alternate Scenario&lt;/h3&gt;
&lt;p&gt;There are times when you may want to trigger the installation on a remote machine from within your Visual&amp;nbsp;Studio environment. For example, I&amp;nbsp;do this often when I perform integration testing of MSBuild custom tasks, where I need to install the custom task in the Build Machine. Rather than doing it manually, I make it part of the Setup project's &lt;abbr title="Event triggered to run after the build has successfully completed."&gt;Post-build event&lt;/abbr&gt;.&lt;/p&gt;
&lt;p&gt;I use the following script to automate the installation of my setups. In order for you to use the script, add it to your own Setup project's Post-build event and replace all the lines in &lt;strong&gt;bold&lt;/strong&gt; with your own information.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;
&lt;div class="csharpcode"&gt;&lt;pre class="alt"&gt;echo ======================================================================&lt;/pre&gt;&lt;pre class="alteven"&gt;echo POSTBUILDSTEP for setup project.&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alteven"&gt;&lt;strong&gt;set ServerName=YOUR_SERVER_NAME&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;set ServerPath=\\%ServerName%&lt;/pre&gt;&lt;pre class="alteven"&gt;&lt;strong&gt;set RemoteDrive=C&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;&lt;strong&gt;set MsiPath=Temp\YourProjectName&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alteven"&gt;&lt;strong&gt;set MsiName=YourProjectNameSetup.msi&lt;/strong&gt;&lt;/pre&gt;&lt;pre class="alt"&gt;set RemoteMsiFilePath=%RemoteDrive%:\%MsiPath%&lt;/pre&gt;&lt;pre class="alteven"&gt;set RemoteMsiFileName=%RemoteMsiFilePath%\%MsiName%&lt;/pre&gt;&lt;pre class="alt"&gt;set UncMsiFilePath=%ServerPath%\%RemoteDrive%$\%MsiPath%&lt;/pre&gt;&lt;pre class="alteven"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;echo Verifying/Creating temporary folder at "%UncMsiFilePath%"&lt;/pre&gt;&lt;pre class="alteven"&gt;if not exist "%UncMsiFilePath%" mkdir "%UncMsiFilePath%"&lt;/pre&gt;&lt;pre class="alt"&gt;if errorlevel 1 goto BuildEventFailed&lt;/pre&gt;&lt;pre class="alteven"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;echo Uninstalling "%RemoteMsiFileName%" from server %ServerName%&lt;/pre&gt;&lt;pre class="alteven"&gt;psexec %ServerPath% -w "%RemoteMsiFilePath%" msiexec /uninstall "%RemoteMsiFileName%" -quiet&lt;/pre&gt;&lt;pre class="alt"&gt;if errorlevel 1619 goto BuildEventContinue&lt;/pre&gt;&lt;pre class="alteven"&gt;if errorlevel 1606 goto BuildEventFailed&lt;/pre&gt;&lt;pre class="alt"&gt;if errorlevel 1605 goto BuildEventContinue&lt;/pre&gt;&lt;pre class="alteven"&gt;if errorlevel 1 goto BuildEventFailed&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alteven"&gt;:BuildEventContinue&lt;/pre&gt;&lt;pre class="alt"&gt;echo Copying "$(BuiltOuputPath)" to "%UncMsiFilePath%"&lt;/pre&gt;&lt;pre class="alteven"&gt;xcopy /Y /R "$(BuiltOuputPath)" "%UncMsiFilePath%"&lt;/pre&gt;&lt;pre class="alt"&gt;if errorlevel 1 goto BuildEventFailed&lt;/pre&gt;&lt;pre class="alteven"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alt"&gt;echo Installing "%RemoteMsiFileName%" on server %ServerName%&lt;/pre&gt;&lt;pre class="alteven"&gt;psexec "%ServerPath%" -w "%RemoteMsiFilePath%" msiexec /i "%RemoteMsiFileName%" -quiet&lt;/pre&gt;&lt;pre class="alt"&gt;if errorlevel 1 goto BuildEventFailed&lt;/pre&gt;&lt;pre class="alteven"&gt;goto BuildEventOK&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alteven"&gt;:BuildEventFailed&lt;/pre&gt;&lt;pre class="alt"&gt;echo POSTBUILDSTEP for setup project FAILED&lt;/pre&gt;&lt;pre class="alteven"&gt;exit 1&lt;/pre&gt;&lt;pre class="alt"&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre class="alteven"&gt;:BuildEventOK&lt;/pre&gt;&lt;pre class="alt"&gt;echo POSTBUILDSTEP for setup project COMPLETED OK&lt;/pre&gt;&lt;pre class="alteven"&gt;echo ======================================================================&lt;/pre&gt;&lt;pre class="alt"&gt;echo.&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;With the script in place, whenever I build the Setup project the script will uninstall any previous version and re-install the new version of my custom task. This technique can be applied to pretty much any type of Setup project.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-3006181828396488765?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/3006181828396488765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=3006181828396488765' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/3006181828396488765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/3006181828396488765'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/05/automatically-launch-silent-remote-msi.html' title='Automatically launch a silent remote MSI installation from Team Build'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-2244804643573409725</id><published>2007-05-30T07:19:00.001-04:00</published><updated>2007-05-30T07:25:27.194-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='DB Pro'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='VSTS'/><title type='text'>VSTS Database Professional using Remote SQL Server</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:4887432b-d3e2-44d9-8c30-76d849d2555a" contenteditable="false" style="padding-right: 15px; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type='text/javascript'&gt;&lt;!--
digg_title = 'VSTS Database Professional using Remote SQL Server';
digg_bodytext = 'My local SQL Server 2005 installation was damaged and I needed to be able to continue work on a project that makes use of the Visual Studio 2005 Team Edition for Database Professionals (VSTS DB Pro). The problem is that VSTS DB Pro requires a local SQL Server 2005 Developer Edition instance and above for it to work.';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;My local &lt;a title="SQL Server 2005 Home" href="http://www.microsoft.com/sql/default.mspx" target="_blank"&gt;SQL Server 2005&lt;/a&gt; installation was damaged and I needed to be able to continue work on a project that makes use of the &lt;a title="Visual Studio 2005 Team Edition for Database Professionals Home" href="http://msdn2.microsoft.com/en-us/teamsystem/aa718807.aspx" target="_blank"&gt;Visual Studio 2005 Team Edition for Database Professionals&lt;/a&gt; (VSTS DB Pro). The problem is that VSTS DB Pro requires a local SQL Server 2005 Developer Edition instance and above for it to work. So how does one make use of a remote SQL Server instance?&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;Perhaps there's another way to make it work with a remote SQL Server instance, but it appears that the current version of VSTS DB Pro does not natively support such configuration.&lt;/p&gt; &lt;p&gt;Luckily I found a &lt;a title="Database Pro requires local SQL 2005 instance???" href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=742672&amp;amp;SiteID=1"&gt;MSDN Forum Post&lt;/a&gt; where Thomas Waldron suggests the use of a tool called &lt;a title="TcpTrace Home" href="http://pocketsoap.com/tcptrace/" target="_blank"&gt;TcpTrace&lt;/a&gt; to redirect the local 1433 port to that of a remote SQL Server instance. It works like a charm! I can now load my database projects.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-2244804643573409725?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/2244804643573409725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=2244804643573409725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2244804643573409725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2244804643573409725'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/05/vsts-database-professional-using-remote.html' title='VSTS Database Professional using Remote SQL Server'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-6374035201092843267</id><published>2007-03-28T07:02:00.001-04:00</published><updated>2007-08-01T20:47:30.599-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live Writer'/><category scheme='http://www.blogger.com/atom/ns#' term='Plugin'/><title type='text'>Digg This plugin for Windows Live Writer</title><content type='html'>&lt;span class="fullpost"&gt; &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;Update (08/01/07): Source code now available&amp;nbsp;on &lt;a title="Plugin Collection for Windows Live Writer" href="http://www.codeplex.com/wlwplugincollection" target="_blank"&gt;CodePlex&lt;/a&gt;.&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:ac0c3cd3-aae1-4078-999c-36fae14a756a" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type='text/javascript'&gt;&lt;!--
digg_title = 'Digg This plugin for Windows Live Writer';
digg_bodytext = 'Digg This plugin for Windows Live Writer is a plugin to insert a "Digg This" button into to your Windows Live Writer posts. It is a wrapper to the API described in the Integrate: "Digg This" Button page at Digg.';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;Digg This plugin for Windows Live Writer is a plugin to insert a "Digg This" button into to your Windows Live Writer posts. It is a wrapper to the API described in the &lt;a title="Description of the API used to integrate a &amp;quot;Digg This&amp;quot; button in your webiste and blog posts" href="http://digg.com/tools/integrate" target="_blank"&gt;Integrate: "Digg This" Button&lt;/a&gt; page at &lt;a title="Digg Home" href="http://digg.com/" target="_blank"&gt;Digg&lt;/a&gt;.&lt;/p&gt;&lt;span class="fullpost"&gt;&lt;img style="margin: 5px 0px 0px" alt="Digg This Sidebar Editor" src="http://blogs.incyclesoftware.com/lvildosola/images/dt4wlw/dtdlg_anim.gif" align="right"&gt;  &lt;p&gt;If you already use Digg, you will surely know how to use this plugin. The functionality is designed to closely match the online submission form. The Sidebar editor is broken into two tabs: General and Appearance.&lt;/p&gt; &lt;p&gt;The General tab contains the information used as defaults for the submission to Digg. The Appearance tab contains properties that allow you to modify the way the Digg This button will look when published.&lt;/p&gt; &lt;p&gt;The simplest way to use this plugin is to specify a post title, specify at least one paragraph of text that will describe briefly the post, place the cursor wherever you would like to insert the Digg This button and click on the &lt;strong&gt;Insert Digg This...&lt;/strong&gt; option in the Sidebar. You will notice that the post title is used for the submission title and the first paragraph is used&amp;nbsp;for the submission text. The first time one of your readers clicks on the button once the post is published, they will be sent to the Digg site to submit the post to Digg. The defaults you specified will appear for the user to either use as is, or modify accordingly.&lt;/p&gt; &lt;p&gt;Some of the features of the Digg This plugin are:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Auto-selection of Title &amp;amp; Text&lt;/strong&gt; – The Digg This button has the ability to accept recommendations or defaults as part of the submission link. These parameters are used to pre-populate the respective fields when a user submits an entry. Instead of having the submitter type their own text, which they can still do during submission time, the Digg This plugin will take the post’s title and the first paragraph in the post body and&amp;nbsp;use&amp;nbsp;these as the suggested Title and Text properties in the Windows Live Writer Sidebar, respectively.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Submission Character Count&lt;/strong&gt; – Just like the online submission form on &lt;a href="http://digg.com/"&gt;Digg&lt;/a&gt; for the Title and Text fields, the number of remaining characters available will appear in the status bar of the Windows Live Writer Sidebar.  &lt;p&gt;&lt;strong&gt;Visual Layout of Digg This Button&lt;/strong&gt; – Using the Appearance features present in the Windows Live Writer Sidebar when the object is selected, you can modify the Layout, Text Wrapping, and Margin properties and see them apply immediately.  &lt;p&gt;&lt;strong&gt;Tooltip Help&lt;/strong&gt; – All fields have an associated tool tip that provides more details about the specific use of that field.  &lt;p&gt;&lt;strong&gt;Persistent Options&lt;/strong&gt; – Changes to the Digg This properties can be used as defaults. These include layout and submission properties, accept for Title and Text, which get overwritten whenever a new instance of the Digg This button is inserted in a post.  &lt;p&gt;&lt;em&gt;&lt;a class="download" title="Digg This plugin for Windows Live Writer at Windows Live Gallery" onclick="javascript:urchinTracker('/downloads/DiggThisSetup');" href="http://gallery.live.com/liveItemDetail.aspx?li=85a4b20c-e86e-4110-8c50-9675752766b9&amp;amp;l=8" target="_blank"&gt;Download Digg This plugin for Windows Live Writer Setup&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-6374035201092843267?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/6374035201092843267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=6374035201092843267' title='25 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/6374035201092843267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/6374035201092843267'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/03/digg-this-plugin-for-windows-live.html' title='Digg This plugin for Windows Live Writer'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-1255173115611692580</id><published>2007-02-23T22:32:00.001-05:00</published><updated>2007-03-30T06:09:29.445-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Provider'/><category scheme='http://www.blogger.com/atom/ns#' term='Role'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='NHibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='Membership'/><title type='text'>NHibernateProvider - Membership/Role provider using NHibernate</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:f67911f2-1ab7-4c0e-96ce-f52217fcb025" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type="text/javascript"&gt;&lt;!--
digg_title = 'NHibernateProvider - Membership/Role provider using NHibernate';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;I started this project last year to get myself more involved in learning alternative persistence mechanisms to use with ASP.NET. NHibernateProvider is an &lt;a title="The Official Microsoft ASP.NET 2.0 Site" href="http://www.asp.net/" target="_blank"&gt;ASP.NET 2.0&lt;/a&gt; Membership/Role provider using &lt;a title="NHibernate for .NET" href="http://www.hibernate.org/343.html" target="_blank"&gt;NHibernate&lt;/a&gt;.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;In case you don't already know, NHibernate is a port to .NET of the &lt;a title="Hibernate Core for Java" href="http://www.hibernate.org/344.html" target="_blank"&gt;Hibernate Core for Java&lt;/a&gt;. Hibernate is an Object-relational mapping (ORM) solution for the Java language (see more at &lt;a title="Hibernate (Java)" href="http://en.wikipedia.org/wiki/Hibernate_%28Java%29" target="_blank"&gt;Wikipedia&lt;/a&gt;).&lt;/p&gt; &lt;p&gt;The project has been hosted at GotDotNet for the past few months, but it appears that &lt;a title="GotDotNet Phase-out Announcement" href="http://www.gotdotnet.com/default.aspx" target="_blank"&gt;GotDotNet is being phased out&lt;/a&gt;. So, I decided to take this opportunity to not only move the project to &lt;a title="CodePlex" href="http://www.codeplex.com" target="_blank"&gt;CodePlex&lt;/a&gt;, but also to do a formal RTM release. It had been in Beta for a while now with no apparent issues.&lt;/p&gt; &lt;p&gt;You can find the details of this release and of the entire project at it's &lt;a title="NHibernateProvider Home at CodePlex" href="http://www.codeplex.com/nhibernateprovider" target="_blank"&gt;new home at CodePlex&lt;/a&gt;.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-1255173115611692580?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/1255173115611692580/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=1255173115611692580' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/1255173115611692580'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/1255173115611692580'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/02/nhibernateprovider-moves-to-codeplex.html' title='NHibernateProvider - Membership/Role provider using NHibernate'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-4110448956648833178</id><published>2007-02-19T14:33:00.001-05:00</published><updated>2008-01-12T18:46:59.086-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Test Template'/><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='VSTS'/><category scheme='http://www.blogger.com/atom/ns#' term='Customize'/><title type='text'>Creating a customized Manual Test template for Visual Studio 2005</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="scid:B3E14793-948F-49af-A347-D19C374A7C4F:31b54aea-e419-41d1-84e7-694d3255242f" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type='text/javascript'&gt;&lt;!--
digg_title = 'Creating a customized Manual Test template for Visual Studio 2005';
digg_bodytext = 'Part of the work we do at Incycle Software is help our customers install and configure Visual Studio Team System (VSTS). This includes the customization of work items, reports, process guidance, etc. For some customers, we even help them customize some of the templates.
Visual Studio 2005 Team Suite and Visual Studio 2005 Team Edition for Software Testers have templates specific to testing. One of these test templates is the Manual Test. There are two Manual Test formats: Text and Word. The steps to follow will show you one way to customize the look and structure of the Word format document and package it to create your own template.
I will assume that you are somewhat familiar with the Visual Studio environment and that you already know how to create Solutions and Projects. For these and other walkthroughs please refer to the Samples and Walkthroughs pages in MSDN.
The testing templates in Visual Studio 2005 are nothing more than extensions to the environment. In order to create a complete extension you would need to use the Visual Studio SDK. Creating a full Visual Studio extension is beyond the scope of this post.
With the help from Sarah Cameron, one of my colleagues at work, we have polished and divided the process into three main steps.
Create the Template
1. Start with the existing Manual Test template that can be found in your Visual Studio's Item Template folder. In my installation the path is D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033. The template file name is ManualTestWordFormat.zip.
2. Create a folder that will contain your customized template files. In this example, I will call the folder IncycleManualTest. This will serve as a staging area and is really optional.
3. Extract the contents of the ManualTestWordFormat.zip into the IncycleManualTest folder. The folder should now contain two files: ManualTest.mht and ManualTest.vstemplate.
4. Rename both extracted files to match the name of your template folder. In this example, the files are renamed to IncycleManualTest.mht and IncycleManualTest.vstemplate, respectively.
5. Open the .mht file in Microsoft Word and modify the document to suit your needs. When you are done you can save the document and close Word. You now have the document template contents for your customized Manual Test.
6. Open the file .vstemplate in a text editor such as Notepad. You should see the contents as an XML-formatted document. The document looks like the following.
&amp;lt;VSTemplate Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Item"&amp;gt;
  &amp;lt;TemplateData&amp;gt;
    &amp;lt;Name Package="{52CBD135-1F97-2580-011F-C7CD052E44DE}" ID="113"/&amp;gt;
    &amp;lt;Description Package="{52CBD135-1F97-2580-011F-C7CD052E44DE}" ID="109"/&amp;gt;
    &amp;lt;Icon Package="{52CBD135-1F97-2580-011F-C7CD052E44DE}" ID="107"/&amp;gt;
    &amp;lt;ProjectType&amp;gt;CSharp&amp;lt;/ProjectType&amp;gt;
    &amp;lt;SortOrder&amp;gt;10&amp;lt;/SortOrder&amp;gt;
    &amp;lt;DefaultName&amp;gt;ManualTest.mht&amp;lt;/DefaultName&amp;gt;
    &amp;lt;TemplateGroupID&amp;gt;TestProject-V1&amp;lt;/TemplateGroupID&amp;gt;
    &amp;lt;TemplateID&amp;gt;TestProject-V1-WordManualTest&amp;lt;/TemplateID&amp;gt;
  &amp;lt;/TemplateData&amp;gt;
  &amp;lt;TemplateContent&amp;gt;
    &amp;lt;ProjectItem ReplaceParameters="false" OpenInEditor="true"&amp;gt;ManualTest.mht&amp;lt;/ProjectItem&amp;gt;
  &amp;lt;/TemplateContent&amp;gt;
  &amp;lt;TestProjectData&amp;gt;
    &amp;lt;LongDescription Package="{52CBD135-1F97-2580-011F-C7CD052E44DE}" ID="112"/&amp;gt;
    &amp;lt;Helpkeyword Package="{52CBD135-1F97-2580-011F-C7CD052E44DE}" ID="105"/&amp;gt;
  &amp;lt;/TestProjectData&amp;gt;
  &amp;lt;WizardExtension&amp;gt;
    &amp;lt;Assembly&amp;gt;Microsoft.VisualStudio.QualityTools.Wizard.TestProjectWizards&amp;lt;/Assembly&amp;gt;
    &amp;lt;FullClassName&amp;gt;Microsoft.VisualStudio.TestTools.TestProjectWizards.TestItemWizardExtension&amp;lt;/FullClassName&amp;gt;
  &amp;lt;/WizardExtension&amp;gt;
&amp;lt;/VSTemplate&amp;gt;';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt; &lt;p&gt;&lt;font size="1"&gt;&lt;em&gt;&lt;strong&gt;Update (01/12/2008): The post has been updated to show the differences with respect to &lt;a title="Visual Studio 2008" href="http://msdn2.microsoft.com/en-us/vstudio/bb964524.aspx" target="_blank"&gt;Visual Studio 2008&lt;/a&gt;. The corresponding notes have been written in &lt;font color="#0000ff"&gt;blue&lt;/font&gt;.&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;/span&gt; &lt;p&gt;Part of the work we do at &lt;a title="InCycle Software" href="http://www.incyclesoftware.com/" target="_blank"&gt;InCycle Software&lt;/a&gt; is help our customers install and configure &lt;a title="Visual Studio Team System Home" href="http://msdn2.microsoft.com/en-us/teamsystem/" target="_blank"&gt;Visual Studio Team System&lt;/a&gt; (VSTS). This includes the customization of work items, reports, process guidance, etc. For some customers, we even help them customize some of the templates.&lt;/p&gt; &lt;p&gt;&lt;a title="Visual Studio 2005 Team Suite" href="http://msdn2.microsoft.com/en-us/teamsystem/aa718822.aspx" target="_blank"&gt;Visual Studio 2005 Team Suite&lt;/a&gt; and &lt;a title="Visual Studio 2005 Team Edition for Software Testers" href="http://msdn2.microsoft.com/en-us/teamsystem/aa718823.aspx" target="_blank"&gt;Visual Studio 2005 Team Edition for Software Testers&lt;/a&gt; have templates specific to testing. One of these test templates is the &lt;a title="Manual Test description with Sample Word format" href="http://msdn2.microsoft.com/en-us/teamsystem/aa718478.aspx" target="_blank"&gt;Manual Test&lt;/a&gt;. There are two Manual Test formats: Text and Word. The steps to follow will show you one way to customize the look and structure of the Word format document and package it to create your own template.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;I will assume that you are somewhat familiar with the Visual Studio environment and that you already know how to create Solutions and Projects. For these and other walkthroughs please refer to the &lt;a title="Samples and Walkthroughs (Development Environment)" href="http://msdn2.microsoft.com/en-us/library/2x7c9kxh(VS.80).aspx" target="_blank"&gt;Samples and Walkthroughs&lt;/a&gt; pages in MSDN.&lt;/p&gt; &lt;p&gt;The testing templates in Visual Studio 2005 are nothing more than extensions to the environment. In order to create a complete extension you would need to use the &lt;a title="Visual Studio SDK" href="http://msdn2.microsoft.com/en-us/library/bb187352(vs.80).aspx" target="_blank"&gt;Visual Studio SDK&lt;/a&gt;. Creating a full Visual Studio extension is beyond the scope of this post.&lt;/p&gt; &lt;p&gt;With the help from Sarah Cameron, one of my colleagues at work, we have polished and divided the process into three main steps.&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;Create the Template&lt;/strong&gt;&lt;/h4&gt; &lt;p&gt;&lt;strong&gt;1.&lt;/strong&gt; Start with the existing Manual Test template that can be found in your &lt;b&gt;Visual Studio's Item Template folder&lt;/b&gt;. In my installation the path is &lt;strong&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033&lt;/strong&gt;. The template file name is &lt;b&gt;ManualTestWordFormat.zip&lt;/b&gt;.&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; In &lt;/em&gt;&lt;strong&gt;Visual Studio 2008&lt;/strong&gt;&lt;em&gt; the above path would be &lt;/em&gt;&lt;strong&gt;D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp\1033&lt;/strong&gt;&lt;em&gt;. The template file name is the same. The path varies from &lt;/em&gt;&lt;strong&gt;Microsoft Visual Studio 8&lt;/strong&gt;&lt;em&gt; to &lt;/em&gt;&lt;strong&gt;Microsoft Visual Studio 9.0&lt;/strong&gt;&lt;em&gt;.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;2.&lt;/strong&gt; Create a folder that will contain your customized template files. In this example, I will call the folder &lt;strong&gt;InCycleManualTest&lt;/strong&gt;. This will serve as a staging area and is really optional.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;3.&lt;/strong&gt; Extract the contents of the &lt;strong&gt;ManualTestWordFormat.zip&lt;/strong&gt; into the &lt;strong&gt;InCycleManualTest&lt;/strong&gt; folder. The folder should now contain two files: &lt;strong&gt;ManualTest.mht&lt;/strong&gt; and &lt;strong&gt;ManualTest.vstemplate&lt;/strong&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;4.&lt;/strong&gt; Rename both extracted files to match the name of your template folder. In this example, the files are renamed to &lt;strong&gt;InCycleManualTest.mht&lt;/strong&gt; and &lt;strong&gt;InCycleManualTest.vstemplate&lt;/strong&gt;, respectively.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; Open the &lt;b&gt;.mht&lt;/b&gt; file in Microsoft Word and modify the document to suit your needs. When you are done you can save the document and close Word. You now have the document template contents for your customized Manual Test.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;6.&lt;/strong&gt; Open the file &lt;strong&gt;.vstemplate&lt;/strong&gt; in a text editor such as Notepad. You should see the contents as an XML-formatted document. The document looks like the following.&lt;/p&gt; &lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;&lt;pre class="csharpcode" id="codeSnippet"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VSTemplate&lt;/span&gt; &lt;span class="attr"&gt;Version&lt;/span&gt;&lt;span class="kwrd"&gt;="2.0.0"&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/developer/vstemplate/2005"&lt;/span&gt; &lt;span class="attr"&gt;Type&lt;/span&gt;&lt;span class="kwrd"&gt;="Item"&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;TemplateData&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;Name&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="113"&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;Description&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="109"&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;Icon&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="107"&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;ProjectType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;CSharp&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProjectType&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;SortOrder&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;10&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;SortOrder&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;DefaultName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;ManualTest.mht&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DefaultName&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;TemplateGroupID&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;TestProject-V1&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TemplateGroupID&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;TemplateID&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;TestProject-V1-WordManualTest&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TemplateID&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;TemplateData&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;TemplateContent&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;ProjectItem&lt;/span&gt; &lt;span class="attr"&gt;ReplaceParameters&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt; &lt;span class="attr"&gt;OpenInEditor&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;ManualTest.mht&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProjectItem&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;TemplateContent&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;TestProjectData&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;LongDescription&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="112"&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;Helpkeyword&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="105"&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;TestProjectData&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;WizardExtension&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;Assembly&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Microsoft.VisualStudio.QualityTools.Wizard.TestProjectWizards&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Assembly&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;FullClassName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Microsoft.VisualStudio.TestTools.TestProjectWizards.TestItemWizardExtension&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;FullClassName&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;WizardExtension&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;VSTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;
&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; In &lt;strong&gt;Visual Studio 2008&lt;/strong&gt;, the &lt;/em&gt;&lt;strong&gt;Version&lt;/strong&gt;&lt;em&gt; of the &lt;/em&gt;&lt;strong&gt;VSTemplate&lt;/strong&gt;&lt;em&gt; is &lt;/em&gt;&lt;strong&gt;3.0.0&lt;/strong&gt;&lt;em&gt;. If you start with the template from the correct folder you will already have this version set correctly.&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;At this point the document represents the Manual Test Word format item template. We need to make some changes to add our customized template specific information.&lt;/p&gt;
&lt;p&gt;Specifically update the following tags: &lt;strong&gt;Name&lt;/strong&gt;, &lt;strong&gt;Description&lt;/strong&gt;, &lt;strong&gt;DefaultName&lt;/strong&gt;, &lt;strong&gt;TemplateID&lt;/strong&gt;, and &lt;strong&gt;ProjectItem&lt;/strong&gt;. Remove or replace the contents of the &lt;strong&gt;TestProjectData&lt;/strong&gt; tag.&lt;/p&gt;
&lt;p&gt;Save the document.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; It is very important that the &lt;/em&gt;&lt;strong&gt;TemplateID&lt;/strong&gt;&lt;em&gt; is unique. If it matches an existing template it will override its associated document.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you want to use special characters in the Name or Description of the template you will need to use the equivalent escape character (same XML rules apply to the &lt;b&gt;.vstemplate&lt;/b&gt; document). For example, if you want to include a word that contains the French character "é" (no quotes) then you will need to replace it with its equivalent escape character "&amp;amp;#233;" (no quotes). Failing to do so will cause the template to fail registration without any error message.&lt;/em&gt; 
&lt;p&gt;The following is the resulting &lt;strong&gt;InCycleManualTest.vstemplate&lt;/strong&gt; file used in this example.&lt;/p&gt;&lt;span class="fullpost"&gt;
&lt;div class="csharpcode-wrapper" id="codeSnippetWrapper"&gt;&lt;pre class="csharpcode" id="codeSnippet"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;VSTemplate&lt;/span&gt; &lt;span class="attr"&gt;Version&lt;/span&gt;&lt;span class="kwrd"&gt;="2.0.0"&lt;/span&gt; &lt;span class="attr"&gt;Type&lt;/span&gt;&lt;span class="kwrd"&gt;="Item"&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/developer/vstemplate/2005"&lt;/span&gt; &lt;span class="attr"&gt;xmlns:xsi&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt; &lt;span class="attr"&gt;xsi:schemaLocation&lt;/span&gt;&lt;span class="kwrd"&gt;="http://schemas.microsoft.com/developer/vstemplate/2005"&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;TemplateData&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;Name&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;InCycle Manual Test (Word format)&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;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;Description&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Customized manual template&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Description&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;Icon&lt;/span&gt; &lt;span class="attr"&gt;Package&lt;/span&gt;&lt;span class="kwrd"&gt;="{52CBD135-1F97-2580-011F-C7CD052E44DE}"&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="107"&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;ProjectType&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;CSharp&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProjectType&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;SortOrder&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;80&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;SortOrder&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;DefaultName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;InCycleManualTest.mht&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DefaultName&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;TemplateGroupID&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;TestProject-V1&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TemplateGroupID&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;TemplateID&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;InCycleManualTest&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;TemplateID&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;ShowByDefault&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;false&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ShowByDefault&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;TemplateData&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;TemplateContent&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;ProjectItem&lt;/span&gt; &lt;span class="attr"&gt;ReplaceParameters&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; &lt;span class="attr"&gt;OpenInEditor&lt;/span&gt;&lt;span class="kwrd"&gt;="false"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;InCycleManualTest.mht&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ProjectItem&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;TemplateContent&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;WizardExtension&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;Assembly&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Microsoft.VisualStudio.QualityTools.Wizard.TestProjectWizards&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Assembly&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;FullClassName&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Microsoft.VisualStudio.TestTools.TestProjectWizards.TestItemWizardExtension&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;FullClassName&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;WizardExtension&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;VSTemplate&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;
&lt;p&gt;&lt;strong&gt;7.&lt;/strong&gt; Repackage the files you previously extracted and modified into a zip file and call it the same name as the folder you created. In this example, the compressed file is called &lt;strong&gt;IncycleManualTest.zip&lt;/strong&gt;. Verify that the zip file does contain your two files and that these files do have your changes.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;Note:&lt;/strong&gt; It is very important that the files reside in the root of the zip file. If not, the template will not register correctly.&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;Deploy the Template&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;8.&lt;/strong&gt; Copy the modified exported template zip file to your &lt;strong&gt;Visual Studio's Item Template folder&lt;/strong&gt;. In this example, I copy the file &lt;strong&gt;IncycleManualTest.zip&lt;/strong&gt; to my folder &lt;strong&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplates\CSharp\1033&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;9.&lt;/strong&gt; If updating an existing template you must first remove any previous template from &lt;strong&gt;Visual Studio’s Item Template Cache&lt;/strong&gt;, which gets copied during the initial installation. 
&lt;p&gt;For example, if updating the &lt;b&gt;IncycleManualTest.zip&lt;/b&gt; template I would remove the corresponding &lt;b&gt;IncycleManualTest.zip&lt;/b&gt; file from my folder &lt;strong&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ItemTemplatesCache\CSharp\1033&lt;/strong&gt; before installing the new template. This is to ensure the new template is correctly updated in the cache. 
&lt;p&gt;&lt;strong&gt;10.&lt;/strong&gt; Install your customized template. For the template installation command to work correctly you need to run the &lt;strong&gt;Visual Studio 2005 Command Prompt&lt;/strong&gt;, as it initializes some environment variables required for the execution of the command.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Visual Studio 2005 Command Prompt&lt;/strong&gt; can be found under your &lt;strong&gt;Start&lt;/strong&gt; menu. Look for the program group &lt;strong&gt;Microsoft Visual Studio 2005&lt;/strong&gt; / &lt;strong&gt;Visual Studio Tools&lt;/strong&gt;. Launch it.&lt;/p&gt;
&lt;p&gt;At this point, make sure you close any running instances of Visual Studio. At the command prompt type and execute the command &lt;strong&gt;devenv /InstallVSTemplates&lt;/strong&gt;.&lt;/p&gt;
&lt;p align="center"&gt;&lt;a href="http://blogs.incyclesoftware.com/lvildosola/images/cmt/vs2k5cmd.png" target="_new"&gt;&lt;img alt="Visual Studio 2005 Command Prompt (click for full size)" src="http://blogs.incyclesoftware.com/lvildosola/images/cmt/vs2k5cmd_sm.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Give it some time to complete. Note that even after the command prompt returns your hard disk may continue spinning. So, give it some more time to make sure the registration is finalized.&lt;/p&gt;
&lt;h4&gt;Test the Template&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;11.&lt;/strong&gt; Test your new template. Launch Visual Studio and open/create a Test Project. Select &lt;strong&gt;New Test...&lt;/strong&gt; like you did before to display the &lt;strong&gt;Add New Test&lt;/strong&gt; dialog. You should now see your new Manual Test template.&lt;/p&gt;
&lt;p align="center"&gt;&lt;a href="http://blogs.incyclesoftware.com/lvildosola/images/cmt/add_new_test_2.png" target="_new"&gt;&lt;img alt="Add New Test dialog with Custom template (click for full size)" src="http://blogs.incyclesoftware.com/lvildosola/images/cmt/add_new_test_2_sm.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In order to do a complete test of this template you should create multiple Manual Test using it and go through the paces to make sure the template is recognized in the &lt;strong&gt;Test View&lt;/strong&gt;.&lt;/p&gt;&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-4110448956648833178?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/4110448956648833178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=4110448956648833178' title='20 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4110448956648833178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4110448956648833178'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/02/creating-customized-manual-test.html' title='Creating a customized Manual Test template for Visual Studio 2005'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>20</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-5843985977275077019</id><published>2007-02-14T23:26:00.001-05:00</published><updated>2007-03-24T06:39:44.892-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='ARITHABORT'/><title type='text'>Sudden SQL error during INSERT/UPDATE operation (ARITHABORT)</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:7a57389e-81d6-43a2-8098-00bf1e68e96e" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type="text/javascript"&gt;&lt;!--
digg_title = 'Sudden SQL error during INSERT/UPDATE operation (ARITHABORT)';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;Your database has been running fine for the longest time. All of a sudden &lt;span class="code"&gt;INSERT&lt;/span&gt; or &lt;span class="code"&gt;UPDATE&lt;/span&gt; operations fail with an error similar to the following.&lt;/p&gt; &lt;div class="quote-wrapper"&gt;UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT'&lt;/div&gt; &lt;p&gt;Quick research tells you to simply add the following line right after you open a connection to the database or at the start of your query.&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;SET ARITHABORT ON&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This seems to make things work again, but have you really solved the problem?&lt;/p&gt;&lt;span class="fullpost"&gt;
&lt;p&gt;It turns out that this error is caused when you create an &lt;a title="SQL Server 2000 Unveils Another Path to Peak Performance" href="http://msdn2.microsoft.com/en-us/library/aa224774(sql.80).aspx" target="_blank"&gt;Indexed View&lt;/a&gt;. But I didn't do it? Well, if you run either the &lt;a title="Index Tuning Wizard SQL Server 2000" href="http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/tunesql.mspx" target="_blank"&gt;Index Tuning Wizard&lt;/a&gt; (SQL Server 2000) or &lt;a title="Database Engine Tuning Advisor Reference" href="http://msdn2.microsoft.com/en-us/library/ms173494.aspx" target="_blank"&gt;Database Engine Tuning Advisor&lt;/a&gt; (SQL Server 2005), they will create what are called "Hypothetical Materialized Views" or index views. These views start with the prefix &lt;span class="code"&gt;_hypmv&lt;/span&gt;. When the analysis is finished these views are supposed to be discarded. However, if for whatever reason these views are not deleted, any attempts to &lt;span class="code"&gt;INSERT&lt;/span&gt; or &lt;span class="code"&gt;UPDATE&lt;/span&gt; into the table(s) on which this indexed views were created, the error message relating to incorrect &lt;span class="code"&gt;ARITHABORT&lt;/span&gt; setting will occur.&lt;/p&gt;
&lt;p&gt;In my particular case, the reason why these views were not discarded was because my account had enough privileges to create these views but not delete them. Running the tuning tools would leave these indexed views behind without me realizing it.&lt;/p&gt;
&lt;p&gt;So, if you see this error it may be that you have left behind some indexed views you did not create directly. Deleting them should get rid of the error.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-5843985977275077019?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/5843985977275077019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=5843985977275077019' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/5843985977275077019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/5843985977275077019'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/02/sudden-sql-error-during-insertupdate.html' title='Sudden SQL error during INSERT/UPDATE operation (ARITHABORT)'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-4652121591317783859</id><published>2007-02-12T22:19:00.001-05:00</published><updated>2009-04-06T08:01:06.597-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live Writer'/><category scheme='http://www.blogger.com/atom/ns#' term='Plugin'/><title type='text'>Code Snippet plugin for Windows Live Writer</title><content type='html'>&lt;span class="fullpost"&gt;   &lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;Update (03/18/09): Version 2.0.0 released, please refer to &lt;a title="Code Snippet plugin for Windows Live Writer v2.0.0" href="http://lvildosola.blogspot.com/2009/03/code-snippet-plugin-for-windows-live.html" target="_blank"&gt;this post&lt;/a&gt; for details.&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;            &lt;br /&gt;Update (03/16/09): Version 2.0.0 – Preview is now available on &lt;a title="Plugin Collection for Windows Live Writer" href="http://wlwplugincollection.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=9392" target="_blank"&gt;CodePlex&lt;/a&gt;.             &lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;Update (08/01/07): Source code now available on &lt;a title="Plugin Collection for Windows Live Writer" href="http://www.codeplex.com/wlwplugincollection" target="_blank"&gt;CodePlex&lt;/a&gt;.                   &lt;br /&gt;Update (03/26/07): Version 1.0.2 is now available with &lt;/font&gt;&lt;a title="New features for version 1.0.2" href="#102features"&gt;&lt;font size="1"&gt;new features&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;.                  &lt;br /&gt;Update (02/27/07): Version 1.0.1 is now available with &lt;/font&gt;&lt;a title="New features for version 1.0.1" href="#101features"&gt;&lt;font size="1"&gt;new features&lt;/font&gt;&lt;/a&gt;&lt;font size="1"&gt;.                  &lt;br /&gt;&lt;/font&gt;&lt;/em&gt;&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;&lt;font size="1"&gt;Update (02/21/07): You can now download the plugin from the &lt;/font&gt;&lt;a title="Code Snippet plugin for Windows Live Writer at Windows Live Gallery" href="http://gallery.live.com/liveItemDetail.aspx?li=d4409446-af7f-42ec-aa20-78aa5bac4748&amp;amp;l=8" target="_blank"&gt;&lt;font size="1"&gt;Windows Live Gallery&lt;/font&gt;&lt;/a&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/em&gt; &lt;/strong&gt;&lt;/p&gt; &lt;/span&gt;  &lt;p&gt;I use &lt;a title="Writer Zone" href="http://windowslivewriter.spaces.live.com/" target="_blank"&gt;Windows Live Writer&lt;/a&gt; (WLW) to post to my blog. As of this writing, WLW is in Beta. Nonetheless, the features available are very functional and I have to say that I have nothing but pleasant experiences using the product so far.&lt;/p&gt;  &lt;p&gt;One of WLW features of interest to the geek in me is its support for plugins via its &lt;a title="Windows Live Writer Beta Released--With SDK" href="http://dev.live.com/blogs/devlive/archive/2006/08/14/44.aspx" target="_blank"&gt;SDK&lt;/a&gt;. As you may already know, a plugin allows developers to extend an application with additional features.&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;A good part of my posts contain source code snippets to illustrate and/or compliment the content. Instead of using plain text to represent the code snippets I have been using CSS-based syntax highlighting thanks to the &lt;a title="C# Code Format" href="http://www.manoli.net/csharpformat/" target="_blank"&gt;online code formatter&lt;/a&gt; written by &lt;a title="Jean-Claude Manoli&amp;#39;s Career" href="http://www.manoli.net/career/" target="_blank"&gt;Jean-Claude Manoli&lt;/a&gt;.&lt;/p&gt;    &lt;p&gt;When I started using WLW I looked for plugins to see what useful features others have created. The &lt;a title="Windows Live Gallery Writer Extensions" href="http://gallery.live.com/default.aspx?l=8" target="_blank"&gt;Writer Windows Live Gallery&lt;/a&gt; has a growing list of plugins. I had found the &lt;a title="Insert Formatted Clipboard" href="http://gallery.live.com/liveItemDetail.aspx?li=90429f7b-39e5-4210-a6e6-aed0e67412f0&amp;amp;l=8" target="_blank"&gt;Insert Formatted Clipboard&lt;/a&gt;, &lt;a title="Paste from Visual Studio" href="http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&amp;amp;l=8" target="_blank"&gt;Paste from Visual Studio&lt;/a&gt; and &lt;a title="Insert Code for Windows Live Writer" href="http://gallery.live.com/liveItemDetail.aspx?li=1f57bd9b-a692-4593-9e9e-e2962d9c0eee&amp;amp;l=8" target="_blank"&gt;Insert Code for Windows Live Writer&lt;/a&gt;, all for formatting and/or applying syntax highlighting to sample source code. But while using them I found that there were things I wanted to do that these plugins did not offer. So, I wrote the Code Snippet plugin based on the syntax-highlighting code that Jean-Claude made public.&lt;/p&gt;    &lt;p&gt;The following image shows the main Code Snippet window that you can use to interactively review the sample code before inserting into your post.&lt;/p&gt;    &lt;p align="center"&gt;&lt;a href="http://blogs.incyclesoftware.com/lvildosola/images/csp4wlw/csdlg_full.png" target="_blank"&gt;&lt;img alt="Code Snippet dialog - Full Mode (click for full image)" src="http://blogs.incyclesoftware.com/lvildosola/images/csp4wlw/csdlg_full_small.png" /&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Some of the features in the Code Snippet plugin are:&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Run Silent&lt;/strong&gt; - use latest settings to automatically process current clipboard contents for quick pasting without displaying the Code Snippet dialog. Press and hold the &lt;strong&gt;Ctrl&lt;/strong&gt; key while activating the plugin to return to previous mode (Full or Compact).       &lt;br /&gt;&lt;strong&gt;Rich Text Editor&lt;/strong&gt; - lets you perform final changes to the source code before pasting it into your blog post. I work with a lot of source-controlled code that I don't want to necessarily touch in that environment prior to posting. So, I wanted to have the ability to increase/decrease indents or make changes to namespaces or class names without pasting to other text editors as an intermediary step.       &lt;br /&gt;&lt;strong&gt;Expandable/Splitable Code Panes&lt;/strong&gt; - able to view the code to process or the formatted code using the entire dialog space, in addition to viewing both contents in split mode.       &lt;br /&gt;&lt;strong&gt;Persistent Options&lt;/strong&gt; - any changes to the options are automatically stored in an external configuration file and reloaded on next execution.       &lt;br /&gt;&lt;strong&gt;View HTML&lt;/strong&gt; - you can view the HTML markup before inserting the code snippet.&lt;/p&gt;    &lt;p&gt;&lt;a name="101features"&gt;&lt;em&gt;&lt;strong&gt;Update (02/27/07): New features in version 1.0.1.&lt;/strong&gt;&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Compact Mode&lt;/strong&gt; - in addition to the Full Mode, you can now also work with a compact version of the dialog that allows you to quickly select the formatting options without a preview. Switching between Full and Compact Modes is quick and painless by pressing the &lt;strong&gt;F12&lt;/strong&gt; key. The following figure shows the Compact Mode dialog for the plugin.&lt;/p&gt;    &lt;p align="center"&gt;&lt;img alt="Code Snippet dialog - Compact Mode" src="http://blogs.incyclesoftware.com/lvildosola/images/csp4wlw/csdlg_compact.png" /&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Window Placement Persistence&lt;/strong&gt; - in addition to automatically storing formatting and other options, now the window location, size, and other characteristics are also remembered.       &lt;br /&gt;&lt;strong&gt;Copy CSS Style to Clipboard&lt;/strong&gt; - to make it easier to extract the stylesheet for inclusion in your blog's template, you can now easily copy the contents to the clipboard.&lt;/p&gt;    &lt;p&gt;&lt;a name="102features"&gt;&lt;strong&gt;&lt;em&gt;Update (03/26/07): New features in version 1.0.2.&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Support for CSS snippets&lt;/strong&gt; - Added support for syntax highlighting Cascading Style Sheets (CSS) snippets.       &lt;br /&gt;&lt;strong&gt;Embedded Styles Now Inline&lt;/strong&gt; - Changed implementation used for embedding styles from using the &lt;span class="code"&gt;class&lt;/span&gt; attribute to using the &lt;span class="code"&gt;style&lt;/span&gt; attribute. The former assumed embedding the stylesheet classes as part of the generated HTML for the code snippet. The latter uses inline definitions, which proves to be friendlier to RSS feeds and e-mail delivery where the embedded CSS is not recognized.&lt;/p&gt;    &lt;p&gt;&lt;a name="102features"&gt;&lt;strong&gt;&lt;em&gt;Update (03/16/09): New features in version 2.0.0.&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;    &lt;p&gt;Please refer to the CodePlex release page &lt;a title="Plugin Collection for Windows Live Writer" href="http://wlwplugincollection.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=9392" target="_blank"&gt;here&lt;/a&gt; for all the details.&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;a title="Code Snippet plugin for Windows Live Writer at Windows Live Gallery" href="http://gallery.live.com/liveItemDetail.aspx?li=d4409446-af7f-42ec-aa20-78aa5bac4748&amp;amp;l=8" target="_blank"&gt;Download Code Snippet plugin for Windows Live Writer v1.0.2&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;    &lt;p&gt;&lt;em&gt;&lt;a title="Code Snippet plugin for Windows Live Writer v2.0.0 - Preview at CodePlex" href="http://wlwplugincollection.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=9392" target="_blank"&gt;Download Code Snippet plugin for Windows Live Writer v2.0.0 - Preview&lt;/a&gt;&lt;/em&gt;&lt;/p&gt; &lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-4652121591317783859?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/4652121591317783859/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=4652121591317783859' title='109 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4652121591317783859'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4652121591317783859'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/02/code-snippet-plugin-for-windows-live.html' title='Code Snippet plugin for Windows Live Writer'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>109</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-2840745029108715642</id><published>2007-02-04T19:46:00.001-05:00</published><updated>2009-04-06T09:06:22.904-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>Improve performance when using WindowsTokenRoleProvider with lots of roles</title><content type='html'>&lt;span class="fullpost"&gt;   &lt;p&gt;This post got longer than anticipated. So, I broke it down into sections so you can dive right in.&amp;lt;/&amp;gt; You don't need to read the Preface section if you're already familiar with how ASP.NET 2.0 implements authentication/authorization.&lt;/p&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="#preface"&gt;Preface&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="#problem"&gt;Problem&lt;/a&gt; &lt;/li&gt;      &lt;li&gt;&lt;a href="#solution"&gt;Solution&lt;/a&gt; &lt;/li&gt;   &lt;/ul&gt;   &lt;a name="prepace"&gt;     &lt;h4&gt;Preface&lt;/h4&gt;   &lt;/a&gt;&lt;/span&gt;  &lt;p&gt;ASP.NET 2.0 has built-in support for Authentication and Authorization via its &lt;a title="ASP.NET 2.0 Provider Model: Introduction to the Provider Model" href="http://msdn2.microsoft.com/en-us/library/aa479030.aspx" target="_blank"&gt;Provider Model&lt;/a&gt;. It comes with ready-to-use classes for Integrated Windows Authentication and for role management via &lt;a title="WindowsTokenRoleProvider Class" href="http://msdn2.microsoft.com/en-us/library/system.web.security.windowstokenroleprovider.aspx" target="_blank"&gt;WindowsTokenRoleProvider&lt;/a&gt;. You can read &lt;a title="How To: Use Windows Authentication in ASP.NET 2.0" href="http://msdn2.microsoft.com/en-us/library/ms998358.aspx" target="_blank"&gt;this article&lt;/a&gt; for all the details on how to configure these and other providers to secure your application. This post is focusing only on authentication and authorization against Active Directory (AD).&lt;/p&gt; &lt;span class="fullpost"&gt;   &lt;p&gt;The short of securing your application is to add the following to your &lt;strong&gt;Web.config&lt;/strong&gt; file.&lt;/p&gt;    &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;authentication&lt;/span&gt; &lt;span style="color: #ff0000"&gt;mode&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Windows&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;roleManager&lt;/span&gt; &lt;span style="color: #ff0000"&gt;enabled&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;defaultProvider&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AspNetWindowsTokenRoleProvider&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

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

  &lt;div id="codeSnippetWrapper"&gt;
    &lt;br /&gt;&lt;/div&gt;

  &lt;p&gt;This will enable authentication using the user's current identity and authorization using the user's AD Group Memberships as the roles.&lt;/p&gt;

  &lt;p&gt;To ensure &lt;a title="Internet Information Services" href="http://www.microsoft.com/windowsserver2003/iis/default.mspx" target="_blank"&gt;IIS&lt;/a&gt; passes the user's identity to ASP.NET you need to enable it for the site by setting the Integrated Windows Authentication flag in the Authentication Methods dialog of the site properties Directory Security tab.&lt;/p&gt;

  &lt;p&gt;&lt;/p&gt;
  &lt;center&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="IIS Directory Security" src="http://blogs.incyclesoftware.com/images/auth_methods_dlg.jpg" width="401" height="480" /&gt;&lt;/center&gt;

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

  &lt;p&gt;Once authentication/authorization is enabled, ASP.NET will verify every HTTP request to ensure only allowed content is returned to the browser. It does this by checking the authorization rules you specify either in your &lt;strong&gt;Web.config&lt;/strong&gt; file on as part of a &lt;a title="How to: Add Simple Site Navigation" href="http://msdn2.microsoft.com/en-us/library/ms178418(vs.80).aspx" target="_blank"&gt;site map&lt;/a&gt; definition that has &lt;a title="ASP.NET Site-Map Security Trimming" href="http://msdn2.microsoft.com/en-us/library/ms178428(VS.80).aspx" target="_blank"&gt;trimming&lt;/a&gt; enabled.&lt;/p&gt;

  &lt;p&gt;Normally, the process of verifying access to different pages in you application will happen very fast. Nonetheless, you can release some of the burden of accessing AD for every request by enabling caching in the &lt;span class="code"&gt;&lt;a title="roleManager Element (ASP.NET Settings Schema)" href="http://msdn2.microsoft.com/en-us/library/ms164660.aspx" target="_blank"&gt;roleManager&lt;/a&gt;&lt;/span&gt;. To do this you can set the attribute &lt;span class="code"&gt;cacheRolesInCookie in the &lt;span class="code"&gt;roleManager&lt;/span&gt;&amp;#160;&lt;/span&gt;definition.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;roleManager&lt;/span&gt; &lt;span style="color: #ff0000"&gt;enabled&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;cacheRolesInCookie&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;defaultProvider&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AspNetWindowsTokenRoleProvider&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

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

  &lt;p&gt;This will store the roles for the logged in user in a cookie that gets sent back and forth between server and client and back.&lt;/p&gt;
  &lt;a name="problem"&gt;
    &lt;h4&gt;Problem&lt;/h4&gt;
  &lt;/a&gt;

  &lt;p&gt;As you may already know, &lt;a title="RFC 2109 - HTTP State Management Mechanism - 6.3  Implementation Limits" href="http://www.faqs.org/rfcs/rfc2109.html" target="_blank"&gt;cookies have a limit of 4096 bytes&lt;/a&gt;. If you enable caching in the &lt;span class="code"&gt;roleManager&lt;/span&gt; and your users have deeply nested group memberships in AD, this limit can be easily exhausted. The result is very slow performance even when caching is enabled.&lt;/p&gt;
  &lt;a name="solution"&gt;
    &lt;h4&gt;Solution&lt;/h4&gt;
  &lt;/a&gt;

  &lt;p&gt;One possible way to get around this limitation is to extend the default &lt;span class="code"&gt;WindowsTokenRoleProvider&lt;/span&gt; to &lt;a title="GotDotNet User Sample: ASP.NET 2.0 Compressed Http Cookies" href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=57B6D3F4-670D-478A-A5D2-BE87501A9E01" target="_blank"&gt;compress the contents of the cookie&lt;/a&gt;. The drawback I see with this approach is that the cookie is traveling back and forth from client to server to client and back. Another drawback is the fact that custom code to parse the contents of the cookie needs to be written in order to extract the roles before passing them to the base implementation.&lt;/p&gt;

  &lt;p&gt;My preferred solution still involves writing custom code, but not to parse any cookies. The implementation still extends the &lt;span class="code"&gt;WindowsTokenRoleProvider&lt;/span&gt;, but performs the caching on the server side instead, using the &lt;span class="code"&gt;&lt;a title="HttpContext.Cache Property" href="http://msdn2.microsoft.com/en-us/library/system.web.httpcontext.cache.aspx" target="_blank"&gt;HttpContext.Cache&lt;/a&gt;&lt;/span&gt; as shown in the following sample code.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Caching;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Security;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// Recommended namespace is YourApplication.Web.Security. Essentially create a project that&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// follows the same namespace naming conversion as ASP.NET but instead of System use your&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// application name.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; YouNamespace&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// Provides role information for an ASP.NET application from Windows group membership.&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// &amp;lt;remarks&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// Overriden to add proper caching of roles.&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #008000"&gt;/// &amp;lt;/remarks&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; WindowsTokenCachingRoleProvider : WindowsTokenRoleProvider&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// Required for provider model.&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; WindowsTokenCachingRoleProvider()&lt;br /&gt;        {&lt;br /&gt;        }&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// Gets a list of the Windows groups that a user is in.&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;username&amp;quot;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// The user to return the list of Windows groups for in the form DOMAIN\username.&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;returns&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// A string array containing the names of all the Windows groups that the specified&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// user is in.&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #008000"&gt;/// &amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] GetRolesForUser(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; username)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: #008000"&gt;// List of Windows groups for the given user.&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] roles;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #008000"&gt;// Create a key for the requested user.&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; cacheKey = username + &lt;span style="color: #006080"&gt;&amp;quot;:&amp;quot;&lt;/span&gt; + &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.ApplicationName;&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #008000"&gt;// Get the cache for the current HTTP request.&lt;/span&gt;&lt;br /&gt;            Cache cache = HttpContext.Current.Cache;&lt;br /&gt;            &lt;span style="color: #008000"&gt;// Attempt to fetch the list of roles from the cache.&lt;/span&gt;&lt;br /&gt;            roles = cache[cacheKey] &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[];&lt;br /&gt;            &lt;span style="color: #008000"&gt;// If the list is not in the cache we will need to request it.&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;null&lt;/span&gt; == roles)&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color: #008000"&gt;// Allow the base implementation to load the list of roles.&lt;/span&gt;&lt;br /&gt;                roles = &lt;span style="color: #0000ff"&gt;base&lt;/span&gt;.GetRolesForUser(username);&lt;br /&gt;                &lt;span style="color: #008000"&gt;// Add the resulting list to the cache.&lt;/span&gt;&lt;br /&gt;                cache.Insert(cacheKey, roles, &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;, Cache.NoAbsoluteExpiration,&lt;br /&gt;                    Cache.NoSlidingExpiration);&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            &lt;span style="color: #008000"&gt;// Return the resulting list of roles.&lt;/span&gt;&lt;br /&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; roles;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;

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

  &lt;p&gt;With this code in place, you can now replace the default &lt;span class="code"&gt;roleManager&lt;/span&gt; definition with the newly extended &lt;span class="code"&gt;WindowsTokenCachingRoleProvider&lt;/span&gt; by replacing the corresponding &lt;strong&gt;Web.config&lt;/strong&gt; file entry with the following.&lt;/p&gt;

  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 300px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;roleManager&lt;/span&gt; &lt;span style="color: #ff0000"&gt;enabled&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;true&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;defaultProvider&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AspNetWindowsTokenCachingRoleProvider&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;providers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;add&lt;/span&gt; &lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;AspNetWindowsTokenCachingRoleProvider&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;applicationName&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;/&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;YouNamespace.WindowsTokenCachingRoleProvider, YourAssembly&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;providers&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;roleManager&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

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

  &lt;p&gt;Using this method I have seen major improvements for those users who happen to be members of many AD groups.&lt;/p&gt;
&lt;/span&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-2840745029108715642?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/2840745029108715642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=2840745029108715642' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2840745029108715642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2840745029108715642'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/02/improve-performance-when-using.html' title='Improve performance when using WindowsTokenRoleProvider with lots of roles'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-4327991688772600095</id><published>2007-01-27T10:26:00.000-05:00</published><updated>2007-03-24T06:38:17.554-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>SQL-equivalent to NVL2</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:3bef369e-47a1-4063-886b-3c74dd5e2363" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type="text/javascript"&gt;&lt;!--
digg_title = 'SQL-equivalent to NVL2';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;I have been using T-SQL for as long as I can remember and one of the things I never found was an equivalent to Oracle's &lt;a href="http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/functions106.htm" target="_blank"&gt;&lt;span class="code"&gt;NVL2&lt;/span&gt;&lt;/a&gt;. Well, this time around I did not want to use a &lt;a href="http://msdn2.microsoft.com/en-us/library/ms181765.aspx" target="_blank"&gt;&lt;span class="code"&gt;CASE&lt;/span&gt;&lt;/a&gt; statement or even the more involved &lt;a href="http://msdn2.microsoft.com/en-us/library/ms190349.aspx" target="_blank"&gt;&lt;span class="code"&gt;COALESCE&lt;/span&gt;&lt;/a&gt;. I just needed a plain function that would evaluate &lt;i&gt;if the given expression is null return this otherwise return this&lt;/i&gt;.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;The following T-SQL function will provide the equivalent to &lt;span class="code"&gt;NVL2&lt;/span&gt;, or at least something close enough. The trick is to use the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms173829.aspx" target="_blank"&gt;&lt;span class="code"&gt;sql_variant&lt;/span&gt;&lt;/a&gt; data type.&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;IF&lt;/span&gt; &lt;span class="kwrd"&gt;EXISTS&lt;/span&gt; (&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; id&lt;br&gt;             &lt;span class="kwrd"&gt;FROM&lt;/span&gt; dbo.sysobjects&lt;br&gt;            &lt;span class="kwrd"&gt;WHERE&lt;/span&gt; id = OBJECT_ID(N&lt;span class="str"&gt;'[dbo].[isnull2]'&lt;/span&gt;)&lt;br&gt;              &lt;span class="kwrd"&gt;AND&lt;/span&gt; xtype &lt;span class="kwrd"&gt;in&lt;/span&gt; (N&lt;span class="str"&gt;'FN'&lt;/span&gt;, N&lt;span class="str"&gt;'IF'&lt;/span&gt;, N&lt;span class="str"&gt;'TF'&lt;/span&gt;))&lt;br&gt;&lt;span class="kwrd"&gt;BEGIN&lt;/span&gt;&lt;br&gt;    &lt;span class="kwrd"&gt;DROP&lt;/span&gt; &lt;span class="kwrd"&gt;FUNCTION&lt;/span&gt; [dbo].[isnull2]&lt;br&gt;&lt;span class="kwrd"&gt;END&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;GO&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;CREATE&lt;/span&gt; &lt;span class="kwrd"&gt;FUNCTION&lt;/span&gt; [dbo].[isnull2]&lt;br&gt;(&lt;br&gt;    @expression sql_variant,&lt;br&gt;    @return_if_null_value sql_variant,&lt;br&gt;    @return_if_not_null_value sql_variant&lt;br&gt;)&lt;br&gt;&lt;span class="kwrd"&gt;RETURNS&lt;/span&gt; sql_variant&lt;br&gt;&lt;span class="kwrd"&gt;AS&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;BEGIN&lt;/span&gt;&lt;br&gt;    &lt;span class="kwrd"&gt;DECLARE&lt;/span&gt; @&lt;span class="kwrd"&gt;return&lt;/span&gt; sql_variant;&lt;br&gt;    &lt;span class="kwrd"&gt;IF&lt;/span&gt; (@expression &lt;span class="kwrd"&gt;IS&lt;/span&gt; &lt;span class="kwrd"&gt;NULL&lt;/span&gt;)&lt;br&gt;        &lt;span class="kwrd"&gt;SET&lt;/span&gt; @&lt;span class="kwrd"&gt;return&lt;/span&gt; = @return_if_null_value&lt;br&gt;    &lt;span class="kwrd"&gt;ELSE&lt;/span&gt;&lt;br&gt;        &lt;span class="kwrd"&gt;SET&lt;/span&gt; @&lt;span class="kwrd"&gt;return&lt;/span&gt; = @return_if_not_null_value&lt;br&gt;    &lt;span class="kwrd"&gt;RETURN&lt;/span&gt; @&lt;span class="kwrd"&gt;return&lt;/span&gt;&lt;br&gt;&lt;span class="kwrd"&gt;END&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Please note that you will need to ensure you cast either the parameters you pass or the result to the desired type. This is specially true if you are calling the logic in a stored procedure or embedded query that is executed from a .NET or similar application via something like ADO.NET.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-4327991688772600095?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/4327991688772600095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=4327991688772600095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4327991688772600095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/4327991688772600095'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/01/sql-equivalent-to-nvl2.html' title='SQL-equivalent to NVL2'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1410597247241545505.post-2799934843336235557</id><published>2007-01-27T07:00:00.000-05:00</published><updated>2007-03-24T06:52:02.404-04:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='AJAX'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='How To'/><category scheme='http://www.blogger.com/atom/ns#' term='Extender'/><title type='text'>How to get the SmartAutoCompleteExtender to work with ASP.NET AJAX 1.0 RTM</title><content type='html'>&lt;span class="fullpost"&gt; &lt;div class="wlWriterSmartContent" id="B3E14793-948F-49af-A347-D19C374A7C4F:8b305ca3-c73a-4bdb-8f05-221f57998405" contenteditable="false" style="padding-right: 15px; display: inline; padding-left: 0px; float: left; padding-bottom: 0px; margin: 0px; padding-top: 5px"&gt; &lt;script type="text/javascript"&gt;&lt;!--
digg_title = 'How to get the SmartAutoCompleteExtender to work with ASP.NET AJAX 1.0 RTM';
digg_topic = 'programming';
//--&gt;&lt;/script&gt; &lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/div&gt;&lt;/span&gt; &lt;p&gt;If you are using the &lt;a href="http://weblogs.asp.net/infinitiesloop/archive/2006/11/15/ASP.NET-Ajax-Beta_3A00_-AutoCompleteBehavior-without-a-Web-Service.aspx" target="_blank"&gt;&lt;span class="code"&gt;SmartAutoCompleteExtender&lt;/span&gt;&lt;/a&gt; by &lt;a href="http://weblogs.asp.net/infinitiesloop/default.aspx" target="_blank"&gt;Infinities Loop&lt;/a&gt; with pre-release versions of Atlas, and you just upgraded to the new &lt;a href="http://ajax.asp.net/" target="_blank"&gt;ASP.NET AJAX 1.0 RTM&lt;/a&gt; release, you will have to make some minor changes to the &lt;span class="code"&gt;SmartAutoCompleteExtender&lt;/span&gt; code for it to work again.&lt;/p&gt;&lt;span class="fullpost"&gt; &lt;p&gt;&lt;b&gt;1.&lt;/b&gt; In the project where the &lt;span style="font-family: courier new"&gt;SmartAutoCompleteExtender&lt;/span&gt; resides, add a reference to the &lt;b&gt;AjaxControlToolkit.dll&lt;/b&gt; assembly. This is now required since the &lt;span style="font-family: courier new"&gt;AutoCompleteExtender&lt;/span&gt;, on which the &lt;span class="code"&gt;SmartAutoCompleteExtender&lt;/span&gt; is based, is now part of the &lt;a href="http://www.codeplex.com/AtlasControlToolkit" target="_blank"&gt;AJAX Control Toolkit&lt;/a&gt; project. &lt;a href="http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx" target="_blank"&gt;Download it&lt;/a&gt; and add a reference to its assembly in your own project(s). (&lt;i&gt;Thank you &lt;a href="http://weblogs.asp.net/infinitiesloop/default.aspx" target="_blank"&gt;Dave&lt;/a&gt; for reminding me!&lt;/i&gt;)&lt;/p&gt; &lt;p&gt;&lt;b&gt;2.&lt;/b&gt; In &lt;b&gt;SmartAutoCompleteBehavior.js&lt;/b&gt;, go to the end of the file and replace the last line with the following. Note the namespace of the base &lt;span class="code"&gt;AutoCompleteBehavior&lt;/span&gt; has changed.&lt;/p&gt; &lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;i88.UI.SmartAutoCompleteBehavior.registerClass(&lt;br&gt;    &lt;span class="str"&gt;'i88.UI.SmartAutoCompleteBehavior'&lt;/span&gt;,&lt;br&gt;    AjaxControlToolkit.AutoCompleteBehavior);&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;b&gt;3.&lt;/b&gt; In &lt;b&gt;SmartAutoCompleteExtender.cs&lt;/b&gt;, add a &lt;span class="code"&gt;using&lt;/span&gt; reference to the &lt;span class="code"&gt;AjaxControlToolkit&lt;/span&gt; namespace.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; AjaxControlToolkit;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;b&gt;4.&lt;/b&gt; In &lt;b&gt;SmartAutoCompleteExtender.cs&lt;/b&gt;, go to the method &lt;span class="code"&gt;GetScriptReferences()&lt;/span&gt; and change the first reference line with the following. Note the parameters to the call need to be changed.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;references.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; ScriptReference(&lt;br&gt;    &lt;span class="str"&gt;"AjaxControlToolkit.AutoComplete.AutoCompleteBehavior.js"&lt;/span&gt;,&lt;br&gt;    &lt;span class="str"&gt;"AjaxControlToolkit"&lt;/span&gt;));&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;5.&lt;/strong&gt; In &lt;b&gt;SmartAutoCompleteExtender.cs&lt;/b&gt;, go to the method &lt;span class="code"&gt;GetScriptDescriptors()&lt;/span&gt; and change the line containing &lt;span class="code"&gt;serviceURL &lt;/span&gt;to &lt;span class="code"&gt;servicePath&lt;/span&gt;.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(ServicePath))
{
    sbd.AddProperty(&lt;span class="str"&gt;"servicePath"&lt;/span&gt;, ResolveClientUrl(ServicePath));
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;b&gt;6.&lt;/b&gt; In &lt;b&gt;SmartAutoCompleteExtender.cs&lt;/b&gt;, go to the method &lt;span class="code"&gt;GetScriptDescriptors()&lt;/span&gt; and change the line containing &lt;span class="code"&gt;completionElementID&lt;/span&gt; to &lt;span class="code"&gt;completionList&lt;/span&gt;.&lt;/p&gt;
&lt;div class="csharpcode-wrapper"&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;if&lt;/span&gt; (!&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(CompletionListElementID))
{
    sbd.AddElementProperty(&lt;span class="str"&gt;"completionList"&lt;/span&gt;, CompletionListElementID);
}&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you made the necessary reference changes to the new assemblies and updated your Web.config you should be up and running in no time.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a class="download" title="Sample Visual Studio 2005 SP1 Web Application with SmartAutoCompleteExtender updated to RTM" onclick="javascript:urchinTracker('/downloads/SmartAutoCompleteExtender');" href="http://blogs.incyclesoftware.com/lvildosola/files/SmartAutoCompleteExtenderRTM.zip"&gt;Download sample VS2005 SP1 Web Application solution&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1410597247241545505-2799934843336235557?l=lvildosola.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://lvildosola.blogspot.com/feeds/2799934843336235557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1410597247241545505&amp;postID=2799934843336235557' title='62 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2799934843336235557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1410597247241545505/posts/default/2799934843336235557'/><link rel='alternate' type='text/html' href='http://lvildosola.blogspot.com/2007/01/how-to-get-smartautocompleteextender.html' title='How to get the SmartAutoCompleteExtender to work with ASP.NET AJAX 1.0 RTM'/><author><name>Leo Vildosola</name><uri>http://www.blogger.com/profile/08861276100179773020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>62</thr:total></entry></feed>
