<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Aneef.Net &#187; ClickOnce</title>
	<atom:link href="http://www.aneef.net/tag/clickonce/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aneef.net</link>
	<description>Do it in .Net way &#124; Blogging about C#,ASP.Net, LINQ,WPF and .Net Technologies</description>
	<lastBuildDate>Mon, 24 May 2010 10:50:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART III &#8211; Pushing .net Framework 3.5</title>
		<link>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/</link>
		<comments>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 11:33:24 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[Tricks & Tips]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[.Net Installation.]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Check .Net Framework]]></category>
		<category><![CDATA[Registry]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/</guid>
		<description><![CDATA[In the last few weeks I wrote 2 articles on how to resolve ClickOnce certificate expiration issues. you can find those articles here : ClickOnce Application,Expired Certificates &#38; Public Key Token PART I ClickOnce Application,Expired Certificates &#38; Public Key Token PART II During my work on this ClickOnce update, we decided to upgrade the application [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few weeks I wrote 2 articles on how to resolve ClickOnce certificate expiration issues. you can find those articles here :</p>
<ol>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/">ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</a>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/">ClickOnce Application,Expired Certificates &amp; Public Key Token PART II</a> </li>
</ol>
<ol>During my work on this ClickOnce update, we decided to upgrade the application to target .net framework 3.5 sp1.</ol>
<ol>so I just set the target framework to 3.5 and set the required prerequisites (.net 3.5 SP1, and Windows Installer 3.1). and built the project and published it. and when I tried on a client machine which had .net framework 2.0, application got updated, prompted the uninstall message, and tried to launch the new ClickOnce application from the new URL, and BANG!. we get an error :</ol>
<ol><a href="http://www.aneef.net/wp-content/uploads/2009/07/image001.jpg"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image001" src="http://www.aneef.net/wp-content/uploads/2009/07/image001_thumb.jpg" width="286" height="142"></a></ol>
<ol>The Error Message Says :</ol>
<blockquote><p>Unable to install or run the application. The application</p>
<p>requires that assembly WindowsBase Version 3.0.0.0 be</p>
<p>installed in the Global Assembly Cache (GAC) first.</p>
</blockquote>
<p>Why is this ?, its because when we try to launch the new application URL we do this :</p>
<pre>DeploymentUtils.AutoInstall("&lt;Path toNewApplication.application&gt;");</pre>
<pre>&nbsp;</pre>
<p>we request for the application manifest. and it fails to launch the application because it doesn&#8217;t have the prerequisites. and now to force the new prerequisites the application should call the setup.exe in the Web Server instead of the manifest. now the question is, what if the user already have&nbsp; the .net Framework 3.5 SP1?, we don&#8217;t have to prompt the client to install them again by launching setup.exe, we just have to launch the manifest. To Serve both the above scenario we need to check if the client machine has .net framework 3.5 SP1, and depending on its availability we need to launch the manifest or the setup.exe. The existence of .net Framework can be obtained from the following registry location: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP <a href="http://www.aneef.net/wp-content/uploads/2009/07/image.png"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/07/image_thumb.png" width="544" height="216"></a> you can find out all the .net Frameworks installed and their service pack versions in this registry entry. Following are the locations of the main Net Frameworks:</p>
<table border="0" cellspacing="0" cellpadding="2" width="540">
<tbody>
<tr>
<td valign="top" width="128">Framework 1.1</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v1.1.4322</td>
</tr>
<tr>
<td valign="top" width="128">Framework 2.0</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727</td>
</tr>
<tr>
<td valign="top" width="128">Framework 3.0</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v3.0\\Setup</td>
</tr>
<tr>
<td valign="top" width="128">Framework 3.5</td>
<td valign="top" width="411">Software\\Microsoft\\NET Framework Setup\\NDP\\v3.5</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<p>Now we can check if the required .net Framework is available in the client machine, and launch the application setup.exe or the manifest. to do this we need to programmatically check these registries. for this I used the attached code ( I Couldn&#8217;t find the original author, Credits goes to him/her) which I found from web and modified to avoid few bugs. you can add this code to your project and do the below check in your application to decide which file to be launched :</p>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode"><span class="kwrd">string</span> FileToLaunch=<span class="str">@"/setup.exe"</span>;
<span class="kwrd">if</span> (FrameworkUtils.IsInstalled(FrameworkVersion.Fx35)

 &amp;&amp; FrameworkUtils.GetServicePackLevel(FrameworkVersion.Fx35) == 1)
          {
            FileToLaunch = <span class="str">@"/&lt;application manifest.application&gt;"</span>;
          }
            MessageBox.Show(<span class="str">"Your message here"</span>);
            <span class="kwrd">string</span> updateURL = DeploymentUtils.getUpdateURL();
            DeploymentUtils.UninstallMe();
            DeploymentUtils.AutoInstall(<span class="str">"https://"</span> + updateURL + FileToLaunch);
            Application.Exit();</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<pre class="csharpcode">&nbsp;</pre>
<p>And that&#8217;s all, now the application will launch the setup.exe if the client doesn&#8217;t have the .net Framework 3.5 and prompt for its installation, or launch the application manifest if client has the framework installed.</p>
<p>Now you can solve your ClickOnce issue as well as upgrade .net Framework in client machine at the same time without problem.</p>
<p><a href="wp-content/uploads/2009/07/FrameworkUtil.cs.txt">Download FrameworkUtils.cs</a></p>
<p><!-- .csharpcode, .csharpcode pre { 	font-size: small; 	color: black; 	font-family: consolas, "Courier New", courier, monospace; 	background-color: #ffffff; 	/*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt  { 	background-color: #f4f4f4; 	width: 100%; 	margin: 0em; } .csharpcode .lnum { color: #606060; } --></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=97&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/07/09/clickonce-applicationexpired-certificates-public-key-token-part-iii-pushing-net-framework-3-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART II</title>
		<link>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/</link>
		<comments>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 10:40:36 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Public Token Key]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/</guid>
		<description><![CDATA[In the first part of this series I wrote the possible solutions available for the ClicOnce certificate issue. if you have missed it please read it before continuing. ClickOnce Application,Expired Certificates &#38; Public Key Token PART I This post is not going to be a long one, I&#160; just want to point out a very [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">first part</a> of this series I wrote the possible solutions available for the ClicOnce certificate issue. if you have missed it please read it before continuing.</p>
<ol>
<ol>
<ul>
<li><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</a></li>
</ul>
<ul>This post is not going to be a long one, I&nbsp; just want to point out a very important issue, when updating the ClickOnce using the method specified in <a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/" target="_blank">PART I</a> . </ul>
<ul>When using <a href="http://www.jamesharte.com/blog/?p=11" target="_blank">Jim Harte&#8217;s</a> Method to update a ClickOnce with a new certificate, it checks for the public token key of the current application to find its uninstall string, and then execute runDLL32 to trigger the uninstall. below is the code which gets the uninstall string:</ul>
<ul></ul>
<ol>
<pre class="csharpcode"><span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Gets the uninstall string for the current ClickOnce app from the Windows </span>
<span class="rem">/// Registry.</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="rem">/// &lt;param name="PublicKeyToken"&gt;The public key token of the app.&lt;/param&gt;</span>
<span class="rem">/// &lt;returns&gt;The command line to execute that will uninstall the app.&lt;/returns&gt;</span>
 <span class="kwrd">private</span> <span class="kwrd">static</span> <span class="kwrd">string</span> GetUninstallString(<span class="kwrd">string</span> PublicKeyToken,</pre>
<pre class="csharpcode">                          <span class="kwrd">out</span> <span class="kwrd">string</span> DisplayName)
{
 <span class="kwrd">string</span> uninstallString = <span class="kwrd">null</span>;
 <span class="kwrd">string</span> searchString = <span class="str">"PublicKeyToken="</span> + PublicKeyToken;
 RegistryKey uninstallKey = _
      Registry.CurrentUser.OpenSubKey</pre>
<pre class="csharpcode">                (<span class="str">"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"</span>);
 <span class="kwrd">string</span>[] appKeyNames = uninstallKey.GetSubKeyNames();
 DisplayName = <span class="kwrd">null</span>;
 <span class="kwrd">foreach</span>(<span class="kwrd">string</span> appKeyName <span class="kwrd">in</span> appKeyNames)
{
  RegistryKey appKey = uninstallKey.OpenSubKey(appKeyName);
  uninstallString = (<span class="kwrd">string</span>)appKey.GetValue(<span class="str">"UninstallString"</span>);
  DisplayName = (<span class="kwrd">string</span>)appKey.GetValue(<span class="str">"DisplayName"</span>);
  appKey.Close();

 <span class="kwrd">if</span>(uninstallString.Contains(searchString))
                    <span class="kwrd">break</span>;
 }
            uninstallKey.Close();
            <span class="kwrd">return</span> uninstallString;
        }</pre>
<pre class="csharpcode">&nbsp;</pre>
<p>&nbsp;</p>
<p>In the above code it goes through registry keys of all ClickOnce application to get the uninstall string. and if that uninstall string contains the Public Token key of the current application, it will uninstall the application with that particular uninstall string. this is completely ok if there is only one application with that public token key. <strong>the public key of an assembly name identifies the developer (or the organization). Most organizations use only one public key to sign their assemblies with</strong>. so what if there is more than 1 application which has the same public token key?</p>
</ol>
<li>The code will uninstall the very first match in the above code and it might uninstall some other application, instead of uninstalling the one we need to uninstall.
<li>and it will&nbsp; also install the new application from new URL, but with a different name sometimes (Eg: application name -1).
<li>And if it had uninstalled another application, whenever user launches this application it will prompt the uninstall screen, each time when there are more than 1 application with the same public token key.</li>
</ol>
</ol>
<p>The Image below shows an uninstall string, which contains the application name, and public token key:</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/debug.jpg"><img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" border="0" alt="debug" src="http://www.aneef.net/wp-content/uploads/2009/06/debug-thumb.jpg" width="558" height="102"></a> </p>
<p>To avoid this problem of wrong application getting uninstalled, I changed this part of the code from above code to :</p>
<pre class="csharpcode"><span class="kwrd">if</span>(uninstallString.Contains(searchString)) <span class="kwrd">break</span>; </pre>
<p><style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</p>
<p>this:</p>
<pre class="csharpcode"><span class="kwrd">if</span>(uninstallString.Contains(searchString)
               &amp;&amp; uninstallString.Contains(<span class="str">"yourApp.application"</span>))
                    <span class="kwrd">break</span>;</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<ol>
<ol>
<ol>
<p>&nbsp;</p>
<p>In the code above, I&#8217;m Checking the ClickOnce application name with extension, along with the public token key to find out the correct uninstall string. that&#8217;s it!. </p>
<p>Hope this solves your time in someway. </p>
<p><style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
</p>
</ol>
</ol>
</ol>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=73&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART I</title>
		<link>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/</link>
		<comments>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 09:05:36 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ClickOnce]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[.Net Framework]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[thawte]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[verisign]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VS2008]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/</guid>
		<description><![CDATA[Well, by this time I&#8217;m sure most of the ClickOnce application developers are aware of this problem. if you aren&#8217;t here is a basic description of what the problem is: Problem description ClickOnce allows application updates, only if the updated application manifests are signed with the same certificate (publisher) as was used to originally sign [...]]]></description>
			<content:encoded><![CDATA[<p>Well, by this time I&#8217;m sure most of the ClickOnce application developers are aware of this problem. if you aren&#8217;t here is a basic description of what the problem is:</p>
<blockquote style="width: 85%; height: 285px"><p><strong>Problem description</strong></p>
<p>ClickOnce allows application updates, only if the updated application manifests are signed with the same certificate (publisher) as was used to originally sign the application manifests. However, most CA&#8217;s like Verisign, and many enterprise customers own CA&#8217;s generate new certificates with new key pairs and only the same common name (CN). </p>
<p>The certificate is used for the Authenticode signature element and for the strong name signature element of the manifest file to protect it against tampering, and to provide identity information for the trust manager. If the signing certificate expires and you publish an application update with a renewed certificate which has different keys, then the update will fail with the error message described in the <a href="http://support.microsoft.com/kb/925521/en-us" target="_blank">KB article.</a></p>
</blockquote>
<p>&nbsp;</p>
<p>There are lots of issues, and threads are being discussed how to resolve this issue. and these are the preferable solutions available on net.</p>
<ol>
<li>Manually Uninstall and Re install the application with new certificate &#8211; which we cannot do when we have a large number of client base who are using our ClickOnce Applicaiton.
<li>Install .net Framework 2.0 SP1 for XP /&nbsp; .Net Framework 3.5 SP1 for vista or later, in these service pack s for .net Framework, this bug is fixed, and it will seamlessly update the application. &#8211; but we cannot force or inform clients to do that. yeah by this time most of the users might have installed .net framework 3.5 sp1 through windows automatic updates. but even if one guy haven&#8217;t done that KABOOM!!, clients are going to complain.
<li>Sign the new click once with 2 different keys &#8211; a solution by <a href="http://blogs.msdn.com/danielma/contact.aspx">Daniel Margetic</a> , even though developers may like it, when considering Automation, and&nbsp; Infrastructure of build servers this might not be a favorite solution.
<li>Automatically Uninstalling the old application, and re-install the new application. &#8211; a solution by <a href="http://www.jamesharte.com/blog/?p=11" target="_blank">Jim Harte</a> , using this method, we will be releasing an update for the application with expired certificate, which will have scripts for automatically uninstall the applicaiton, and install the application with new certificate, from a new location. the following thread on MSDN explains this process completely: <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1217520d-6dc4-4fb1-83d1-0fa148d60e5d" target="_blank">VS2008 SP-1 change certificate, user can&#8217;t pick up update</a> </p>
<p>The last one seems to be a favorite of most of the people around the globe. it uses <a href="http://www.jamesharte.com/downloads/ClickOnceReinstall.zip" target="_blank">these classes</a> by&nbsp; Jim Harte&nbsp; to uninstall and re install the application, using the following code: </li>
</ol>
<pre class="csharpcode">MessageBox.Show(<span class="str">"Your Message to Client"</span>);
DeploymentUtils.UninstallMe()
DeploymentUtils.AutoInstall(<span class="str">"&lt;Path toNewApplication.application&gt;"</span>);
Application.Exit();</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&nbsp;</p>
<p>you can have the new path as a sub folder of current applications update URL. you can get a ClickOnce applicaitons update URL using the line below :</p>
<pre class="csharpcode">ApplicationDeployment.CurrentDeployment.UpdateLocation.Host</pre>
<style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
<p><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>That would do the trick. so what is it about Public Token Key ??. I will explain this in the PART 2 of this article.</p>
<p>Hope it helps,</p>
<p>Aneef</p>
<p><strong>I just posted the Part II of this series is </strong><a href="http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-ii/"><strong>here</strong></a><strong>.</strong></p>
<p><strong>Special Note:</strong></p>
<p>Thanks to <a href="http://robindotnet.wordpress.com/" target="_blank">RobinDotNet</a> for his wonderful support through MSDN and through his blog to solve this problem.</p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=69&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/11/clickonce-applicationexpired-certificates-public-key-token-part-i/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
