<?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; thawte</title>
	<atom:link href="http://www.aneef.net/tag/thawte/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 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>
