<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>Aneef.Net</title>
	
	<link>http://www.aneef.net</link>
	<description>Do it in .Net way | Blogging about C#,ASP.Net, LINQ,WPF and .Net Technologies</description>
	<lastBuildDate>Wed, 11 Nov 2009 07:34:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Aneef" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>SCRUM- Quick Guide</title>
		<link>http://www.aneef.net/2009/11/11/scrum-quick-guide/</link>
		<comments>http://www.aneef.net/2009/11/11/scrum-quick-guide/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 07:32:23 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[Methodologies]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[SCRUM]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Youtube]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=111</guid>
		<description><![CDATA[I just thought to share this two videos i found in youtube, which is very useful for those who want to learn about SCRUM methodology, wikipedia: Scrum is an iterative incremental framework for managing complex work (such as new product development) commonly used with agile software development. for more info read here. 
SCRUM Basics by [...]]]></description>
			<content:encoded><![CDATA[<p>I just thought to share this two videos i found in youtube, which is very useful for those who want to learn about SCRUM methodology, <em>wikipedia: <strong>Scrum</strong> is an iterative incremental framework for managing complex work (such as new product development) commonly used with <a title="Agile software development" href="http://en.wikipedia.org/wiki/Agile_software_development">agile software development</a>. </em>for more info read <a href="http://en.wikipedia.org/wiki/Scrum_%28development%29" target="_blank">here</a>.<em> </em></p>
<p><strong>SCRUM Basics by Orjan Hillbom</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/vmGMpME_phg&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/vmGMpME_phg&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><strong>SCRUM in Under 10 Minutes (HD) by @hamids</strong></p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Q5k7a9YEoUI&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/Q5k7a9YEoUI&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>hope it helps.</p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=111&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/11/11/scrum-quick-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FCKEDitor – FIXED Image Upload dialog hang for .net</title>
		<link>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/</link>
		<comments>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 11:22:53 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[CKEditor]]></category>
		<category><![CDATA[Continous]]></category>
		<category><![CDATA[FCK Editor]]></category>
		<category><![CDATA[Image]]></category>
		<category><![CDATA[Progress]]></category>
		<category><![CDATA[Upload]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=107</guid>
		<description><![CDATA[Well This issue has been bugging alot of people around the net it seems. I&#8217;m one of the victim too *sigh*.. anways bianchi007, a member in the CKSource Site forums had posted a solution. thought it would be worth to share.
Here is the solution which was posted in this thread.
This is for the .net assembly [...]]]></description>
			<content:encoded><![CDATA[<p>Well This issue has been bugging alot of people around the net it seems. I&#8217;m one of the victim too *sigh*.. anways <a href="http://cksource.com/forums/memberlist.php?mode=viewprofile&amp;u=12108">bianchi007,</a> a member in the <a href="http://cksource.com/Forums/">CKSource </a>Site forums had posted a solution. thought it would be worth to share.</p>
<p>Here is the solution which was posted in <a href="http://cksource.com/forums/viewtopic.php?f=6&amp;t=12112&amp;p=36585&amp;hilit=image+upload#p36585">this thread</a>.</p>
<p>This is for the .net assembly 2_6_3. I based it on the help file <a href="http://dev.fckeditor.net/attachment/ticket/2115/2115.patch">http://dev.fckeditor.net/attachment/tic &#8230; 2115.patch</a></p>
<p>Steps:</p>
<p>Open the FredCK.FCKeditorV2.vs2005.csproj in Visual Studio 2005</p>
<p>Open the file FileBrowser &gt; FileWorkerBase.cs</p>
<p>Go to line 119</p>
<p>Replace: Response.Write( @&#8221;(function(){var d=document.domain;while (true){try{var A=window.top.opener.document.domain;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,&#8221;);if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();&#8221; );</p>
<p>Replace with: Response.Write(@&#8221;(function(){var d=document.domain;while (true){try{var A=window.parent.OnUploadCompleted;break;}catch(e) {};d=d.replace(/.*?(?:\.|$)/,&#8221;);if (d.length==0) break;try{document.domain=d;}catch (e){break;}}})();&#8221;);</p>
<p>Compile the project and then reference the new dll file in your project.</p>
<p>I hope it helps <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=107&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/09/25/fckeditor-fixed-image-upload-dialog-hang-for-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scott Guthrie Announces the WebsiteSpark Program</title>
		<link>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/</link>
		<comments>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 10:06:43 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[ScottGu]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[WebSpark]]></category>

		<guid isPermaLink="false">http://www.aneef.net/?p=104</guid>
		<description><![CDATA[Scott guthrie just did a great announcement about the WebsiteSpark Program.
what is WebsiteSpark?
WebsiteSpark is designed for independent web developers and web development companies that build web applications and web sites on behalf of others.  It enables you to get software, support and business resources from Microsoft at no cost for three years, and enables you [...]]]></description>
			<content:encoded><![CDATA[<p>Scott guthrie just did a great announcement about the <a href="http://www.microsoft.com/web/websitespark/">WebsiteSpark </a>Program.</p>
<p><strong>what is WebsiteSpark?</strong></p>
<p><span style="font-family: arial; font-size: x-small;"><a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> is designed for independent web developers and web development companies that build web applications and web sites on behalf of others.  It enables you to get software, support and business resources from Microsoft at no cost for three years, and enables you to expand your business and build great web solutions using ASP.NET, Silverlight, SharePoint and PHP, and the <a href="http://www.microsoft.com/web/gallery/default.aspx" target="_blank">open source applications</a> built on top of them.</p>
<h3><span style="text-decoration: underline;">What does the program provide?</span></h3>
<p><a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebSiteSpark</a> provides software licenses that you can use for three years at no cost.  Once enrolled, you can download and immediately use the following software from Microsoft:</p>
<ul>
<li>3 licenses of Visual Studio 2008 Professional Edition</li>
<li>1 license of Expression Studio 3 (which includes Expression Blend, Sketchflow, and Web)</li>
<li>2 licenses of Expression Web 3</li>
<li>4 processor licenses of Windows Web Server 2008 R2</li>
<li>4 processor licenses of SQL Server 2008 Web Edition</li>
<li>DotNetPanel control panel (enabling easy remote/hosted management of your servers)</li>
</ul>
<p>The Windows Server and SQL Server licenses can be used for both development <em>and</em> production deployment.  You can either self-host the servers on your own, or use the licenses with a hoster.  <a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> makes it easy to find hosters who are also enrolled in the program, and who can use your licenses to provide you with either dedicated or virtual dedicated servers to host your sites on.</p>
<p>In addition to software, <a href="http://www.microsoft.com/web/websitespark/" target="_blank">WebsiteSpark</a> provides partner opportunities to grow and build your business (including customer referrals through our partner programs).  It also includes product support (including 2 professional support incidents) and free online training for the products.</p>
<p>for further information on this visit Scotts blog <a href="http://weblogs.asp.net/scottgu/archive/2009/09/24/announcing-the-websitespark-program.aspx">here.</a></p>
<p>Thanks Scott for the great information <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p></span></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=104&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/09/24/scott-guthrie-announces-the-websitespark-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClickOnce Application,Expired Certificates &amp; Public Key Token PART III – 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 to target [...]]]></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>Request UAC Elevation for .net Application (Managed Code)</title>
		<link>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/</link>
		<comments>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:35:48 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[visual studio 2008]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[Application Manifest]]></category>
		<category><![CDATA[mt.exe]]></category>
		<category><![CDATA[Permission]]></category>
		<category><![CDATA[UAC]]></category>
		<category><![CDATA[User Account Control]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[WindowsPrincipal]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/</guid>
		<description><![CDATA[Its about time for us to get ready for Windows 7. and most of us have to develop applications compatible to Windows 7, Vista, and Server 2008. and sometimes we need applications to run with administrative privileges. and that&#8217;s not a big deal. but in these new Operating Systems, even an administrator is sometimes locked [...]]]></description>
			<content:encoded><![CDATA[<p>Its about time for us to get ready for <a href="http://www.microsoft.com/windows/windows-7/" target="_blank">Windows 7</a>. and most of us have to develop applications compatible to Windows 7, Vista, and Server 2008. and sometimes we need applications to run with administrative privileges. and that&#8217;s not a big deal. but in these new Operating Systems, even an administrator is sometimes locked by the <a href="http://en.wikipedia.org/wiki/User_Account_Control" target="_blank">UAC</a> when running some applications.</p>
<p>some applications might throw exceptions in such situation, when we need administrative privileges to do some task, if they don’t request for UAC elevation by the application. only option to make these application is to right click and select “Run as Administrator” to manually trigger UAC.</p>
<p>In this post I’m going to show how to request for UAC Elevation for a .net Application. this explains the use of <a href="http://msdn.microsoft.com/en-us/library/aa374191(VS.85).aspx" target="_blank">Application Manifests</a> that request the OS for UAC elevation. </p>
<p>&#160;</p>
<h2>Code</h2>
<p>I have my sample windows form C# Project with a single form that shows a message box on form load,showing whether you are an administrator or not.</p>
<p>&#160;</p>
<pre class="csharpcode">  <span class="kwrd">private</span> <span class="kwrd">void</span> Form1_Load(<span class="kwrd">object</span> sender, EventArgs e)
        {
         <span class="kwrd">bool</span> isAdmin = <span class="kwrd">new</span> WindowsPrincipal(WindowsIdentity.GetCurrent())</pre>
<pre class="csharpcode">                   .IsInRole(WindowsBuiltInRole.Administrator) ? <span class="kwrd">true</span> : <span class="kwrd">false</span>;

            <span class="kwrd">if</span>(isAdmin)
            {
                MessageBox.Show(<span class="str">&quot;you are an administrator&quot;</span>);
            }
            <span class="kwrd">else</span>
            {
                MessageBox.Show(<span class="str">&quot;You are not an administrator&quot;</span>);
            }
        }</pre>
<style type="text/css">
<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; }</style>
<p>&#160;</p>
<p>in the above code we use <a href="http://msdn.microsoft.com/en-us/library/system.security.principal.windowsprincipal.aspx" target="_blank">WindowsPrincipal</a> class, which allows us to check the Windows group membership of a Windows user. to use this classes un need to use the following namespace in the code:</p>
<pre class="csharpcode"><span class="kwrd">using</span> System.Security.Principal;</pre>
<pre class="csharpcode">&#160;</pre>
<p>when you compile this application and run , you would expect that it will show the message saying “you are an administrator” if you are logged in as an administrator account. well this is what you get if you have UAC enabled, not something you expected right ?</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb.png" width="221" height="156" /></a> </p>
<style type="text/css">
<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; }</style>
<p>ok now we need to make our application to request for UAC elevation.&#160; first we need to create a manifest file with the application name.</p>
<h2>Create Manifest File</h2>
<p>First add a new item to the project with the name with following format, &lt;applicationname&gt;.exe.manifest . in our case (ElevationTest.exe.manifest). and add the following XML:</p>
<pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;UTF-8&quot;</span> <span class="attr">standalone</span><span class="kwrd">=&quot;yes&quot;</span>?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">assembly</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;urn:schemas-microsoft-com:asm.v1&quot;</span> <span class="attr">manifestVersion</span><span class="kwrd">=&quot;1.0&quot;</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">assemblyIdentity</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0.0.0&quot;</span>  <span class="attr">name</span><span class="kwrd">=&quot;ElevationTest&quot;</span> <span class="attr">type</span><span class="kwrd">=&quot;win32&quot;</span><span class="kwrd">/&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">trustInfo</span> <span class="attr">xmlns</span><span class="kwrd">=&quot;urn:schemas-microsoft-com:asm.v3&quot;</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">security</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;</span><span class="html">requestedPrivileges</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">requestedExecutionLevel</span> <span class="attr">level</span><span class="kwrd">=&quot;requireAdministrator&quot;</span><span class="kwrd">/&gt;</span>
         <span class="kwrd">&lt;/</span><span class="html">requestedPrivileges</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;/</span><span class="html">security</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">trustInfo</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">assembly</span><span class="kwrd">&gt;</span></pre>
<p>&#160;</p>
<p>and the next step is to add the manifest in to the built executables Win32Resources by embedding it.&#160; to do this we need to use the MT.exe in the .Net SDK.&#160; by default it can be found in “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\”.</p>
<p>we can use the following command to embed the manifest through visual studio command line:</p>
<p><strong>mt.exe –manifest MyApp.exe.manifest -outputresource:MyApp.exe;1</strong> </p>
<p>or </p>
<p><strong>mt.exe –manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2</strong> </p>
<p>(1 for an EXE, 2 for a DLL.) </p>
<p>to make things easier we can add this command to the postbuild event of the project :</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb1.png" width="549" height="328" /></a><br />
<style type="text/css">
<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; }</style>
</p>
<p>below is the full&#160; post build command:</p>
<p>&quot;C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\mt.exe&quot; -manifest &quot;$(ProjectDir)$(TargetName).exe.manifest&quot;&#160; –outputresource:&quot;$(TargetDir)$(TargetFileName)&quot;;#1</p>
<p>once you have built the application successfully if you see the output directory you will see the icons will have a shield on them indicating that the application requires UAC elevation.</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb2.png" width="322" height="159" /></a> </p>
<p>And now if you run your built application it will prompt for UAC : and when you click on allow the application will show you the following Message : </p>
<p>&#160;</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/06/image3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.aneef.net/wp-content/uploads/2009/06/image_thumb3.png" width="199" height="156" /></a> </p>
<p>That’s it you have your application ready to request UAC Elevation in the new operating systems.</p>
<p>&#160;</p>
<p>hope it helps.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.aneef.net%2f2009%2f06%2f29%2frequest-uac-elevation-for-net-application-managed-code%2f"><img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.aneef.net%2f2009%2f06%2f29%2frequest-uac-elevation-for-net-application-managed-code%2f" /></a></p>
<p><!-- BEGIN SMOWTION TAG - 468x60 - aneef net: tecnologia - DO NOT MODIFY --><br />
<script type="text/javascript"><!--
smowtion_size = "468x60";
smowtion_section = "642940";
//-->
</script><br />
<script type="text/javascript" src="http://ads.smowtion.com/ad.js">
</script><br />
<!-- END SMOWTION TAG - 468x60 - aneef net: tecnologia - DO NOT MODIFY --></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=87&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/06/29/request-uac-elevation-for-net-application-managed-code/feed/</wfw:commentRss>
		<slash:comments>5</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 important issue, [...]]]></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>3</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 the application [...]]]></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>
		<item>
		<title>PDB Files: What Every Developer Must Know</title>
		<link>http://www.aneef.net/2009/05/13/pdb-files-what-every-developer-must-know/</link>
		<comments>http://www.aneef.net/2009/05/13/pdb-files-what-every-developer-must-know/#comments</comments>
		<pubDate>Wed, 13 May 2009 05:20:46 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[.Net Related]]></category>
		<category><![CDATA[Debugging]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/05/13/pdb-files-what-every-developer-must-know/</guid>
		<description><![CDATA[This is just a link post for the post below:
PDB Files: What Every Developer Must Know
This Morning Merill  twitted a link on his twitter, for this valuable post about PDB Files by John Robbins. honestly I didn&#8217;t know much about the importance of PDB files until I read this. 
I  think each .Net Developer must read [...]]]></description>
			<content:encoded><![CDATA[<p><strong>This is just a link post for the post below:</strong></p>
<p><a href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx" target="_blank">PDB Files: What Every Developer Must Know</a></p>
<p>This Morning <a href="http://www.merill.net" target="_blank">Merill</a>  twitted a link on his <a href="http://twitter.com/merill" target="_blank">twitter</a>, for this valuable post about PDB Files by <a href="http://www.wintellect.com/CS/blogs/jrobbins/default.aspx">John Robbins</a>. honestly I didn&#8217;t know much about the importance of PDB files until I read this. </p>
<p>I  think each .Net Developer must read the post <a href="http://www.wintellect.com/CS/blogs/jrobbins/archive/2009/05/11/pdb-files-what-every-developer-must-know.aspx" target="_blank">here</a>.</p>
<p>Thanks Jhon For the information, and merill for sharing this <img src='http://www.aneef.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=66&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/05/13/pdb-files-what-every-developer-must-know/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AirTel Sri Lanka – HSDPA a Fake Promise</title>
		<link>http://www.aneef.net/2009/04/30/airtel-sri-lanka-hsdpa-a-fake-promise/</link>
		<comments>http://www.aneef.net/2009/04/30/airtel-sri-lanka-hsdpa-a-fake-promise/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:24:12 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/04/30/airtel-sri-lanka-hsdpa-a-fake-promise/</guid>
		<description><![CDATA[Well I just don’t want to write a review on a network provider in a blog dedicated for .net programming, but I think its a MUST to write, so that my readers, and friends are aware of the problem with Airtel HSDPA Data Connection. 
Well here are the specs and packages for their data connection [...]]]></description>
			<content:encoded><![CDATA[<p>Well I just don’t want to write a review on a network provider in a blog dedicated for .net programming, but I think its a MUST to write, so that my readers, and friends are aware of the problem with Airtel HSDPA Data Connection. </p>
<p>Well here are the specs and packages for their data connection Airtel provided:</p>
<p><a href="http://www.airtel.lk"><img src="http://tbn0.google.com/images?q=tbn:y8rgK0qL2Pi4kM:http://www.bakulfoundation.org/Airtel.jpg" /></a></p>
<blockquote><p><strong>Package Details:</strong> </p>
<p>Limited: 1 GB for Rs.300 + Tax     <br />3 GB for Rs.600 + Tax </p>
<p>Unlimited: for Rs.1499 + Tax </p>
<p><strong>Tax rates:</strong> </p>
<p>VAT (Value Added Tax) = 16.67%     <br />MSL (Mobile Subscriber Levy) = 11.11%      <br />ECL (Environmental Subscriber Levy) = 2%      <br />Total: 29.78% </p>
<p><strong>Do they offer promised speed?</strong> </p>
<p>This a question that there is no direct answer, for the unlimited package they said they offer 3.2mbps (409.6KB/s) As far as I know, people experience around 100 &#8211; 250Kb/s! </p>
<p><strong>Is there any limits like Fair User Policy?</strong>      <br />No, Its 100% unlimited </p>
</blockquote>
<p>I Purchased the Unlimited Package, and the much hyped First month the connectivity was ok, connecting around 320 KB/s , but from february 2009, the culprit shows its real face. the connection is as low as 13 KB/s (yeah i understand as slow as the dialup connections in old days). i called their customer care service and the only reply i got from them is this :</p>
<blockquote><p><em>“I’m very sorry for the inconvenience caused sir, but we are doing some upgrade process these days, and it will be fixed very soon”</em></p>
</blockquote>
<p>Poor me, believed them, and until this moment I’m writing this post, the connection wasn’t&#160; fixed. i have called them with patience several times, and all the times I’ve got various responses from the customer care agents who had very less knowledge on the technology, which is irrelevant to the issue, and one of them were not at all caring what the customers problem was. most of the time the agents said their superior will call me back on the next morning, and non of the called me, and whatever the complaint numbers they give me is closed by them without resolution each time, whenever i call and ask about the complaint number. the above quoted text is the answer. one of them mentioned that the entire Internet is only 1MB/s and their connectivity is 3.2 MB/s . and the Internet is slow because its slower than their connectivity!?? . i hope non of you techies and geeks will agree with this (yeah can see some of you laugh ROFL) . </p>
<p>One Airtel agent mentioned that their ISP’s are full and needs time to upgrade, yeah its understandable, but is that a problem for a consumer who still pays the full amount for the service? we can bare with this for a week or two, but more than a month, ARE YOU KIDDING ME? . they should have planned well and done these to handle the amount of users, now their are doing their maintenance with the cost of many users money, and time.</p>
<p>Another thing i found with them is that a single connection through <a href="http://www.internetdownloadmanager.com/">Internet download Manager</a> was connecting around 13-20 KB/s , even to download a 10 MB file i had to wait more than 20 minutes, and also if i tried a concurrent download of 10 files at the same time, and each file was downloading in that speed, consuming a total bandwidth of 1MB or more. and non of the agents were able to explain me why is this happening.</p>
<p>And frustrated me, sent an email about this problem to <a href="mailto:555@airtel.lk">555@airtel.lk</a> which is their customer care email, and is said that it will be responding within few days, responded after 14 days i sent the email, with the following reply. see how responsible Airtel is about their customer problems.</p>
<p><a href="http://www.aneef.net/wp-content/uploads/2009/04/capture.jpg" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Capture" border="0" alt="Capture" src="http://www.aneef.net/wp-content/uploads/2009/04/capture-thumb.jpg" width="555" height="187" /></a> </p>
<p> Yeah they sent an email on 23rd of April saying that the issue will be resolved on&#160; 17th of April 2009, as per to my knowledge 17th comes before 23rd not after right?, correct me if I’m wrong guys ROFL.&#160; and when i just called them and asked about this, guess what again the reply was the above quoted text, and a silence (poor agents I’m sure its not their faults, but they are the person we can communicate to Airtel right), and again the issue was never solved!?.</p>
<p>I think if Airtel is willing to maintain the hype it made when it launched in Sri Lanka, and the Reputation of Airtel Organization, it needs to consider about waiving off the monthly charge they charged for the month cycles March, and April from their data package customers, Isn’t it unfair to charge the customer for their mistakes, and for a service which didn’t serve its promise???</p>
<p>Friends in Sri Lanka, think twice before you select this Data connection, it might look like wonder when you start using it initially, but its NOT!!!!. its just an ILLUSION. I’m just posting this because i don’t want any of you guys to waste your valuable time, and money with a bad service which i experienced.</p>
<p>I think i would rather upgrade my DSL line with the <a href="http://www.slt.lk">SLT</a>, rather than wasting my time with Airtel Anymore. even though DSL was slower than 3.2 MB/s, it never failed its promised bandwidth!!.</p>
<p>And my Final verdict:</p>
<blockquote><p> Airtel HSDPA Data Connection = a Fake Promise</p>
</blockquote>
<p>P.S : oh yeahh i just found that they’ve (Airtel)&#160; removed the data connection details from their <a href="http://www.airtel.lk">website</a>. <img src='http://www.aneef.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=64&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/04/30/airtel-sri-lanka-hsdpa-a-fake-promise/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>ASP.Net 3.5  ListView Control and Book Flip effect</title>
		<link>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/</link>
		<comments>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 08:28:54 +0000</pubDate>
		<dc:creator>Aneef Fashir</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Tricks & Tips]]></category>

		<guid isPermaLink="false">http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/</guid>
		<description><![CDATA[one of the coolest control in ASP.Net 3.5 is its Listview Control. its too CSS friendly, and we can use it to achieve many great content presentations. if you go to scottgu&#8217;s blog you can find some good articles on how to use the listview control. 






recently I did such an implementation. its using the [...]]]></description>
			<content:encoded><![CDATA[<p>one of the coolest control in ASP.Net 3.5 is its <a href="http://msdn.microsoft.com/en-us/library/bb398790.aspx" target="_blank">Listview</a> Control. its too CSS friendly, and we can use it to achieve many great content presentations. if you go to scottgu&#8217;s blog you can find some good articles on <a href="http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx" target="_blank">how to use the listview control</a>. </p>
<p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:84c1fa9b-1ab9-4cb7-bd88-7865eb5324e1" class="wlWriterSmartContent">
<div id="120aa13c-244b-4179-b933-42a7c1ab72ae" style="margin: 0px; padding: 0px; display: inline;">
<div><a href="http://www.youtube.com/watch?v=nNnk9chiriU" target="_new"><img src="http://www.aneef.net/wp-content/uploads/2009/04/video83c3c0ada8e7.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('120aa13c-244b-4179-b933-42a7c1ab72ae'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/nNnk9chiriU\&quot;&gt;&lt;\/param&gt;&lt;param name=\&quot;wmode\&quot; value=\&quot;transparent\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/nNnk9chiriU\&quot; type=\&quot;application/x-shockwave-flash\&quot; wmode=\&quot;transparent\&quot; width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt=""></a></div>
</div>
</div>
<p>recently I did such an implementation. its using the <a href="http://www.coastworx.com/bookflip.php" target="_blank">javascript bookflip.</a> a great work by <a href="http://coastworx.com/contact.php" target="_blank">Will</a> (very kind of him to share this to the world). I used the his code, and ListView to achieve a dynamic bookflip.&nbsp; apart from the javascript changes,&nbsp; here is the change I did for the Listview markup.</p>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode">&nbsp;</pre>
<pre class="csharpcode"> <span class="kwrd">&lt;</span><span class="html">asp:ListView</span> <span class="attr">id</span><span class="kwrd">="ImageFlip"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="attr">ItemPlaceholderID</span><span class="kwrd">="ItemContainer"</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">id</span><span class="kwrd">="myBook"</span> <span class="attr">style</span><span class="kwrd">="width: &lt;%# flipWidth*2 %&gt;px; height:</span></pre>
<pre class="csharpcode"><span class="kwrd"> &lt;%# flipHeight %&gt;px; position: relative; z-index: 5;"</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">asp:PlaceHolder</span> <span class="attr">ID</span><span class="kwrd">="ItemContainer"</span>  <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">style</span><span class="kwrd">="border: 0px solid #ddd;
    text-align: center;
    padding-top: 100px;
    margin: 0px;
    height: 0px;
    text-align:inherit;
    background-color: #ffffff;
 color: #cf0000;vertical-align:bottom"</span> <span class="attr">Name</span><span class="kwrd">="Back"</span> <span class="kwrd">&gt;</span> </pre>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="spongebob300/bk.jpg"</span>  <span class="attr">border</span><span class="kwrd">="0"</span> <span class="attr">usemap</span><span class="kwrd">="#Map"</span> <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>

      <span class="kwrd">&lt;/</span><span class="html">div</span> <span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">LayoutTemplate</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>

   <span class="kwrd">&lt;</span><span class="html">div</span> <span class="attr">style</span><span class="kwrd">="background:#ffffff ;color:#ffffff;</span></pre>
<pre class="csharpcode"><span class="kwrd"> cursor:url(ajax/zoom-in.cur),auto; z-index:-&lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;;"</span> </pre>
<pre class="csharpcode"><span class="attr">name</span><span class="kwrd">="Page &lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;"</span> <span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">a</span> <span class="attr">href</span><span class="kwrd">="Javascript:getFullImage(&lt;%#Eval("</span><span class="attr">ID</span><span class="kwrd">") %&gt;)"</span> <span class="kwrd">&gt;</span></pre>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="&lt;%#Eval("</span><span class="attr">FlipImage</span><span class="kwrd">") %&gt;"</span> <span class="attr">alt</span><span class="kwrd">="Page &lt;%#Eval("</span><span class="attr">PAGENO</span><span class="kwrd">") %&gt;"</span> </pre>
<pre class="csharpcode">  <span class="attr">border</span><span class="kwrd">="0"</span> <span class="attr">style</span><span class="kwrd">="cursor:url(ajax/zoom-in.cur),auto;"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">a</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">asp:ListView</span><span class="kwrd">&gt;</span>
</pre>
<pre class="csharpcode">&nbsp;</pre>
<p>And the Data Retrieval is just as simple as the following 3 lines:</p>
<div class="csharpcode">
<pre class="alt">DataTable dt = db.getFlipPage(catid);</pre>
<pre>ImageFlip.DataSource = dt;</pre>
<pre class="alt">ImageFlip.DataBind();</pre>
</div>
<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>And that&#8217;s all. very easy isn&#8217;t it. for the real implementation of this go to <a href="http://www.catalogues4u.com.au">www.catalogues4u.com.au</a> and click on a catalogue.In that site I have also implemented a carousel using Listview.&nbsp; hope it helps.</p>
<pre class="csharpcode">&nbsp;</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><br/><br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.aneef.net%2f2009%2f04%2f16%2faspnet-35-listview-control-and-book-flip-effect%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.aneef.net%2f2009%2f04%2f16%2faspnet-35-listview-control-and-book-flip-effect%2f" border="0" alt="kick it on DotNetKicks.com" /></a><br />
<br/><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3530459083226419";
/* linksonly */
google_ad_slot = "6143752371";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script><br/><br />
<script type="text/javascript"><!--
google_ad_client = "pub-3530459083226419";
//468x60, created 12/20/07
google_ad_slot = "4319330936";
google_ad_width = 468;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<img src="http://www.aneef.net/?ak_action=api_record_view&id=56&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://www.aneef.net/2009/04/16/aspnet-35-listview-control-and-book-flip-effect/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
