<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6277951066083602277</id><updated>2011-11-27T17:05:57.534-08:00</updated><category term='Microsoft AJAX Library'/><category term='Microsoft'/><category term='OSLO'/><category term='installation'/><category term='Performance'/><category term='INDIGO'/><category term='web'/><category term='.Net'/><category term='SQL Server'/><category term='dotnetnuke'/><category term='how to'/><category term='CTP'/><category term='WINFX'/><category term='aspnetmvc'/><category term='LIST VIEW'/><category term='WF'/><category term='WSDL'/><category term='dnn'/><category term='APPLICATION'/><category term='tips'/><category term='IIS6'/><category term='linked'/><category term='training'/><category term='WAS'/><category term='seo tips'/><category term='WSDualHttpBinding'/><category term='DATA BINDING'/><category term='tutotial'/><category term='.NET 4.0 2010'/><category term='videos'/><category term='Atlas'/><category term='IIS'/><category term='VIRTUAL DIRECTORY'/><category term='GRID'/><category term='learn'/><category term='seo'/><category term='ORCASA'/><category term='Double identities'/><category term='WCF'/><category term='SVC'/><category term='.NET 4.0'/><category term='dot net nuke'/><category term='HTML'/><category term='asp.net'/><category term='seach engine'/><category term='IIS7'/><category term='project'/><category term='JavaScript'/><category term='HOSTING'/><category term='WCF WebHost'/><category term='WPF'/><title type='text'>Kaushik Rabadiya</title><subtitle type='html'>Software Developer,Web Developer,SEO</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>44</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-5614745082273640658</id><published>2008-12-06T11:59:00.000-08:00</published><updated>2008-12-06T12:00:22.361-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='seo'/><category scheme='http://www.blogger.com/atom/ns#' term='seach engine'/><category scheme='http://www.blogger.com/atom/ns#' term='seo tips'/><title type='text'>8 simple SEO tips for blogs</title><content type='html'>&lt;span class="Apple-style-span" style="color: rgb(68, 68, 68); font-family: 'Lucida Grande'; font-size: 12px; line-height: 21px; "&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Follow these simple rules for &lt;a href="http://www.johntp.com/2006/04/21/8-simple-seo-tips-for-blogs/#" class="kLink" target="undefined" id="KonaLink0" style="position: static; color: rgb(34, 119, 221) !important; text-decoration: underline; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; background-position: initial initial !important; "&gt;&lt;span style="color: rgb(34, 119, 221) !important; font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color:#27d;"&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;search &lt;/span&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;engine &lt;/span&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;optimization&lt;/span&gt;&lt;/span&gt;&lt;span id="preLoadWrap0" style="position: relative; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/span&gt;&lt;/a&gt; and your blog will rank much higher in Search Engines.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;&lt;span id="more-195" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;/span&gt;&lt;/p&gt;&lt;ol style="margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 35px; "&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Use your primary keyword in your blog domain&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;The first thing to do is to ensure that your blogs URL contains the primary keyword you want to optimize for. Using the targeted keyword in subdomains also helps.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;For example, if you want to start a HTML tutorial site then the primary keyword you want your URL to contain is html. So choose a URL like www.htmlhelp.com.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;You can also use the keyword in subdomains like www.web-design.com/htmlhelp&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Use your primary keyphrase in the title of your posts&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;If your primary key phrase is html help make sure that the word html and help appear in your blog headers such as H1 and H2 tags as well as the title of each of your posts.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Use your secondary keywords in the body of your post&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;If you want to get listed for secondary keywords use them infrequently in the body of your post. The theory is that the more times a keyword appears within a Webpage, the more relevant the page is likely to be for someone searching those keywords.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;But do not overdo this by repeating the same keywords over and over again. &lt;a href="http://www.johntp.com/2006/04/21/8-simple-seo-tips-for-blogs/#" class="kLink" target="undefined" id="KonaLink1" style="position: static; color: rgb(34, 119, 221) !important; text-decoration: underline; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; background-position: initial initial !important; "&gt;&lt;span style="color: rgb(34, 119, 221) !important; font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color:#27d;"&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;Google&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; bots can find out if a keyword is too frequent on a page and might just remove your site from their index.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Use your keywords in the anchor text of links&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Use your primary and secondary keywords in the anchor text of links when linking to other blog posts or to other pages of your blog. Keyword in links have more importance than simple text.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Make sure search engines can spider your blog easily&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Make sure your navigation bar is present on all pages of your blog. Your previous posts or atleast the popular ones should be linked to all pages so they get spidered easily.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Get backlinks from other blogs&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;You need as many links as possible to link back to your posts or blog because it will help you build pagerank and get your blog to rank higher in &lt;a href="http://www.johntp.com/2006/04/21/8-simple-seo-tips-for-blogs/#" class="kLink" target="undefined" id="KonaLink2" style="position: static; color: rgb(34, 119, 221) !important; text-decoration: underline; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; background-position: initial initial !important; "&gt;&lt;span style="color: rgb(34, 119, 221) !important; font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color:#27d;"&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;search &lt;/span&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;engines&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;. The more links you have the higher your blog is ranked in &lt;a href="http://www.technorati.com/" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(34, 119, 221); text-decoration: none; "&gt;Technorati&lt;/a&gt; helping your blog to be found easily.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;So how do you get backlinks?&lt;/p&gt;&lt;ul style="list-style-image: url(http://www.johntp.com/wp-content/themes/johntpv3/images/arrow.png); margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 35px; "&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;The first thing to do to get high-quality links is to submit your blog and RSS feed to blog search engines and directories.&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Start by submitting your blog to all the directories listed on this page:&lt;br /&gt;&lt;a href="http://www.masternewmedia.org/rss/top55/" title="Best Blog Directory And RSS Submission Sites" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(34, 119, 221); text-decoration: none; "&gt;http://www.masternewmedia.org/rss/top55/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Link exchanging with other similarly-themed blogs will help you to form richly interlinked networks or communities.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;If you find an interesting article on another blog, link to it generously. The trackback will become a link back to your blog.&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Lastly posting legitimate comments in response to posts on other blogs will help you get backlinks. Regularly post legitimate comments in similarly-themed blogs with high traffic to get many backlinks.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Update your blog frequently&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Update your blog frequently using all the rules mentioned above and your blog will surely get top rankings in a short time.&lt;/p&gt;&lt;/li&gt;&lt;li style="list-style-type: decimal; list-style-position: outside; list-style-image: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 3px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;&lt;strong style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Stick with your blog&lt;/strong&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Once you start posting on your blog, stick with the same &lt;a href="http://www.johntp.com/2006/04/21/8-simple-seo-tips-for-blogs/#" class="kLink" target="undefined" id="KonaLink3" style="position: static; color: rgb(34, 119, 221) !important; text-decoration: underline; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-bottom-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-repeat: initial !important; background-attachment: initial !important; -webkit-background-clip: initial !important; -webkit-background-origin: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; background-position: initial initial !important; "&gt;&lt;span style="color: rgb(34, 119, 221) !important; font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color:#27d;"&gt;&lt;span class="kLink" style="font-family: 'Lucida Grande'; font-weight: normal; font-size: 12px; position: static; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(34, 119, 221); background-image: none; background-repeat: initial; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; background-position: initial initial; "&gt;domain&lt;/span&gt;&lt;/span&gt;&lt;/a&gt; or you could end up losing a lot of your traffic and regular readers.&lt;/p&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;Also stick with the topic you selected for your blog. If it’s about pets don’t suddenly switch to another topic such as Gadget’s because you will loose traffic.&lt;/p&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 13px; margin-right: 0px; margin-bottom: 13px; margin-left: 0px; "&gt;For tips on building traffic to your blog, read the series- &lt;a href="http://www.johntp.com/2006/03/24/how-to-increase-your-blogs-traffic-part1/" title="A series on how to increase your blog's traffic" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; color: rgb(34, 119, 221); text-decoration: none; "&gt;How to increase your blogs traffic&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-5614745082273640658?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/5614745082273640658/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=5614745082273640658' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5614745082273640658'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5614745082273640658'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/8-simple-seo-tips-for-blogs.html' title='8 simple SEO tips for blogs'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-3440925734617230685</id><published>2008-12-06T03:24:00.000-08:00</published><updated>2008-12-06T03:26:11.682-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft AJAX Library'/><category scheme='http://www.blogger.com/atom/ns#' term='Atlas'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML'/><title type='text'>Instantiating components on template markup</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Tahoma; font-size: 15px; "&gt;&lt;p&gt;All client-side template engines enable you to create HTML (feel free to go ‘duh’). What they don’t &lt;em&gt;all&lt;/em&gt; allow is the creation of event handlers and components over the markup they generate. The general approach with those engines is to do a second pass of code over the markup to create handlers and components. This is quite unfortunate as this generally requires some knowledge of the markup (which plays against separation of concerns) or something like the introduction of marker CSS classes into the markup.&lt;/p&gt;&lt;p&gt;For our own template engine, we wanted event handler creation and component instantiation to be first class scenarios, and we wanted both to be possible from imperative code as well as declarative code.&lt;/p&gt;&lt;h3&gt;Imperative code blocks&lt;/h3&gt;&lt;p&gt;Let’s start with the imperative approach. The template engine enables the introduction of code blocks right inside the template and also exposes a $element that is a reference to the last created element from the point in the template where it is referenced. So a first approach might be to just hook events and create components from there. Sure enough, that works:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue; "&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;img sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;id&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ $id('photo') }}"      &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;src&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ 'Images/' + Photo }}"      &lt;/span&gt;&lt;span style="color: red; "&gt;alt&lt;/span&gt;&lt;span style="color: blue; "&gt;="{binding FirstName}" /&gt; &lt;/span&gt;&lt;span style="color: green; "&gt;&lt;!--* $addHandler($element, "click", function() {     alert("You clicked " + FirstName + "'s photo."); }); *--&gt; &lt;/span&gt;&lt;span style="color: blue; "&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;br &lt;/span&gt;&lt;span style="color: blue; "&gt;/&gt; &lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;input &lt;/span&gt;&lt;span style="color: red; "&gt;type&lt;/span&gt;&lt;span style="color: blue; "&gt;="text" &lt;/span&gt;&lt;span style="color: red; "&gt;id&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ $id('firstName') }}"        &lt;/span&gt;&lt;span style="color: red; "&gt;class&lt;/span&gt;&lt;span style="color: blue; "&gt;="editInPlace name"        &lt;/span&gt;&lt;span style="color: red; "&gt;value&lt;/span&gt;&lt;span style="color: blue; "&gt;="{binding FirstName}" /&gt; &lt;/span&gt;&lt;span style="color: green; "&gt;&lt;!--* $create(Bleroy.Sample.EditInPlace,     { cssClass: "editing" }, {}, {}, $element); *--&gt; &lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;p&gt;Please note that the comment-based code block syntax is on its way out and will be replaced in the next preview with an attribute-based alternative. I will give more details when that is available. Suffice it to say for now that this mixing of component instantiation code into markup is not what we intended code blocks for. Code blocks are there to make simple scenarios like conditional rendering and looping over markup as easy as possible.&lt;/p&gt;&lt;h3&gt;Unobtrusive and imperative&lt;/h3&gt;&lt;p&gt;The better imperative approach looks very much like how you would do things outside of a template if you’re into unobtrusive JavaScript. The way you add event handlers and components over the page’s markup is by subscribing to some page ready event (pageLoad or Sys.Application.add_init in Microsoft Ajax, $(document).ready in jQuery). From that handler, you query the DOM for specific elements and add event handlers and components on those.&lt;/p&gt;&lt;p&gt;To do the same over a template, you handle the itemCreated event of DataView, query the DOM that was just created for the data item and then add event handlers and components.&lt;/p&gt;&lt;p&gt;One problem with repeating markup is to create unique IDs for the generated elements. This is relevant to the problem at hand because referencing elements by ID is by far the most common way. Wouldn’t it be nice to be able to just use getElementByID? Well, in client templates, we provide you with an easy way to both generate unique IDs and to reference elements by ID.&lt;/p&gt;&lt;p&gt;Unique IDs can be generated by the $id function that is part of the execution environment of templates (along with $dataItem, $element, etc.). $id takes a string parameter, which is an ID that is unique &lt;em&gt;within the template&lt;/em&gt;, and combines it with the current data item’s index to generate an ID that can be unique within the page:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue; "&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;img sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;id&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ $id('photo') }}" &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;src&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ 'Images/' + Photo }}"      &lt;/span&gt;&lt;span style="color: red; "&gt;alt&lt;/span&gt;&lt;span style="color: blue; "&gt;="{binding FirstName}" /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;p&gt;To reference those elements -even if you don’t know the pattern $id uses to globalize the id-, you can use the getElementById method that is provided by the template context, which is conveniently available from the event arguments of itemCreated:&lt;/p&gt;&lt;pre class="code"&gt;args.get_templateContext().getElementById(&lt;span style="color: rgb(163, 21, 21); "&gt;"photo"&lt;/span&gt;)&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;p&gt;Here’s what the code to add an event handler and a behavior looks like:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue; "&gt;function &lt;/span&gt;onItemCreated(sender, args) {     &lt;span style="color: blue; "&gt;var &lt;/span&gt;context = args.get_templateContext(),         dataItem = args.get_dataItem();     $addHandler(context.getElementById(&lt;span style="color: rgb(163, 21, 21); "&gt;"photo"&lt;/span&gt;), &lt;span style="color: rgb(163, 21, 21); "&gt;"click"&lt;/span&gt;, &lt;span style="color: blue; "&gt;function&lt;/span&gt;() {         alert(&lt;span style="color: rgb(163, 21, 21); "&gt;"You clicked " &lt;/span&gt;+ dataItem.FirstName + &lt;span style="color: rgb(163, 21, 21); "&gt;"'s photo."&lt;/span&gt;);     });     $create(Bleroy.Sample.EditInPlace,            { cssClass: &lt;span style="color: rgb(163, 21, 21); "&gt;"editing" &lt;/span&gt;}, {}, {},            context.getElementById(&lt;span style="color: rgb(163, 21, 21); "&gt;"firstName"&lt;/span&gt;)); }&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;p mce_keep="true"&gt; &lt;/p&gt;&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: there is a known bug in Preview 3 that prevents getElementByID from working correctly outside of IE. We fixed that bug already for the next preview.&lt;/p&gt;&lt;h3&gt;Fully declarative&lt;/h3&gt;&lt;p&gt;Of course, if you prefer a fully declarative approach, we allow that too. The template engine understands DOM-0 event handlers in pretty much the same way that the browser does outside templates (we tried to apply the principle of least surprise here). This means that if you specify for example an onclick attribute on an element, it is understood as a string that is the source code for the body of a function that will act as a handler for the click event. The template engine also supports binding expressions on attributes and this is no exception. That means that you can actually &lt;em&gt;build&lt;/em&gt; that string expression that will become the body of the handler dynamically using the current data item:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue; "&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;img sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;id&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ $id('photo') }}" &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;src&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ 'Images/' + Photo }}" &lt;/span&gt;&lt;span style="color: red; "&gt;  alt&lt;/span&gt;&lt;span style="color: blue; "&gt;="{binding FirstName}" &lt;/span&gt;&lt;span style="color: red; "&gt;  onclick&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{'alert(\'You clicked '+FirstName+'\\\'s photo.\');'}}"/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;p&gt;&lt;strong&gt;Important note:&lt;/strong&gt; you should be super-careful about building such handler strings on the fly with embedded data: there is potential for injection here, if the FirstName data came from the user or an uncontrolled source. In a real application, you'd want to encode FirstName to escape any quotes. You may use&lt;a href="http://msdn.microsoft.com/en-us/library/bb383793.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb383793.aspx" style="color: rgb(221, 74, 33); "&gt;Sys.Serialization.JavaScriptSerializer.serialize&lt;/a&gt;(FirstName) for example. &lt;/p&gt;&lt;p&gt;Then, to instantiate the components, you can use &lt;a href="http://quickstarts.asp.net/previews/ajax/templates/createajaxdataviewtemplate.aspx" mce_href="http://quickstarts.asp.net/previews/ajax/templates/createajaxdataviewtemplate.aspx" style="color: rgb(221, 74, 33); "&gt;our declarative syntax&lt;/a&gt; (which will also be the subject of a future post):&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: blue; "&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;input &lt;/span&gt;&lt;span style="color: red; "&gt;type&lt;/span&gt;&lt;span style="color: blue; "&gt;="text" &lt;/span&gt;&lt;span style="color: red; "&gt;id&lt;/span&gt;&lt;span style="color: blue; "&gt;="{{ $id('firstName') }}" &lt;/span&gt;&lt;span style="color: red; "&gt;class&lt;/span&gt;&lt;span style="color: blue; "&gt;="editInPlace name"        &lt;/span&gt;&lt;span style="color: red; "&gt;value&lt;/span&gt;&lt;span style="color: blue; "&gt;="{binding FirstName}"        &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;sys&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;attach&lt;/span&gt;&lt;span style="color: blue; "&gt;="inplace" &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); "&gt;inplace&lt;/span&gt;&lt;span style="color: blue; "&gt;:&lt;/span&gt;&lt;span style="color: red; "&gt;cssclass&lt;/span&gt;&lt;span style="color: blue; "&gt;="editing"/&gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste" style="color: rgb(221, 74, 33); "&gt;&lt;/a&gt;&lt;h3&gt;Conclusion&lt;br /&gt;&lt;/h3&gt;&lt;p&gt;There are plenty of options to add event handlers and components over template-generated markup in Microsoft Ajax, catering to different coding styles, but we hope we succeeded in keeping the system as simple as possible while keeping all relevant scenarios possible.&lt;/p&gt;&lt;p&gt;Download the full code fro the demo here: &lt;br /&gt;&lt;a title="http://weblogs.asp.net/blogs/bleroy/Samples/EventsAndBehaviorsInTemplates.zip" href="http://weblogs.asp.net/blogs/bleroy/Samples/EventsAndBehaviorsInTemplates.zip" mce_href="http://weblogs.asp.net/blogs/bleroy/Samples/EventsAndBehaviorsInTemplates.zip" style="color: rgb(221, 74, 33); "&gt;http://weblogs.asp.net/blogs/bleroy/Samples/EventsAndBehaviorsInTemplates.zip&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-3440925734617230685?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/3440925734617230685/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=3440925734617230685' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/3440925734617230685'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/3440925734617230685'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/instantiating-components-on-template.html' title='Instantiating components on template markup'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-731986008020025934</id><published>2008-12-06T03:19:00.000-08:00</published><updated>2008-12-06T03:20:16.251-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS6'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='aspnetmvc'/><title type='text'>ASP.NET MVC on IIS 6 Walkthrough</title><content type='html'>&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Trebuchet MS'; font-size: 13px; line-height: 20px; "&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;I’ve seen a lot of reports where people have trouble getting &lt;a title="ASP.NET MVC Website" href="http://asp.net/mvc" style="color: rgb(208, 48, 16); "&gt;ASP.NET MVC&lt;/a&gt; up and running on IIS 6. Sometimes the problem is a very minor misconfiguration, sometimes it’s a misunderstanding of how IIS 6 works.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;In this post, I want to provide a definitive guide to getting ASP.NET MVC running on IIS 6. I will walk through using the &lt;em&gt;.mvc &lt;/em&gt;or &lt;em&gt;.aspx&lt;/em&gt; file extension for URLs first, then I will walkthrough using extension-less URLs.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;If you’re running into problems with IIS 6 and ASP.NET MVC, I recommend trying to walk through all the steps in this post, even if you’re not interested in using the &lt;em&gt;.mvc &lt;/em&gt;or&lt;em&gt; .aspx&lt;/em&gt; mapping. Some of the lessons learned here have more to do with how ASP.NET itself works with IIS 6 than anything specific to ASP.NET MVC.&lt;/p&gt;&lt;h2 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Initial Setup&lt;/h2&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;To make this easy, start Visual Studio and create a new &lt;em&gt;ASP.NET MVC Web Application Project &lt;/em&gt;on the machine with IIS 6. If your IIS 6 machine is on a different machine, you can skip this step. We can deploy the site to the machine later.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;After you create the project, right click the project and select &lt;em&gt;Properties&lt;/em&gt;. The project properties editor will open up. Select the &lt;em&gt;Web&lt;/em&gt; tab and select&lt;em&gt;Use IIS Web Server. &lt;/em&gt;Click on the image for a full size view.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;a href="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/01-project-properties_4.png" rel="lightbox" style="color: rgb(208, 48, 16); "&gt;&lt;img title="Project Properties Editor" border="0" alt="Project Properties Editor" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/01-project-properties_thumb_1.png" width="554" height="471" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;In the project URL, I gave it a virtual application name of &lt;em&gt;Iis6DemoWeb&lt;/em&gt; and then checked &lt;em&gt;Create Virtual Directory&lt;/em&gt;. A dialog box should appear and you should now have an IIS virtual application (note this is different than a virtual directory, as indicated by the gear looking icon) under your Default Web Site.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="IIS 6 Virtual Web Application" border="0" alt="IIS 6 Virtual Web Application" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/02-iis6demoweb-iis_5.png" width="390" height="455" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;h2 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Using a URL File Extensions&lt;/h2&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;When you run the ASP.NET MVC installer, it will set up an ISAPI mapping in IIS 6 to map the &lt;em&gt;.mvc&lt;/em&gt; extension to the &lt;em&gt;aspnet_isapi.dll&lt;/em&gt;. This is necessary in order for IIS to hand off requests using the &lt;em&gt;.mvc&lt;/em&gt; file extension to ASP.NET.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;If you’re planning to use extension-less URLs, you can skip this section, but it may be useful to read anyways as it has some information you’ll need to know when setting up extension-less URLs.&lt;/p&gt;&lt;h3 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Mapping .mvc to ASP.NET&lt;/h3&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;If you plan to use the &lt;em&gt;.mvc&lt;/em&gt; URL extension, and are going to deploy to IIS 6 on a machine that does not have ASP.NET MVC installed, you’ll need to create this mapping by performing the following steps.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;One nice benefit of using the &lt;em&gt;.aspx&lt;/em&gt; extension instead of &lt;em&gt;.mvc&lt;/em&gt; is that you don’t have to worry about mapping the &lt;em&gt;.aspx&lt;/em&gt; extension. It should already be mapped assuming you have ASP.NET installed properly on the machine.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;For the rest of you, start by right clicking on the &lt;em&gt;Virtual Application&lt;/em&gt; node (&lt;em&gt;IIS6DemoWeb&lt;/em&gt; in this case) and select &lt;em&gt;Properties&lt;/em&gt;. You should see the following dialog.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="Website Properties" border="0" alt="Website Properties" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/virtual-directory-tab_3.png" width="476" height="460" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Make sure you’re on the &lt;em&gt;Virtual Directory&lt;/em&gt; tab and select &lt;em&gt;Configuration&lt;/em&gt;. Note that you can also choose to make this change on the root website, in which case the tab you’re looking for is &lt;em&gt;Home Directory&lt;/em&gt; not &lt;em&gt;Virtual Directory&lt;/em&gt;.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;This will bring up the &lt;em&gt;Application Configuration&lt;/em&gt; dialog which displays a list of ISAPI mappings. Scroll down to see if .mvc is in the list.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="application mappings" border="0" alt="application mappings" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/application-mappings_3.png" width="410" height="452" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;In the screenshot, you can see that &lt;em&gt;.mvc&lt;/em&gt; is in the list. If it is in the list on your machine, you can skip ahead to the next section. If it’s not in the list for you, let’s add it to the list. You’re going to need to know the path to the aspnet_isapi.dll first. On my machine, it is:&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;strong&gt;c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll&lt;/strong&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;It might differ on your machine. One easy way to find out is to find the .aspx extension in the list and double click it to bring up the mapping dialog.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="extension mapping" border="0" alt="extension mapping" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/08-extension-mapping_3.png" width="432" height="246" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Now you can copy the path in the &lt;em&gt;Executable&lt;/em&gt; text box to your clipboard. This is the path you’ll want to map .mvc to.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Click Cancel to go back to the &lt;em&gt;Application Configuration&lt;/em&gt; dialog and then click &lt;em&gt;A&lt;u&gt;dd&lt;/u&gt; &lt;/em&gt;which will bring up an empty &lt;em&gt;Add/Edit Application Extension Mapping dialog&lt;/em&gt;.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Fill in the fields with the exact same values as you saw for .aspx, except the extension should be “&lt;em&gt;.mvc&lt;/em&gt;” without the quotes. Click &lt;em&gt;OK&lt;/em&gt; and you’re done with the mapping.&lt;/p&gt;&lt;h2 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Specifying Routes with an Extension&lt;/h2&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Before we run the application, we need to update the default routes to look for the file extension we chose, whether it be &lt;em&gt;.mvc&lt;/em&gt; or &lt;em&gt;.aspx&lt;/em&gt; extension. Here is the &lt;code&gt;RegisterRoutes&lt;/code&gt; method in my &lt;em&gt;Global.asax.cs&lt;/em&gt; file using the &lt;em&gt;.mvc&lt;/em&gt;extension. If you want to use the &lt;em&gt;.aspx &lt;/em&gt;extension, just replace&lt;code&gt;{controller}.mvc&lt;/code&gt; with &lt;code&gt;{controller}.aspx&lt;/code&gt;.&lt;/p&gt;&lt;div class="dropshadow code" style="float: left; clear: left; background-image: url(http://haacked.com/images/shadow.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; width: 550px; background-position: 100% 100%; "&gt;&lt;div class="innerbox" style="position: relative; bottom: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(153, 153, 153); border-right-color: rgb(153, 153, 153); border-bottom-color: rgb(153, 153, 153); border-left-color: rgb(153, 153, 153); padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; display: block; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); "&gt;&lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;public&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;static&lt;/span&gt; &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;void&lt;/span&gt; RegisterRoutes(RouteCollection routes) {   routes.IgnoreRoute(&lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"{resource}.axd/{*pathInfo}"&lt;/span&gt;);    routes.MapRoute(     &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"Default"&lt;/span&gt;,     &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"{controller}.mvc/{action}/{id}"&lt;/span&gt;,     &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;new&lt;/span&gt; { action = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"Index"&lt;/span&gt;, id = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;""&lt;/span&gt; }   );    routes.MapRoute(     &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"Root"&lt;/span&gt;,     &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;""&lt;/span&gt;,     &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;new&lt;/span&gt; { controller = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"Home"&lt;/span&gt;, action = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;"Index"&lt;/span&gt;, id = &lt;span class="str" style="color: rgb(0, 96, 128); "&gt;""&lt;/span&gt; }   ); }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class="clear" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; clear: both; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Note that because the second route, “Default”, has a literal extension as part of the URL segment, it cannot match a request for the application root. That’s why I have a third route named “Root” which can match requests for the application root.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Now, I can hit CTRL+F5 (or browse my website) and I should see the following home page.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="Home Page" border="0" alt="Home Page" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/03-home-page_3.png" width="543" height="440" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;And about page.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="About Page" border="0" alt="About Page" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/04-about-page_3.png" width="518" height="402" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Notice that the URLs contain the &lt;em&gt;.mvc&lt;/em&gt; extension.&lt;/p&gt;&lt;h3 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Uh oh, Houston! We have a problem&lt;/h3&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Of course, you’re going to want to be able to navigate to the web root for your project. Notice what happens when you navigate to &lt;em&gt;/Iis6DemoWeb&lt;/em&gt;.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="Root Home Page" border="0" alt="Root Home Page" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/05-home-page_3.png" width="517" height="427" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;This is a bug in the &lt;em&gt;Default.aspx.cs&lt;/em&gt; file included with our default template which I discovered as I was writing this walkthrough. We’ll fix it right away, but I can provide the fix here as it’s insanely easy.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;em&gt;Note: If you received a File Not Found error when visiting the root, then you might not have Default.aspx mapped as a default document. &lt;a title="Setting up Default Documents" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/dc6eb1b4-9028-4308-9935-52b64edfad36.mspx?mfr=true" style="color: rgb(208, 48, 16); "&gt;Follow these steps&lt;/a&gt; to add Default.aspx as a default document.&lt;/em&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;As &lt;a title="Routing Changes" href="http://haacked.com/archive/2008/04/10/upcoming-changes-in-routing.aspx" style="color: rgb(208, 48, 16); "&gt;I’ve written before&lt;/a&gt;, this file is necessary for IIS 6, IIS 7 Classic Mode, and pre SP1 Cassini, but not IIS 7 Integrated. So if you’re using Cassini with Visual Studio 2008 SP1 and deploying to IIS 7 Integrated, you can delete &lt;em&gt;Default.aspx&lt;/em&gt;and its sub-files.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;In the meanwhile, the fix is to make the following change.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Change:&lt;/p&gt;&lt;div class="dropshadow code" style="float: left; clear: left; background-image: url(http://haacked.com/images/shadow.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; width: 550px; background-position: 100% 100%; "&gt;&lt;div class="innerbox" style="position: relative; bottom: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(153, 153, 153); border-right-color: rgb(153, 153, 153); border-bottom-color: rgb(153, 153, 153); border-left-color: rgb(153, 153, 153); padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; display: block; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); "&gt;HttpContext.Current.RewritePath(Request.ApplicationPath);&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class="clear" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; clear: both; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;To&lt;/p&gt;&lt;div class="dropshadow code" style="float: left; clear: left; background-image: url(http://haacked.com/images/shadow.gif); background-repeat: no-repeat; background-attachment: initial; -webkit-background-clip: initial; -webkit-background-origin: initial; background-color: initial; margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 5px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; display: block; width: 550px; background-position: 100% 100%; "&gt;&lt;div class="innerbox" style="position: relative; bottom: 6px; right: 6px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(153, 153, 153); border-right-color: rgb(153, 153, 153); border-bottom-color: rgb(153, 153, 153); border-left-color: rgb(153, 153, 153); padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; display: block; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(255, 255, 255); "&gt;HttpContext.Current.RewritePath(Request.ApplicationPath, &lt;span class="kwrd" style="color: rgb(0, 0, 255); "&gt;false&lt;/span&gt;);&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p class="clear" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; clear: both; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;If you created your website in the IIS root rather than a virtual application, you would never have noticed this issue. But in the virtual application, the URL to the stylesheet rendered contained the virtual application name, when it shouldn’t. Changing the second argument to false fixes this.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;/p&gt;&lt;h2 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;IIS6 Extension-less URLs&lt;/h2&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Ok, now we’re ready to try this with extension-less URLs using the infamous “Star mapping” or “&lt;a title="Wildcard Mapping on Technet" href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx?mfr=true" style="color: rgb(208, 48, 16); "&gt;Wildcard mapping&lt;/a&gt;” feature of IIS 6. I say infamous because there is a lot of concern over the performance implications of doing this. Of course, you should measure the performance of your site for yourself to determine if it is really a problem.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;The first step is to go back to the &lt;em&gt;Application Configuration Properties&lt;/em&gt;dialog like we did when configuring the &lt;em&gt;.mvc&lt;/em&gt; ISAPI mapping (&lt;em&gt;see, I told you that information might come in useful later&lt;/em&gt;).&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="application mappings" border="0" alt="application mappings" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/application-mappings_3.png" width="410" height="452" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Next to the &lt;em&gt;Wildcard application maps&lt;/em&gt; section, click the &lt;em&gt;Insert…&lt;/em&gt; button.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="wildcard extension mapping" border="0" alt="wildcard extension mapping" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/09-wildcard-extension-mapping_3.png" width="432" height="131" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;This brings up the wildcard application mapping dialog. Enter the path to the&lt;em&gt;aspnet_isapi.dll&lt;/em&gt;. You can follow the trick we mentioned earlier for getting this path.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;strong&gt;Don’t forget to uncheck the &lt;em&gt;Verify that file exists&lt;/em&gt; checkbox!&lt;/strong&gt; This is one of the most common mistakes people make.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;If you’ve been following along everything in this post, you’ll need to go back and reset the routes in your &lt;em&gt;Global.asax.cs&lt;/em&gt; file to the default routes. You no longer need the &lt;em&gt;.mvc&lt;/em&gt; file extension in the routes. At this point, you can also remove &lt;em&gt;Default.aspx&lt;/em&gt; if you’d like. It’s not needed.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Now when you browse your site, your URLs will not have a file extension as you can see in the following screenshots.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;img title="Home page without extension" border="0" alt="Home page without extension" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/11-extensionless-url_3.png" width="518" height="420" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;&lt;a href="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/10-extensionless-about-page_5.png" rel="lightbox" style="color: rgb(208, 48, 16); "&gt;&lt;img title="About page without extension" border="0" alt="About page without extension" src="http://haacked.com/images/haacked_com/WindowsLiveWriter/07de283cb368_B754/10-extensionless-about-page_thumb_1.png" width="518" height="395" style="display: inline; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 5px; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt; &lt;/p&gt;&lt;h2 style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "&gt;Final Tips&lt;/h2&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;One thing to understand is that an ASP.NET project is scoped to the Website or Virtual Application in which it resides. For example, in the example I have here, we pointed a Virtual Application named &lt;em&gt;IIS6DemoWeb&lt;/em&gt; to the directory containing my ASP.NET MVC web application.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;Thus, only requests for that virtual application will be handled by my web application. I cannot make a request for &lt;em&gt;http://localhost/&lt;/em&gt; in this case and expect it to be handled by my application. Nor can I expect routing in this application to handle requests for another root directory such as&lt;em&gt;http://localhost/not-my-app/&lt;/em&gt;.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-left: 0px; font-size: 125%; line-height: 160%; padding-bottom: 15px; "&gt;This might seem like an obvious thing to say, but I know it trips some people up. Also, in the example I did here, I used a virtual application for demonstration purposes. It’s very easy to point a root Website in IIS to my application and run it in http://localhost/ rather than a virtual application. This is not a problem. I hope you found this helpful.&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-731986008020025934?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/731986008020025934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=731986008020025934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/731986008020025934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/731986008020025934'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/aspnet-mvc-on-iis-6-walkthrough.html' title='ASP.NET MVC on IIS 6 Walkthrough'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-5700596922953657422</id><published>2008-12-06T03:13:00.000-08:00</published><updated>2008-12-06T03:19:05.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linked'/><category scheme='http://www.blogger.com/atom/ns#' term='project'/><title type='text'>Did you know… How to add a Linked Item to a project</title><content type='html'>&lt;span class="Apple-style-span"   style="color: rgb(255, 255, 255);   line-height: 14px; font-family:Verdana;font-size:12px;"&gt;&lt;p style="margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);   line-height: normal; font-family:Tahoma;font-size:13px;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This feature is helpful when you need a common file shared among projects, like a bitmap, readme, set of common tools and utilities, etc.&lt;/p&gt;&lt;p&gt;To add, right-click on the project in the solution explorer, and select &lt;strong&gt;Add – Existing Item.&lt;/strong&gt;  You’ll notice the “Add” button is one of those button-dropdowns.  &lt;strong&gt;Drop down the Add button &lt;/strong&gt;and select &lt;strong&gt;Add a link&lt;/strong&gt;. &lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/DidyouknowHowtoaddaLinkedItemtoaproject3_12843/image_4.png" style="color: rgb(0, 111, 247); "&gt;&lt;img title="Add Existing Item with Add as Link selected" height="410" alt="Add Existing Item with Add as Link selected" src="http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/DidyouknowHowtoaddaLinkedItemtoaproject3_12843/image_thumb_1.png" width="504" border="0" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Now you have a linked item in your project as indicated by the shortcut icon.&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/DidyouknowHowtoaddaLinkedItemtoaproject3_12843/image_8.png" style="color: rgb(0, 111, 247); "&gt;&lt;img title="Linked item in Solution Explorer" height="215" alt="Linked item in Solution Explorer" src="http://blogs.msdn.com/blogfiles/saraford/WindowsLiveWriter/DidyouknowHowtoaddaLinkedItemtoaproject3_12843/image_thumb_3.png" width="218" border="0" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px; " /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;The location of the linked file is saved in the project file.  The location must be via the file system, either on different drives or UNC.  No http or ftp.&lt;/p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-5700596922953657422?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/5700596922953657422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=5700596922953657422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5700596922953657422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5700596922953657422'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/did-you-know-how-to-add-linked-item-to.html' title='Did you know… How to add a Linked Item to a project'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-1260931897843911893</id><published>2008-12-06T03:09:00.001-08:00</published><updated>2008-12-06T03:09:52.476-08:00</updated><title type='text'>Tracking User Activity</title><content type='html'>&lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Lucida Grande'; font-size: 13px; "&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Introduction&lt;/h3&gt;&lt;p&gt;I like data. I go gaga over measurable metrics. Nothing makes me happier than storing information and then seeing it expressed in tables of numbers and colorful charts. Whenever I work on a web application I am always looking for interesting data to record and analyze, and the most interesting (and potentially profitable) data that every website owner should track are usage statistics. Web server log files and online tools like &lt;a rel="nofollow" href="http://www.google.com/analytics/" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Google Analytics&lt;/a&gt; provide an array of useful metrics, including how many unique visitors accessed your site, what pages were the most popular, what days of the week and hours of the day represent peak demand, and so forth.&lt;/p&gt;&lt;p&gt;Many ASP.NET web applications support user accounts, enabling visitors to create an account and sign in to the site. With a little bit of effort you can track the activity of your logged on users. This can include recording activities such as what pages were visited as well as what actions were performed. Consider a page that allows a user to manage his profile. When first arriving at this page the activity log might add an entry like "Visiting the User Profile page." After updating his e-mail address, the activity log might record, "Changed e-mail address from scott@example.com to mitchell@example.com." Such usage tracking offers a deeper level of analysis than is possible with log files or online visitor statistic tools. Instead of data that report total number of visitors or how the average user is interacting with the site, user activity tracking can provide a very detailed view of how a particular individual is using the application and what actions he is performing while signed on to the site.&lt;/p&gt;&lt;p&gt;This article examines how to record your users' activities in a database table and display this information in a web page. A complete, working demo application that shows these techniques in action is available for download.&lt;/p&gt;&lt;p&gt;&lt;i&gt;ASP.NET's &lt;/i&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/120705-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Membership system&lt;/a&gt; &lt;i&gt;makes it easy to create and manage user accounts. Many websites that use Membership are configured to use &lt;/i&gt;&lt;a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.security.sqlmembershipprovider.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;SqlMembershipProvider&lt;/a&gt;&lt;i&gt;, a Membership provider that ships with the .NET Framework and stores user account information in a Microsoft SQL Server database. The demo application for this article uses SqlMembershipProvider, storing user account information along with the user activity log in a &lt;/i&gt;&lt;a rel="nofollow" href="http://www.microsoft.com/express/sql/default.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Microsoft SQL Server 2008 Express Edition&lt;/a&gt; &lt;i&gt;database file (ASPNETDB.mdf), which you will find in the application's App_Data folder. For more information on using the Membership system refer to my &lt;/i&gt;&lt;a rel="nofollow" href="http://www.asp.net/learn/security/" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;ASP.NET Web Security tutorial series&lt;/a&gt;&lt;i&gt;.&lt;/i&gt;&lt;/p&gt;&lt;a name="A_Look_at_the_Membership_System's_User_Tracking_Implementation" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;A Look at the Membership System's User Tracking Implementation&lt;/h3&gt;&lt;p&gt;One of the lesser known features of ASP.NET's Membership system is that it has a built-in mechanism to track the last date and time each user has accessed the system. Each user account has a &lt;a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.security.membershipuser.lastactivitydate.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;LastActivityDate property&lt;/a&gt; that records this information; the SqlMembershipProvider stores this value in the aspnet_Users table's LastActivityDate column in &lt;a rel="nofollow" href="http://en.wikipedia.org/wiki/Coordinated_universal_time" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Coordinated Universal Time (UTC).&lt;/a&gt; This LastActivityDate value is automatically updated whenever a user signs in and whenever their user account information is accessed via the &lt;a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.security.membership.getuser.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Membership.GetUser method&lt;/a&gt;. The LastActivityDate is used by the Membership system to determine how many users are online - the&lt;a rel="nofollow" href="http://msdn.microsoft.com/en-us/library/system.web.security.membership.getnumberofusersonline.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Membership.GetNumberOfUsersOnline method&lt;/a&gt; returns the number of users whose LastActivityDate is within a certain window of the current date and time (15 minutes, by default).&lt;/p&gt;&lt;p&gt;The Membership system's user tracking implementation is pretty limited as it only specifies the last date and time a user was active on the site. It does not indicate what the user was doing at that time or provide any sort of activity history. The activity logging system presented in this article overcomes these limitations.&lt;/p&gt;&lt;a name="Designing_the_User_Activity_Log_Database_Table" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Designing the User Activity Log Database Table&lt;/h3&gt;&lt;p&gt;The first step in building any analysis tool is to determine what information to track. Different website usage analytic tools capture different information: web server logs typically record the filename of each requested page, the querystring, the date and time, and the HTTP status code, whereas online tools capture information of interest to the sales and marketing departments: visit durations, the geographical locations of the site's visitors, the number of unique visitors, entry and exit pages, and so on.&lt;/p&gt;&lt;p&gt;What information do we need to record when tracking the online activity of a website's logged on users? At a minimum we would need to log:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;The activity being performed&lt;/li&gt;&lt;li&gt;The user performing the activity&lt;/li&gt;&lt;li&gt;The date and time of activity&lt;/li&gt;&lt;li&gt;The page being visited when the activity is performed&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This information can be modeled in a single database table. Figure 1 shows such a table, which I've named ActivityLog. This table contains one record for each activity recorded for each user on the site.&lt;/p&gt;&lt;h4 style="font-size: 1.1em; color: rgb(0, 0, 0); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Figure 1: The ActivityLog table models the activity log.&lt;/h4&gt;&lt;p&gt;&lt;img src="http://dotnetslackers.com/images/articleimages/TrackingUserActivity01.jpg" title="The ActivityLog table models the activity log." alt="The ActivityLog table models the activity log." /&gt;&lt;/p&gt;&lt;p&gt;The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;ActivityLogID &lt;/code&gt;is of type uniqueidentifier and uniquely identifies each log entry. The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;UserId &lt;/code&gt;column identifies the user who performed the activity. (The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;UserId &lt;/code&gt;column in the aspnet_Users table is what uniquely identifies each user in the SqlMembershipProvider user store.) The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;Activity &lt;/code&gt;column describes the activity performed; &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;PageUrl &lt;/code&gt;is the URL of the page where the activity was performed. Finally, &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;ActivityDate &lt;/code&gt;is the date and time (in UTC) that the activity was performed.&lt;/p&gt;&lt;p&gt;&lt;i&gt;The ActivityLog table is designed to have a record added for each activity performed by the user. Depending on the popularity of your website, this table can grow to include tens of thousands if not millions of records. You may want to consider implementing some mechanism to remove records older than a certain date, such as all activity log entries more than three months old. This could be accomplished by a SQL Job that executes nightly.&lt;/i&gt;&lt;/p&gt;&lt;a name="Logging_User_Activity" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Logging User Activity&lt;/h3&gt;&lt;p&gt;Web server log files automatically record each requested page; online usage statistic tools use cookies to track the pages users visit. Both of these logging mechanisms, once setup and configured, track visits to the site automatically without needed intervention from the web developer. The activity log is more flexible as it can be used to track any "activity," which may be page visits or user-instigated actions. Therefore, logging a user activity to the database involves writing code.&lt;/p&gt;&lt;p&gt;To help facilitate this process I created a custom base page class named BasePage that extends the System.Web.UI.Page class. BasePage includes a method named &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LogActivity(activity, recordPageUrl) &lt;/code&gt;that writes a record to the ActivityLog table with the specified &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;activity &lt;/code&gt;and, if specified, the URL of the currently visited page.&lt;/p&gt;&lt;p&gt;The LogActivity method's code follows:&lt;/p&gt;&lt;div class="dp-highlighter nogutter" style="font-family: Consolas, 'Courier New', Courier, monospace; width: 99%; overflow-x: auto; overflow-y: auto; margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-size: 0.9em; color: black; background-color: rgb(251, 237, 187); "&gt;&lt;div class="bar" style="padding-left: 0px; "&gt;&lt;/div&gt;&lt;ol start="1" class="dp-c" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(43, 145, 175); list-style-type: none; margin-left: 0px; "&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;protected&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;void&lt;/span&gt;&lt;span style="color: black; "&gt; LogActivity(&lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;string&lt;/span&gt;&lt;span style="color: black; "&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;activity, &lt;span class="keyword" style="color: blue; "&gt;bool&lt;/span&gt;&lt;span style="color: black; "&gt; recordPageUrl)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;{  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;if&lt;/span&gt;&lt;span style="color: black; "&gt; (Request.IsAuthenticated)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    {  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        &lt;span class="comment" style="color: green; "&gt;// Get information about the currently logged on user&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        MembershipUser currentUser = Membership.GetUser(&lt;span class="keyword" style="color: blue; "&gt;false&lt;/span&gt;&lt;span style="color: black; "&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        &lt;span class="keyword" style="color: blue; "&gt;if&lt;/span&gt;&lt;span style="color: black; "&gt; (currentUser != &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;null&lt;/span&gt;&lt;span style="color: black; "&gt;)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        {  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;            Guid userId = (Guid)currentUser.ProviderUserKey;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;            &lt;span class="comment" style="color: green; "&gt;// Log the activity in the database&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;            &lt;span class="keyword" style="color: blue; "&gt;using&lt;/span&gt;&lt;span style="color: black; "&gt; (SqlConnection myConnection = &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;new&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;               SqlConnection(ConfigurationManager.  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;               ConnectionStrings[&lt;span class="string" style="color: blue; "&gt;"MembershipConnectionString"&lt;/span&gt;&lt;span style="color: black; "&gt;].ConnectionString))  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;            {  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                SqlCommand myCommand = &lt;span class="keyword" style="color: blue; "&gt;new&lt;/span&gt;&lt;span style="color: black; "&gt; SqlCommand();  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.CommandText = &lt;span class="string" style="color: blue; "&gt;"usp_LogUserActivity"&lt;/span&gt;&lt;span style="color: black; "&gt;;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.CommandType = CommandType.StoredProcedure;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.Connection = myConnection;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.Parameters.AddWithValue(&lt;span class="string" style="color: blue; "&gt;"@UserId"&lt;/span&gt;&lt;span style="color: black; "&gt;, userId);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.Parameters.AddWithValue(&lt;span class="string" style="color: blue; "&gt;"@Activity"&lt;/span&gt;&lt;span style="color: black; "&gt;, activity);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                &lt;span class="keyword" style="color: blue; "&gt;if&lt;/span&gt;&lt;span style="color: black; "&gt; (recordPageUrl)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                    myCommand.Parameters.AddWithValue(&lt;span class="string" style="color: blue; "&gt;"@PageUrl"&lt;/span&gt;&lt;span style="color: black; "&gt;, Request.RawUrl);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                &lt;span class="keyword" style="color: blue; "&gt;else&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                    myCommand.Parameters.AddWithValue(&lt;span class="string" style="color: blue; "&gt;"@PageUrl"&lt;/span&gt;&lt;span style="color: black; "&gt;, DBNull.Value);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myConnection.Open();  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myCommand.ExecuteNonQuery();  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;                myConnection.Close();  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;            }  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        }  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;The method starts by determining if the user visiting the page is authenticated. If so, it gets the user's information via the Membership class's &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;GetUser &lt;/code&gt;method. If a user is returned, the stored procedure &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_LogUserActivity &lt;/code&gt;is called, passing in values for the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@UserId&lt;/code&gt;, &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@Activity&lt;/code&gt;, and &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@PageUrl &lt;/code&gt;parameters. Note that if &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;recordPageUrl &lt;/code&gt;is false, the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@PageUrl &lt;/code&gt;parameter is set to a database &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;NULL &lt;/code&gt;value; if it is &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;true&lt;/code&gt;, the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@PageUrl &lt;/code&gt;parameter is assigned the raw URL of the currently requested page, which includes the directories, filename, and querystring of the requested web page (i.e., &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;/MyApp/Users/Default.aspx?ID=2&lt;/code&gt;).&lt;/p&gt;&lt;p&gt;The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_LogUserActivity &lt;/code&gt;stored procedure starts by updating the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LastActivityDate &lt;/code&gt;column in the aspnet_Users table. As a result, adding an entry to the user activity log is tantamount to retrieving the user's information through the Membership system. Following the update to the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LastActivityDate&lt;/code&gt;, the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_LogUserActivity &lt;/code&gt;stored procedure inserts a record into the ActivityLog table. This update and insert are atomic as they are performed under the umbrella of a transaction. For background on transactions and using SQL Server's &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;TRY...CATCH &lt;/code&gt;blocks see&lt;a href="http://aspnet.4guysfromrolla.com/articles/072705-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Maintaining Database Consistency with Transactions&lt;/a&gt; and &lt;a href="http://www.4guysfromrolla.com/webtech/041906-1.shtml" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;TRY...CATCH in SQL Server&lt;/a&gt;.&lt;/p&gt;&lt;div class="dp-highlighter nogutter" style="font-family: Consolas, 'Courier New', Courier, monospace; width: 99%; overflow-x: auto; overflow-y: auto; margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-size: 0.9em; color: black; background-color: rgb(251, 237, 187); "&gt;&lt;div class="bar" style="padding-left: 0px; "&gt;&lt;/div&gt;&lt;ol start="1" class="dp-sql" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(43, 145, 175); list-style-type: none; margin-left: 0px; "&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;ALTER&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;PROCEDURE&lt;/span&gt;&lt;span style="color: black; "&gt; dbo.usp_LogUserActivity  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;(  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    @UserId     uniqueidentifier,  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    @Activity   nvarchar(100),  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    @PageUrl    nvarchar(100)  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;)  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;AS&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;BEGIN&lt;/span&gt;&lt;span style="color: black; "&gt; TRY  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;   &lt;span class="keyword" style="color: blue; "&gt;BEGIN&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;TRANSACTION&lt;/span&gt;&lt;span style="color: black; "&gt;    &lt;/span&gt;&lt;span class="comment" style="color: green; "&gt;-- Start the transaction&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;DECLARE&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentTimeUtc datetime  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;SET&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentTimeUtc = getutcdate()  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;   &lt;span class="comment" style="color: green; "&gt;-- Update the LastActivityDate in aspnet_Users&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;UPDATE&lt;/span&gt;&lt;span style="color: black; "&gt;  dbo.aspnet_Users  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;SET&lt;/span&gt;&lt;span style="color: black; "&gt;     LastActivityDate = @CurrentTimeUtc  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;WHERE&lt;/span&gt;&lt;span style="color: black; "&gt;   @UserId = UserId  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="comment" style="color: green; "&gt;-- Insert activity record for user&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;INSERT&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;INTO&lt;/span&gt;&lt;span style="color: black; "&gt; ActivityLog(UserId, Activity, PageUrl, ActivityDate)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;VALUES&lt;/span&gt;&lt;span style="color: black; "&gt;(@UserId, @Activity, @PageUrl, @CurrentTimeUtc)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;   &lt;span class="comment" style="color: green; "&gt;-- If we reach here, success!&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;   &lt;span class="keyword" style="color: blue; "&gt;COMMIT&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;END&lt;/span&gt;&lt;span style="color: black; "&gt; TRY  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;BEGIN&lt;/span&gt;&lt;span style="color: black; "&gt; CATCH  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;span class="comment" style="color: green; "&gt;-- Whoops, there was an error&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  IF @@TRANCOUNT &gt; 0  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;     &lt;span class="keyword" style="color: blue; "&gt;ROLLBACK&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;span class="comment" style="color: green; "&gt;-- Raise an error with the details of the exception&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;span class="keyword" style="color: blue; "&gt;DECLARE&lt;/span&gt;&lt;span style="color: black; "&gt; @ErrMsg nvarchar(4000), @ErrSeverity &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;int&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;span class="keyword" style="color: blue; "&gt;SELECT&lt;/span&gt;&lt;span style="color: black; "&gt; @ErrMsg = ERROR_MESSAGE(),  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;         @ErrSeverity = ERROR_SEVERITY()  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  RAISERROR(@ErrMsg, @ErrSeverity, 1)  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;END&lt;/span&gt;&lt;span style="color: black; "&gt; CATCH  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;With the BasePage class complete, the final step is to have the ASP.NET pages in the site derive from BasePage (rather than from System.Web.UI.Page). Once this has been done you can call the LogActivity method from any page. For example, the homepage (~/&lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;Default.aspx&lt;/code&gt;) has the following code for its &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;Page_Load &lt;/code&gt;event handler:&lt;/p&gt;&lt;div class="dp-highlighter nogutter" style="font-family: Consolas, 'Courier New', Courier, monospace; width: 99%; overflow-x: auto; overflow-y: auto; margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-size: 0.9em; color: black; background-color: rgb(251, 237, 187); "&gt;&lt;div class="bar" style="padding-left: 0px; "&gt;&lt;/div&gt;&lt;ol start="1" class="dp-c" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(43, 145, 175); list-style-type: none; margin-left: 0px; "&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;protected&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;void&lt;/span&gt;&lt;span style="color: black; "&gt; Page_Load(&lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;object&lt;/span&gt;&lt;span style="color: black; "&gt; sender, EventArgs e)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;{  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;if&lt;/span&gt;&lt;span style="color: black; "&gt; (!Page.IsPostBack)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    {  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        &lt;span class="keyword" style="color: blue; "&gt;base&lt;/span&gt;&lt;span style="color: black; "&gt;.LogActivity(&lt;/span&gt;&lt;span class="string" style="color: blue; "&gt;"Visiting the homepage..."&lt;/span&gt;&lt;span style="color: black; "&gt;, &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;true&lt;/span&gt;&lt;span style="color: black; "&gt;);  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    }  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;}  &lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LogActivity &lt;/code&gt;method can be called from any event handler in those ASP.NET pages that derive from BasePage. Call &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LogActivity &lt;/code&gt;from the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;Page_Load &lt;/code&gt;event handler to log information when a page is first visited. You can additionally call &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LogActivity &lt;/code&gt;when the user clicks a button to log that they've performed a particular action (such as editing or deleting a record from some database table). All of the ASP.NET pages in the demo application derive from the BasePage class, and most include at least one call to the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LogActivity &lt;/code&gt;method.&lt;/p&gt;&lt;a name="Displaying_a_Particular_User's_Activity_History" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Displaying a Particular User's Activity History&lt;/h3&gt;&lt;p&gt;The activity log provides a complete history of each user's activity on the site. The demo application includes a page named ActivityHistoryByUser.aspx that displays the complete history in a paged grid for a particular user. Figure 2 shows a screen shot of ActivityHistoryByUser.aspx in action.&lt;/p&gt;&lt;p&gt;&lt;i&gt;The GridView controls used in the web pages in this tutorial use default paging, which is easy to implement but inefficient when paging through a large number of records. Because the activity log may contain thousands of records for each user account, the GridView controls should be retooled to use custom paging unless some mechanism is put into place to periodically cull old activity log entries from the table or if only recent activity log records are displayed in the grid. For more information on custom paging see &lt;/i&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/031506-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Custom Paging in ASP.NET&lt;/a&gt;&lt;i&gt;.&lt;/i&gt;&lt;/p&gt;&lt;h4 style="font-size: 1.1em; color: rgb(0, 0, 0); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Figure 2: Scott's activity history is displayed in a grid.&lt;/h4&gt;&lt;p&gt;&lt;img src="http://dotnetslackers.com/images/articleimages/TrackingUserActivity02.jpg" title="Scott's activity history is displayed in a grid." alt="Scott's activity history is displayed in a grid." /&gt;&lt;/p&gt;&lt;p&gt;Each activity in the left column is displayed as a hyperlink that links to the activity's &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;PageUrl &lt;/code&gt;value (if such a value exists). The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;Last Updated &lt;/code&gt;column shows the date the activity was performed. For activities older than a week, the date the activity was performed is displayed. If the activity occurred more recently then a human-friendly message, such as "2 days ago" or "6 minutes ago," is displayed in place of the date and time. (This display formatting is handled by the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;FormatLastUpdatedDate &lt;/code&gt;method in the BasePage class.)&lt;/p&gt;&lt;p&gt;The grid is populated by the records returned from the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_GetUserActivityLog &lt;/code&gt;stored procedure. As the following markup shows, this stored procedure returns the &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;ActivityLog &lt;/code&gt;entries for a particular user ordered from the most recent entries to the oldest.&lt;/p&gt;&lt;div class="dp-highlighter nogutter" style="font-family: Consolas, 'Courier New', Courier, monospace; width: 99%; overflow-x: auto; overflow-y: auto; margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-size: 0.9em; color: black; background-color: rgb(251, 237, 187); "&gt;&lt;div class="bar" style="padding-left: 0px; "&gt;&lt;/div&gt;&lt;ol start="1" class="dp-sql" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(43, 145, 175); list-style-type: none; margin-left: 0px; "&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;ALTER&lt;/span&gt;&lt;span style="color: black; "&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;PROCEDURE&lt;/span&gt;&lt;span style="color: black; "&gt; dbo.usp_GetUserActivityLog  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;(  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    @UserID uniqueidentifier  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;)  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;AS&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;DECLARE&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentDateUtc datetime  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;SET&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentDateUtc = getutcdate()  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;SELECT&lt;/span&gt;&lt;span style="color: black; "&gt; ActivityLogID, Activity, PageUrl, ActivityDate, @CurrentDateUtc &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;as&lt;/span&gt;&lt;span style="color: black; "&gt; CurrentDate  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;FROM&lt;/span&gt;&lt;span style="color: black; "&gt; ActivityLog  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;WHERE&lt;/span&gt;&lt;span style="color: black; "&gt; UserID = @UserID  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;ORDER&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;BY&lt;/span&gt;&lt;span style="color: black; "&gt; ActivityDate &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;DESC&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;a name="Viewing_the_Online_Users_and_their_Last_Performed_Activity" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Viewing the Online Users and their Last Performed Activity&lt;/h3&gt;&lt;p&gt;Many websites that support user accounts have a page that lists what users are currently online and what activity they last performed. As noted earlier, the Membership system automatically records each user's last active date and time and provides a method for determining how many users have been active within a specified time window. The Membership's built-in system does not include what activity the user last performed, but this information is captured by the ActivityLog table.&lt;/p&gt;&lt;p&gt;I added a stored procedure to the database named &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_GetCurrentActivityForOnlineUsers &lt;/code&gt;that returns the list of users who are currently online along with their most recent activity. This stored procedure takes in a single input parameter, &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;@MinutesSinceLastInactive&lt;/code&gt;, which is the number of minutes that has elapsed since a user has been active in the system and is still considered "online." For example, a value of 15 means that any user whose&lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LastActivityDate &lt;/code&gt;is within 15 minutes of the current date and time is considered "online," whereas those users whose &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;LastActivityDate &lt;/code&gt;is outside of this window are considered "offline."&lt;/p&gt;&lt;p&gt;The &lt;code style="font-size: 1.2em; color: rgb(153, 0, 0); "&gt;usp_GetCurrentActivityForOnlineUsers &lt;/code&gt;stored procedure starts by determining what time is the cutoff for a user to be considered "online." It then queries the aspnet_Users and ActivityLog tables to retrieve the username of online users along with information about their last activity.&lt;/p&gt;&lt;div class="dp-highlighter nogutter" style="font-family: Consolas, 'Courier New', Courier, monospace; width: 99%; overflow-x: auto; overflow-y: auto; margin-top: 18px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; font-size: 0.9em; color: black; background-color: rgb(251, 237, 187); "&gt;&lt;div class="bar" style="padding-left: 0px; "&gt;&lt;/div&gt;&lt;ol start="1" class="dp-sql" style="margin-top: 0px; margin-right: 0px; margin-bottom: 1px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: rgb(43, 145, 175); list-style-type: none; margin-left: 0px; "&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;ALTER&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;PROCEDURE&lt;/span&gt;&lt;span style="color: black; "&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;dbo.usp_GetCurrentActivityForOnlineUsers  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;(  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    @MinutesSinceLastInactive   &lt;span class="keyword" style="color: blue; "&gt;int&lt;/span&gt;&lt;span style="color: black; "&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;)  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;AS&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;DECLARE&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentTimeUtc datetime  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;SET&lt;/span&gt;&lt;span style="color: black; "&gt; @CurrentTimeUtc = getutcdate()  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;DECLARE&lt;/span&gt;&lt;span style="color: black; "&gt; @DateActive datetime  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;SELECT&lt;/span&gt;&lt;span style="color: black; "&gt;  @DateActive = DATEADD(&lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;minute&lt;/span&gt;&lt;span style="color: black; "&gt;,  -(@MinutesSinceLastInactive), @CurrentTimeUtc)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;SELECT&lt;/span&gt;&lt;span style="color: black; "&gt;  act.UserId,  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        u.UserName,   &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        act.Activity,  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        act.PageUrl,  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        act.ActivityDate,  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        @CurrentTimeUtc &lt;span class="keyword" style="color: blue; "&gt;as&lt;/span&gt;&lt;span style="color: black; "&gt; CurrentDate  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;FROM&lt;/span&gt;&lt;span style="color: black; "&gt;    dbo.aspnet_Users u(NOLOCK)  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;    &lt;span class="keyword" style="color: blue; "&gt;INNER&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="op" style="color: rgb(128, 128, 128); "&gt;JOIN&lt;/span&gt;&lt;span style="color: black; "&gt; dbo.ActivityLog act(NOLOCK) &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;ON&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        act.UserId = u.UserId  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;WHERE&lt;/span&gt;&lt;span style="color: black; "&gt;   u.LastActivityDate &gt; @DateActive &lt;/span&gt;&lt;span class="op" style="color: rgb(128, 128, 128); "&gt;AND&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;        act.ActivityDate = u.LastActivityDate  &lt;/span&gt;&lt;/li&gt;&lt;li class="" style="padding-left: 10px; line-height: 14px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; "&gt;&lt;span style="color: black; "&gt;&lt;span class="keyword" style="color: blue; "&gt;ORDER&lt;/span&gt;&lt;span style="color: black; "&gt; &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;BY&lt;/span&gt;&lt;span style="color: black; "&gt; act.ActivityDate &lt;/span&gt;&lt;span class="keyword" style="color: blue; "&gt;DESC&lt;/span&gt;&lt;span style="color: black; "&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;p&gt;The WhoIsOnline.aspx page displays the results from this stored procedure in a grid (see Figure 3).&lt;/p&gt;&lt;h4 style="font-size: 1.1em; color: rgb(0, 0, 0); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Figure 3: Those users currently online are listed along with their most recent activity.&lt;/h4&gt;&lt;p&gt;&lt;img src="http://dotnetslackers.com/images/articleimages/TrackingUserActivity03.jpg" title="Those users currently online are listed along with   their most recent activity." alt="Those users currently online are listed along with their most recent activity." /&gt;&lt;/p&gt;&lt;a name="Conclusion" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;Conclusion&lt;/h3&gt;&lt;p&gt;Web server log files and online usage analysis tools are helpful in determining and evaluating macroscopic usage patterns. Unfortunately, these tools cannot provide a detailed view of how a particular user is interacting with your site. Nor can they provide live, up to the second activity information that can be used in your application to show who is currently online and what they are doing. Such deep usage analysis and real-time statistics are possible on websites that support user accounts.&lt;/p&gt;&lt;p&gt;ASP.NET's Membership system greatly simplifies the process of setting up, creating, and managing user accounts. However, the Membership system only tracks when each user's last activity was on the site; it does not log the activity performed or maintain an activity history. As examined in this article, it is possible to build your own user activity log with a little bit of elbow grease.&lt;/p&gt;&lt;p&gt;Happy Programming!&lt;/p&gt;&lt;a name="References" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;&lt;/a&gt;&lt;h3 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: 1.2em; color: rgb(119, 119, 119); margin-top: 10px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;References&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a rel="nofollow" href="http://www.asp.net/learn/security/" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;ASP.NET Web Security Tutorials&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/120705-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Examining ASP.NET's Membership, Roles, and Profile&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/072705-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Maintaining Database Consistency with Transactions&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.4guysfromrolla.com/webtech/041906-1.shtml" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;TRY...CATCH in SQL Server&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/041305-1.aspx" style="text-decoration: none; color: rgb(0, 173, 239); "&gt;Using a Custom Base Class for Your ASP.NET Pages' Code-Behind Classes&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-1260931897843911893?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/1260931897843911893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=1260931897843911893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1260931897843911893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1260931897843911893'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/tracking-user-activity.html' title='Tracking User Activity'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-8723590334339506164</id><published>2008-12-02T10:31:00.000-08:00</published><updated>2008-12-02T10:35:21.699-08:00</updated><title type='text'>Nokia N79</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.forum.nokia.com/devices/pics/n79_main.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 302px; height: 189px;" src="http://www.forum.nokia.com/devices/pics/n79_main.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(99, 99, 99); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;font-family:Arial;font-size:12;"  &gt;&lt;div class="fnStationary" style="padding: 3px 45px 0px 30px; margin-bottom: 10px;"&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;&lt;br /&gt;&lt;/h4&gt;&lt;h4 style="margin-bottom: 0px; font-size: 12px;"&gt;Device Description:&lt;/h4&gt;The Nokia N79 is a GSM/WCDMA dual-mode multimedia computer supporting WCDMA/HSDPA, EGSM, and WLAN. Change the Xpress-on smart covers that automatically change the theme when attached. Use the Nokia N79 to connect to mobile broadband using WLAN or HSDPA (3.5G). Find directions and locations with the integrated A-GPS and included maps. Take photos with a 5-megapixel autofocus camera with a dual LED flash and automatic location tagging of images and videos. Enjoy videos, music, and graphics on the 2.4” QVGA display with orientation sensor. Additional features include UPnP, Bluetooth 2.0 +EDR, and USB 2.0 High-Speed.&lt;/div&gt;&lt;div class="fnStationary" style="padding: 3px 45px 0px 30px; margin-bottom: 10px;"&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=6277951066083602277#" onclick="fnDeviceTable.addDeviceToComparison('N79'); return false;" class="fnButton" style="text-decoration: none; cursor: pointer; background-image: url(http://www.forum.nokia.com/images/btn_right.gif); background-repeat: no-repeat; display: inline-block; vertical-align: middle; line-height: 22px; padding-right: 15px; color: rgb(99, 99, 99); background-position: 100% 0%;"&gt;&lt;span style="border-width: 0px; cursor: pointer; background-image: url(http://www.forum.nokia.com/images/btn_left.gif); background-repeat: no-repeat; display: inline-block; height: 22px; line-height: 22px; padding-left: 15px; color: rgb(99, 99, 99); font-weight: bold; background-position: 0% 0%;font-size:12;" &gt;Compare with other device(s)&lt;/span&gt;&lt;/a&gt;&lt;div id="expandAllTabsDiv" style="padding-top: 5px; padding-bottom: 5px;"&gt;&lt;br /&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=6277951066083602277#" onclick="fnDeviceTable.expandAll(false); return false;" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="FnDeviceTableContainer"&gt;&lt;table id="FnDeviceTable" style="border-width: 0px; margin: 0px; padding: 0px; width: 100%; border-collapse: collapse;"&gt;&lt;tbody id="tbody_TechnicalSpecs"&gt;&lt;tr id="TechnicalSpecs_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Technical Specs&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="technicalspecsdp:developer_platform" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Developer Platform&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;S60 3rd Edition, Feature Pack 2&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="technicalspecsdp:operating_system" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Operating System&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Symbian OS v9.3&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="technicalspecsresolution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Resolution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;240 x 320&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_General" class="FnDeviceCollapsible"&gt;&lt;tr id="General_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;General&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="generalresolution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Resolution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;240 x 320&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:bits_per_pixel" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Color Depth&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;24 bit&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generalsize" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Size&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;110 x 49 x 15 mm&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:weight" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Weight&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;97 g&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:navigation_key" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Input Methods&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;3 Labeled Soft Keys&lt;br /&gt;5-way Scrolling&lt;br /&gt;Grid Key Mat&lt;br /&gt;Navi Wheel&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:band" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Frequency Band&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;GSM 1800&lt;br /&gt;GSM 1900&lt;br /&gt;GSM 850&lt;br /&gt;GSM 900&lt;br /&gt;WCDMA 2100&lt;br /&gt;WCDMA 900&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:region" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Regional Availability&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Africa&lt;br /&gt;Americas&lt;br /&gt;Asia-Pacific&lt;br /&gt;Europe&lt;br /&gt;Middle East&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:data_bearer" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Data Bearer&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;CSD&lt;br /&gt;Dual Transfer Mode (MSC 11)&lt;br /&gt;EGPRS&lt;br /&gt;GPRS&lt;br /&gt;HSCSD&lt;br /&gt;HSDPA&lt;br /&gt;WCDMA&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:cpu_count" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;CPU Count&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Single CPU&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:hardware_cpu_type" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;CPU Type&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;ARM 11&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldp:hardware_cpu_clock_rate" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;CPU Clock Rate&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;369 MHz&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaluaproflink" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;UAProf Link&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;&lt;a href="http://nds1.nds.nokia.com/uaprof/NN79-1r100.xml" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Profile 1&lt;/a&gt;&lt;br /&gt;&lt;a href="http://nds1.nds.nokia.com/uaprof/NN79-3r100.xml" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Profile 2&lt;/a&gt;&lt;br /&gt;&lt;a href="http://nds1.nds.nokia.com/uaprof/NN79r100.xml" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Profile 3&lt;/a&gt;&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generalconsumerlink" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Consumer Link&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;&lt;a href="http://europe.nokia.com/A41199654" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Product Home Page&lt;/a&gt;&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="generaldeveloperlink" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Developer Link&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;&lt;a href="http://www.forum.nokia.com/devices/N79" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Developer Home Page&lt;/a&gt;&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_ExtraFeatures" class="FnDeviceCollapsible"&gt;&lt;tr id="ExtraFeatures_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Extra Features&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="extrafeaturesdp:feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Extra Features&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Accelerometer Sensor&lt;br /&gt;FOTA Firmware over the Air&lt;br /&gt;Flight Mode&lt;br /&gt;Internet Radio&lt;br /&gt;Nokia Maps&lt;br /&gt;OMA Domain Name System (DNS) 1.0&lt;br /&gt;On-Demand Paging&lt;br /&gt;Open C API's&lt;br /&gt;PoC (Push-to-talk over Cellular)&lt;br /&gt;Stereo FM Radio&lt;br /&gt;Stereo Handsfree Speakers&lt;br /&gt;Still Image Editor&lt;br /&gt;SyncML&lt;br /&gt;TV Out&lt;br /&gt;Themes&lt;br /&gt;Visual Radio&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="extrafeaturesdp:gps_feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;GPS Features&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;A-GPS&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_APIs" class="FnDeviceCollapsible"&gt;&lt;tr id="APIs_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;APIs&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="apisdp:java_api" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Java Technology&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;CLDC 1.1&lt;br /&gt;IAP Info API&lt;br /&gt;JSR 135 Mobile Media API&lt;br /&gt;JSR 172 Web Services API&lt;br /&gt;JSR 177 Security and Trust Services API&lt;br /&gt;JSR 179 Location API&lt;br /&gt;JSR 180 SIP API&lt;br /&gt;JSR 184 Mobile 3D Graphics API&lt;br /&gt;JSR 185 JTWI&lt;br /&gt;JSR 205 Wireless Messaging API&lt;br /&gt;JSR 226 Scalable 2D Vector Graphics API&lt;br /&gt;JSR 234 Advanced Multimedia Supplements&lt;br /&gt;JSR 248 Mobile Service Architecture for CLDC&lt;br /&gt;JSR 75 FileConnection and PIM API&lt;br /&gt;JSR 82 Bluetooth API v1.1&lt;br /&gt;MIDP 2.1&lt;br /&gt;Nokia UI API&lt;br /&gt;eSWT UI API&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="apisjavaapiaccesspermissionslink" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Java API Access Permissions&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;&lt;a href="http://wiki.forum.nokia.com/index.php/Java_Security_Domains" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Java API Access Permissions&lt;/a&gt;&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="apisdp:root_certificate" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Symbian Certificates&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Symbian A&lt;br /&gt;Symbian B&lt;br /&gt;Symbian C&lt;br /&gt;Symbian D&lt;br /&gt;UTI Root&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="apisdp:product_id" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Product ID&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;0x2000DA64&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_BrowserFlash" class="FnDeviceCollapsible"&gt;&lt;tr id="BrowserFlash_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Browser &amp;amp; Flash&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="browserflashdp:browser" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Browser&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;HTML over TCP/IP&lt;br /&gt;OSS Browser&lt;br /&gt;WAP 2.0&lt;br /&gt;Web Runtime&lt;br /&gt;XHTML over TCP/IP&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="browserflashdp:flash_lite" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Flash Lite&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Flash Lite 3.0&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_Multimedia" class="FnDeviceCollapsible"&gt;&lt;tr id="Multimedia_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Multimedia&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="multimediacameraresolution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Camera Resolution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;2584 x 1938&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_digital_zoom" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Digital Zoom&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;20 x&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_sensor_cmos" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Sensor&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;CMOS 5.0 Megapixel&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_focal_length" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Focal length&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;5.2 mm&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_f_number" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;F-Stop/Aperture&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;f/2.8&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_minimum_focus_range" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Focus range&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;10 cm to infinity&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_image_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Image Format&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;JPEG/Exif&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Camera Features&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Auto Focus, Carl Zeiss Optics, Flash, Red-Eye Reduction, Self Timer, Video Stabilization&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediacameravideoresolution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Resolution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;640 x 480&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_video_frame_rate" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Frame Rate&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;30 fps&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_video_zoom" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Zoom&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;8 x&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:camera_video_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Format&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;H.263, MPEG-4&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediasecondarycameraresolution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Secondary Camera Resolution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;352 x 288&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:secondary_camera_digital_zoom" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Secondary Camera Digital Zoom&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;2 x&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:secondary_camera_image_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Secondary Camera Image Format&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;JPEG&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:secondary_camera_video_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Secondary Camera Video Format&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;H.263&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:video_feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Features&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Video Player&lt;br /&gt;Video Recorder&lt;br /&gt;Video Ringtones&lt;br /&gt;Video Sharing&lt;br /&gt;Video Streaming&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:video_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Video Formats&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;3GPP formats (H.263)&lt;br /&gt;Flash Video&lt;br /&gt;H.264/AVC&lt;br /&gt;MPEG-4&lt;br /&gt;RealVideo 7,8,9/10&lt;br /&gt;WMV&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:graphics_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Graphics Formats&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;BMP, EXIF, GIF87a, GIF89a, JPEG, JPEG 2000, PNG, WBMP&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:audio_feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Audio Features&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Audio Equalizer&lt;br /&gt;Audio Recording AAC stereo, 48kHz&lt;br /&gt;Audio Streaming&lt;br /&gt;FM Transmitter (88.1 - 107.9 MHz)&lt;br /&gt;Music Player&lt;br /&gt;Stereo&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="multimediadp:audio_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Audio Formats&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;AAC, AAC+, AMR-NB, AMR-WB, M4A, MIDI Tones (poly 64), MP3, MP4, Mobile XMF, RealAudio 7,8,10, SP-MIDI, True tones, WAV, WMA, eAAC+&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_MemoryFunctions" class="FnDeviceCollapsible"&gt;&lt;tr id="MemoryFunctions_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Memory Functions&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="memoryfunctionsdp:shared_memory" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Max User Storage&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;50 MB&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="memoryfunctionsdp:memory_card" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Memory Card&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Micro SD&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="memoryfunctionsdp:maximum_memory_card_size" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Max Memory Card Size&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;8 GB&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="memoryfunctionsdp:heap_size" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Maximum Heap Size&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Unlimited&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="memoryfunctionsdp:maximum_jar_size" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Maximum JAR Size&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Unlimited&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_Connectivity" class="FnDeviceCollapsible"&gt;&lt;tr id="Connectivity_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Connectivity&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="connectivitydp:pc_connectivity" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Local Connectivity&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Bluetooth 2.0 +EDR&lt;br /&gt;Bluetooth Stereo Audio&lt;br /&gt;DLNA Certification&lt;br /&gt;Micro USB&lt;br /&gt;Mini Stereo Plug 3.5mm&lt;br /&gt;Nokia AV 3.5mm&lt;br /&gt;Nokia microUSB Cable CA-101&lt;br /&gt;UPnP&lt;br /&gt;USB 2.0 High-Speed&lt;br /&gt;USB Mass Storage&lt;br /&gt;WLAN&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="connectivitydp:wlan_support" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;WLAN support&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;802.11b/g&lt;br /&gt;WEP&lt;br /&gt;WPA&lt;br /&gt;WPA2 (AES/TKIP)&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="connectivitydp:bluetooth_profile" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Bluetooth Profiles&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;A2DP, AVRCP, BIP, BPP, DI, DUN, FTP, GAP, GAVDP, GOEP, HFP, HID, HSP, OPP, PBAP, SAP, SDP, SPP&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_Messaging" class="FnDeviceCollapsible"&gt;&lt;tr id="Messaging_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Messaging&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="messagingdp:messaging" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Messaging&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;IM&lt;br /&gt;MMS+SMIL&lt;br /&gt;SMS&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="messagingdp:email_protocol" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Email Protocol&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;IMAP4&lt;br /&gt;POP3&lt;br /&gt;SMTP&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="messagingdp:email_solution" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Email Solution&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Mail for Exchange&lt;br /&gt;Nokia Intellisync Wireless Email&lt;br /&gt;OMA E-mail Notification v1.0&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="messagingdp:messaging_feature" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Messaging Feature&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;OMA Instant Messaging and Presence Service v1.1&lt;br /&gt;OMA Instant Messaging and Presence Service v1.2.1&lt;br /&gt;OMA Multimedia Messaging Service v1.2&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="messagingdp:document_format" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Document Formats&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Excel, PDF, Powerpoint, Word, Zip&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_PowerManagement" class="FnDeviceCollapsible"&gt;&lt;tr id="PowerManagement_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Power Management&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:power_management" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Power Management&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;2.0mm Charger Connector&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:battery" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Battery&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;BL-6F 3.7V 1200 mAh&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:maximum_gsm_talk_time" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;GSM Talk Time&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;5.5 hours&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:maximum_wcdma_talk_time" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;WCDMA Talk Time&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;3.5 hours&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:maximum_voip_talk_time" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;VoIP Talk Time&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;4 hours&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:maximum_gsm_standby_time" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;GSM Standby Time&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;372 hours&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="powermanagementdp:maximum_wcdma_standby_time" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;WCDMA Standby Time&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;406 hours&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;tbody id="tbody_Other" class="FnDeviceCollapsible"&gt;&lt;tr id="Other_header" class="FnTableGroupHeaderOpen" onclick="fnDeviceTable.toggleDisplay(this);" style="background-color: inherit;"&gt;&lt;th colspan="3" style="border-top: 1px solid rgb(215, 215, 215); padding-top: 0px; margin-top: 0px;"&gt;&lt;div class="groupHeaderText" style="width: 100%; float: left;"&gt;&lt;h4 class="fnToggleHeadline" style="margin: 0px; padding: 10px 25px; font-size: 12px; text-align: left; cursor: pointer;"&gt;Other&lt;/h4&gt;&lt;/div&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr id="otherdp:device_management" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;OMA Device Management&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;OMA Client Provisioning v1.1&lt;br /&gt;OMA Device Management v1.1.2&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="otherdp:data_synchronization" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;OMA Data Synchronization&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;OMA Data Synchronization v1.2&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="otherdp:oma_drm_level" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Digital Rights Management&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;OMA DRM Forward Lock&lt;br /&gt;OMA DRM v1.0&lt;br /&gt;OMA DRM v2.0&lt;br /&gt;OMA DRM v2.1&lt;br /&gt;Windows Media DRM 10&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="otherdp:oma_drm_delivery_method" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;DRM Delivery Method&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;HTTP Download&lt;br /&gt;MMS&lt;br /&gt;OMA Download v1.0&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr id="otherdp:web_service" class="FnDeviceRowOpen" style="display: table-row;"&gt;&lt;td class="deviceTableSubCatTopic" style="padding-left: 25px; padding-top: 0px; padding-bottom: 8px; margin-top: 0px; margin-bottom: 0px; color: rgb(99, 99, 99); background-color: inherit; width: 240px; vertical-align: top;"&gt;Web Service&lt;/td&gt;&lt;td class="deviceData" style="width: 220px;"&gt;Liberty Alliance ID-WSF 1.1&lt;br /&gt;OMA WS Network Identity 1.0&lt;br /&gt;WS-I Basic Profile 1.0/1.1&lt;/td&gt;&lt;td class="tableFiller"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class="fnStationary" style="padding: 3px 45px 0px 30px; margin-bottom: 10px;"&gt;&lt;h2 class="bgColored" style="font-size: 16px; color: rgb(99, 99, 99);"&gt;Tools&lt;/h2&gt;&lt;p style="margin-top: 0px;"&gt;The main Tools &amp;amp; SDKs page&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;a href="http://www.blogger.com/tools" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;www.forum.nokia.com/tools&lt;/a&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;provides all the tools &amp;amp; SDKs in an easy to access form. The page also includes Getting Started -articles giving an overview of the tools and SDKs.&lt;/p&gt;&lt;div class="list"&gt;&lt;div class="item"&gt;&lt;p style="margin-top: 0px;"&gt;&lt;a href="http://www.blogger.com/info/sw.nokia.com/id/dbb8841d-832c-43a6-be13-f78119a2b4cb.html" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Carbide.c++ v1.3, the development tool for C++ for Symbian OS and Open C developers&lt;/a&gt;&lt;br /&gt;Carbide.c++ is a powerful family of mobile development tools built on the Eclipse framework. Family members include: Carbide.c++ OEM Edition for device creation users Carbide.c++ Professional Edition for developers working with pre-production devices Carbide.c++ Developer Edition for application development on production phones Carbide.c++ Express, available as a no-cost download to introduce developers to mobile experience&lt;/p&gt;&lt;/div&gt;&lt;div class="item"&gt;&lt;p style="margin-top: 0px;"&gt;&lt;a href="http://www.blogger.com/info/sw.nokia.com/id/bb173537-4e67-496f-9967-50917d5cfc47/S60_Theme_Studio_for_Symbian_OS.html" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;Carbide.ui Theme Edition&lt;/a&gt;&lt;br /&gt;Carbide.ui Theme Edition enables the creation and editing of themes for S60 and Series 40 devices. Carbide.ui provides professionals and hobbyists alike with access to more than 1,000 customizable elements in the S60 UI, which makes the S60 UI the most customizable UI available.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class="bgColored" style="font-size: 16px; color: rgb(99, 99, 99);"&gt;Recommended SDK(s)&lt;/h2&gt;&lt;div class="list"&gt;&lt;div class="item"&gt;&lt;p style="margin-top: 0px;"&gt;&lt;a href="http://www.blogger.com/info/sw.nokia.com/id/36331d44-414a-4b82-8b20-85f1183e7029/OpenGL_ES_1_1_Plug_in.html" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;OpenGL ES 1.1 Plug-in&lt;/a&gt;&lt;br /&gt;This early technology plug-in for S60 3rd edition SDK for Symbian OS, for C, enables the development of OpenGL ES 1.1 applications with N93. N93 is the first Nokia multimedia computer with HW accelerated 3D graphics/OpenGL ES 1.1 support. This plug-in enables the full usage of the native 3D graphics features supported in N93. The content of this plug-in will be a part of S60 R3.1 SDK.&lt;/p&gt;&lt;/div&gt;&lt;div class="item"&gt;&lt;p style="margin-top: 0px;"&gt;&lt;a href="http://www.blogger.com/info/sw.nokia.com/id/6e772b17-604b-4081-999c-31f1f0dc2dbb/S60_Platform_SDKs_for_Symbian_OS_for_Java.html" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;S60 Platform SDKs for Symbian OS, for Java™&lt;/a&gt;&lt;br /&gt;S60 Platform SDK for Symbian OS, for Java™ MIDP allows developers to quickly and efficiently run and test Java applications for devices built on the S60 platform. Using a Java™ IDE, development with the SDK is hosted on a PC.&lt;/p&gt;&lt;/div&gt;&lt;div class="item"&gt;&lt;p style="margin-top: 0px;"&gt;&lt;a href="http://www.blogger.com/info/sw.nokia.com/id/4a7149a5-95a5-4726-913a-3c6f21eb65a5/S60-SDK-0616-3.0-mr.html" style="color: rgb(69, 165, 71); text-decoration: none;"&gt;S60 Platform SDKs for Symbian OS, for C++&lt;/a&gt;&lt;br /&gt;The S60 SDKs for Symbian OS enable application development for devices based on the S60 platform using C++. The SDK includes all key resources needed for application development, such as documentation, API reference, and an emulator. An IDE is not included; Carbide.c++ is recommended.&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-8723590334339506164?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/8723590334339506164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=8723590334339506164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/8723590334339506164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/8723590334339506164'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/12/nokia-n79.html' title='Nokia N79'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-7557808181134412812</id><published>2008-11-28T00:39:00.002-08:00</published><updated>2008-11-28T00:45:00.788-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='HOSTING'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='INDIGO'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Hosting an “Indigo” (WCF) Service</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="StyleHeading1VerdanaCentered" style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="text-decoration: none;"&gt;&lt;strong&gt;&lt;u&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#0000ff;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;em&gt;&lt;br /&gt;Table of Contents:&lt;o:p&gt;&lt;/o:p&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc3" style="margin: 0in 0in 0pt;"&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997411" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997411" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;em&gt;Introduction&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc3" style="margin: 0in 0in 0pt;"&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997412" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997412" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Hosting Environments&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997413" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997413" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;ASMX Services&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997414" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997414" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;WCF Services&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997415" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997415" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;&lt;em&gt;Different Hosting Environments&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc3" style="margin: 0in 0in 0pt;"&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997416" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997416" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;WAS Hosting Environment&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997417" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997417" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;A Simple Hosted Service&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997418" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997418" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Service Configuration&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997419" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997419" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Service Addressing&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997420" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997420" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Service Activation&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997421" mce_href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4594&amp;amp;postid=492383#_Toc123997421" style="color: rgb(0, 111, 247);"&gt;&lt;span&gt;&lt;em&gt;&lt;span style="font-family:Arial;font-size:85%;"&gt;Service Recycling&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size: 12pt; color: windowtext; font-style: normal; font-family: 'Times New Roman';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Let me start with something simple for this topic. I first make a few assumptions here:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You have used Microsoft Internet Information Services (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/WindowsServer2003/iis/default.mspx" mce_href="http://www.microsoft.com/WindowsServer2003/iis/default.mspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;IIS&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You are familiar with&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.gotdotnet.com/" mce_href="http://www.gotdotnet.com/" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;.NET&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Programming with Common Language Runtime (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.gotdotnet.com/team/clr/about_clr.aspx" mce_href="http://www.gotdotnet.com/team/clr/about_clr.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;CLR&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;) and&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.asp.net/" mce_href="http://www.asp.net/" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;ASP.NET&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You have heard of Microsoft Windows Communications Foundation (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/webservices/indigo/default.aspx" mce_href="http://msdn.microsoft.com/webservices/indigo/default.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;WCF&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;), code-named “Indigo”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;That is all what you need to know before reading the following!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Below I will write about how to host a WCF service in a special “&lt;i&gt;hosting&lt;/i&gt;” environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997411" name="_Toc123997411"&gt;&lt;/a&gt;&lt;a class="" title="_Toc123970683" name="_Toc123970683"&gt;&lt;/a&gt;&lt;span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;span style="font-family:Verdana;font-size:100%;"&gt;Introduction&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;There are tons of articles and blogs out there talking about Service Oriented Architecture (SOA), Web Services, and WCF. Never mind if you have not read them. So I will make things as simple as possible. Basically, WCF, as the next generation of service-oriented programming platform, provides a set of .NET APIs in its Version 1 (V1) for developers to use. It will be released as part of a larger package&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/winfx/" mce_href="http://msdn.microsoft.com/winfx/" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;WinFX&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;. You can download the most recent PDC release from&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=BD3BA2D5-6ADB-4FB2-A3AA-E16A9EA5603F&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=BD3BA2D5-6ADB-4FB2-A3AA-E16A9EA5603F&amp;amp;displaylang=en" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Every service-oriented programming model is also a client-server model. WCF has no difference. Both the client and service counterparts of WCF are based on the so-called “ABC” model: Address, Binding, and Contract. People also call this as “WHW” model: Address stands for “Where”, Binding stands for “How”, and Contract stands for “What”. Among the three, Binding is the most complicated part in this model. It tells WCF how to transfer data between the client and the service:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;What transport do we use: HTTP, TCP, MSMQ, Named Pipe, etc?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;What encodings do we use for the data to be encoded?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;What security mechanisms do we use for the underlying channels?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;For each WCF service, there is a host that manages service instances and lifetime. The base type of the host is System.ServiceModel.ServiceHost. It provides events and extensibility points for you to programming with. Actually I am lying here. ServiceHost is not the most basic service host type, but System.ServiceModel.ServiceHostBase is. However, you will never touch this base type if you do not want to re-create the whole channel stack to replace WCF underlying implementations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;How far have I diverted from my topic? Aren’t we talking about WCF service hosting? No, not yet! The concept of “host” has relative meanings in different programming plug-in layers. The “host” that I will talk about here has a broader meaning: it is application-level “host”. That is, a host is an application that loads one or more WCF ServiceHosts, which we will call services in the following, and manages their lifetime. In some cases, it provides an environment that works as the entry point for all messages that are routed to the services. Am I clear here? If not, please read on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997412" name="_Toc123997412"&gt;&lt;/a&gt;&lt;a class="" title="_Toc123970684" name="_Toc123970684"&gt;&lt;/a&gt;&lt;span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;span style="font-family:Verdana;font-size:100%;"&gt;Hosting Environments&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;There are different types of hosting environments for WCF services. To understand how these hosting environments work, we need to go back to see how the predecessor of WCF, a.k.a., ASMX works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997413" name="_Toc123997413"&gt;&lt;/a&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;ASMX Services&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;When ASP.NET V1 was shipped, a Web service framework known as ASMX was introduced. It is tightly integrated with the ASP.NET HTTP pipeline. This pipeline provides the hosting environment to ASMX services and it is almost always hosted inside ASP.NET applications which are managed by IIS. In this way, ASMX services can leverage the advantages of ASP.NET applications such as process management, application recycling, configuration and deployment, and extensibility points provided by ASP.NET HTTP pipeline.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;It is not required to have IIS to run ASMX services. For example, you can use the ASP.NET&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.asp.net/Projects/Cassini/Download/Default.aspx?tabindex=0&amp;amp;tabid=1" mce_href="http://www.asp.net/Projects/Cassini/Download/Default.aspx?tabindex=0&amp;amp;tabid=1" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;Cassini&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;sample web server to host an ASP.NET application and thus ASMX services. You also build a web server into your own application to host the ASP.NET pipeline using the managed HTTP.sys utility System.Net.HttpListener(see&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/04/12/ServiceStation/default.aspx" mce_href="http://msdn.microsoft.com/msdnmag/issues/04/12/ServiceStation/default.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Run ASMX without IIS&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;However, ASMX services cannot run without the ASP.NET HTTP pipeline. Even though you can integrate the pipeline into your application as above, you still need to think of the ASMX services as being in a different world, that is, they have their own configuration and deployment which are quite web-flavored. In this sense, WCF services go one big step beyond to make service-oriented programming real.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997414" name="_Toc123997414"&gt;&lt;/a&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;span style="font-weight: normal;"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;&lt;strong&gt;WCF Services&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The fact that ASMX services are tightly coupled with ASP.NET HTTP pipeline is due to the flat and passive HTTP request handling mechanism. HTTP requests received from IIS are passed on to ASP.NET pipeline and then are consumed by service methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;WCF services, however, are based on a strictly layered model to break this paradigm. Roughly speaking, there are three different layers for WCF services:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;ServiceModel layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Channel layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Transport layer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This layered model is similar as the Open System Interconnection (OSI) model. The lowest Transport layer is responsible for listening and receiving requests and converting the received data into “Messages”. A&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;Message&lt;/i&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;is a cross layer data packet that travels all of the layers to the top. The Channel layer provides a Message processing framework for different service requirements. In the real implementation, it actually consists of one or more sub-channel layers such as Basic layer, Security layer, ReliableMessaging layer, Transaction layer, etc. The top ServiceModel layer is the application layer that manages service instances and invokes service operations. It provides Object Models (OM) for people to program with.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;In this layered model of WCF services, the top SericeModel layer is also responsible for building the lower level layers in different hosting environments. It also makes the Transport layer to be freely chosen among different communication protocols. This is why it does not rely on the ASP.NET HTTP pipeline as ASMX services does.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997415" name="_Toc123997415"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Different Hosting Environments&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;As mentioned above, WCF services are hosted by a ServiceHost. Ideally, any application or environment can create ServiceHost to host WCF services. In reality, we classify the different environments into three categories:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="disc"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Windows Activation Service (WAS) hosting environment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;EXE applications&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;NT Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The WAS hosting environment is a broad concept that extends the ASP.NET HTTP pipeline hosting concept for ASMX services. WAS is an NT service in&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/windowsvista/default.mspx" mce_href="http://www.microsoft.com/windowsvista/default.mspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Windows Vista&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;. It is separated out from the legacy IIS as a standalone Windows component that provides protocol-agnostic activation mechanism for different protocols besides HTTP. The IIS, Cassini, and any custom Web Server flavored hosting environments also fall into this category since they share the same WCF service deployment and activation mechanism. I will talk about this more in later sections.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can easily host a WCF service in an EXE application so that you can control the lifetime of the ServiceHost. Furthermore, the WCF service shares the same configuration file with the application. This hosting environment is mostly useful when you also build your client code into the application. A good example is that a sophisticated business application with 3-tier architecture can have WCF services to pass messages between different layers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;NT Services are special EXE applications which are long running and the lifetime is controlled by Service Control Manager (SCM). Because of the long running behavior, you need to be careful of all of different requirements for writing an NT Service: security, reliability, and performance. You can use Microsoft Visual Studio to create managed NT Services with “Windows Service” project type.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997416" name="_Toc123997416"&gt;&lt;/a&gt;&lt;a class="" title="_Toc123970685" name="_Toc123970685"&gt;&lt;/a&gt;&lt;span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;span style="font-family:Verdana;font-size:100%;"&gt;WAS Hosting Environment&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;As mentioned above, a WCF service works similarly as an ASMX Service. For HTTP protocol, it relies on ASP.NET HTTP pipeline to transfer data. For non-HTTP protocols such as Net.Tcp, Net.Pipe, and Net.Msmq etc, it relies on the extensibility points, i.e., ProcessProtocolHandler (PPH) and AppDomainProtocolHandler (ADPH), of ASP.NET to transfer data. We will use the term “&lt;i&gt;protocol handler&lt;/i&gt;” interchangeably to refer to either the ASP.NET HTTP pipeline or the ADPH. In the context of this writing, WCF services hosted in this environment are called&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;WAS hosted services&lt;/i&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;or simply called&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;hosted services&lt;/i&gt;, and in contrast, services hosted in NT Services or EXE applications are called&lt;i&gt;self-hosted services&lt;/i&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Let’s first take a look at a simple hosted service and see how it works.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997417" name="_Toc123997417"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;A Simple Hosted Service&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;A hosted service requires a physical service file with extension&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;“.svc”&lt;/i&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;to be associated with it. Here is the content of a simple service file HelloWorld.svc:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;%@&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;Service Language&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: maroon;"&gt;"C#"&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Class&lt;span style="color: blue;"&gt;=&lt;/span&gt;&lt;span style="color: maroon;"&gt;"HelloWorld.HelloService"&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;%&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;System;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;System.ServiceModel;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;HelloWorld&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[ServiceContract]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;IHelloContract&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[OperationContract]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Hello(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;greeting);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[ServiceBehavior]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;HelloService : IHelloContract&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Hello(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;greeting)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: maroon;"&gt;"You said: "&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;+ greeting;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This file has a Service directive which is enclosed in the “&lt;% %&gt;” block and it also contains inline C# code. The Service directive tells the hosting environment which Service this file points to.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Just as ASMX services, the code can be compiled into a DLL that is deployed to the Global Assembly Cache (GAC), or to the application’s “\bin” directory, or it can be put in a C# file under the application’s “\App_Code” directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;With this service file, we have defined a service contract IHelloContract and the service implementation. However, the service still does not have an endpoint defined yet. You can either define an endpoint declaratively through the configuration file “web.config” or imperatively through code. The latter will be covered separately in a different blog later.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997418" name="_Toc123997418"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Service Configuration&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The service configuration inside the web.config file is very similar as that of self-hosted services. Here is an example of web.config file for the above service:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;?&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;xml&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;version&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;1.0&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;encoding&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;utf-8&lt;/span&gt;"&lt;span style="color: blue;"&gt;?&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;configuration&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.serviceModel&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;services&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;service&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;type&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;HelloWorld.HelloService&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;               &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;endpoint&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;basicHttpBinding&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;                         &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;contract&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;HelloWorld.IHelloContract&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;service&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;services&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.serviceModel&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;configuration&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;I need to point out a few points for this config file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;1)&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;u&gt;Service Type Attribute&lt;/u&gt;: The service type “HelloWorld.HelloService” specified here plays as a lookup key for the corresponding HelloWorld.svc. It tells the hosting environment which service will take the configuration specified here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;2)&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;u&gt;Endpoint Address&lt;/u&gt;: I did not specify the “address” of the endpoint here. The endpoint address is the same as the base address in this case. I will expand this in the next section.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;3)&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;u&gt;Nested web.config&lt;/u&gt;: The service configuration can be specified in nested web.config files. For ASP.NET applications, a web.config file can locate in any sub-directories or virtual web directories as well as the root of the virtual application. All of the settings in the nested web.config files are merged for the virtual ancestors of the directory where the .svc file locates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997419" name="_Toc123997419"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Service Addressing&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The .svc file does not contain much useful information except for providing the service type which is also specified in the web.config file. Then why do we need .svc files after all? The main reason is that we need them to provide intuitive addressing model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Suppose that we drop the above HelloWorld.svc file into a virtual application “/test”, we automatically have the following base address for the service:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;a href="http://localhost/test/HelloWorld.svc" mce_href="http://localhost/test/HelloWorld.svc" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;http://localhost/test/HelloWorld.svc&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can enable different protocols for a single ASP.NET application. Each protocol needs to have a protocol binding for the whole web site. For IIS6 and below, the only protocol that is supported is HTTP (which implies HTTPS).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The WAS hosting environment looks up all enabled protocols for the ASP.NET application and generates the base addresses for the hosted service. Each base address has the following format:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;scheme&gt;://&lt;hostname&gt;[:&lt;port&gt;]/&lt;apppath&gt;/&lt;servicefilename&gt;.svc&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can access the base addresses through the ServiceHostBase.BaseAddresses property. In WCF V1, only one base address is supported for each protocol. So if there are two or more bindings for HTTP is specified, you will get an ArgumentException on the service side with error message “Collection already contains an address with scheme http”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;u&gt;&lt;span style="font-size: 10pt;"&gt;Note&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;: It is NOT recommended to specify an absolute address (with protocol scheme included) to the endpoint in web.config, otherwise, you will get AddressAccessDeniedException on the service side if the address does not match the service base address up to the application path (&lt;apppath&gt;) or EndpiontNotFoundException if you happen to match the application path but not the service path.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997420" name="_Toc123997420"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Service Activation&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The WAS hosting environment is represented by the public type System.ServiceModel.ServiceHostingEnvironment. It is responsible for&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;service activation&lt;/i&gt;, that is,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; text-decoration: none;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;It finds the service compilation information from System.Web.Compilation.BuildManager&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; text-decoration: none;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;It creates the ServiceHost instance to host the service with compilation information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; text-decoration: none;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;It then calls ServiceHost.Open to build the layers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoToc4" style="margin: 0in 0in 0pt 27pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; font-family: Symbol; text-decoration: none;"&gt;&lt;span&gt;&lt;span style="font-size:85%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="color: windowtext; font-style: normal; text-decoration: none;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;It then caches the service and manages its lifetime inside the AppDomain.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This whole process is exposed through the following public method:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; text-indent: 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;EnsureServiceAvailable(&lt;span style="color: blue;"&gt;string&lt;/span&gt;virtualPath)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This API is protocol agnostic. It is an extensible point for a custom protocol handler to activate the service.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The service activation process has the following characteristics:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span&gt;&lt;span style="font-family:Verdana;"&gt;1)&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;u&gt;&lt;span style="font-size: 10pt;"&gt;Activation on demand&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;: A WCF service is activated in the AppDomain only if EnsureServiceAvailable is called by one protocol handler for that service. Once it is activated, it will be active in the AppDomain until the AppDomain is unloaded.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span&gt;&lt;span style="font-family:Verdana;"&gt;2)&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;u&gt;&lt;span style="font-size: 10pt;"&gt;Activation once for all&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;: A WCF service can be activated from any protocol handler. Once it is activated, it is activated for all endpoints and thus all protocols. So when a second protocol handler calls EnsureServiceAvailable, it is a no-op as the service has been activated.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;a class="" title="_Toc123997421" name="_Toc123997421"&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family:Verdana;font-size:85%;"&gt;Service Recycling&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Hosted WCF services enjoy all of the features for ASP.NET applications. One of the major feature is application recycling including AppDomain recycling and process (or AppPool) recycling. There are different factors that can cause application recycling to happen. See “&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconrecyclingapplicationpoolsettings.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconrecyclingapplicationpoolsettings.asp" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;Recycling Application Pool Settings&lt;/span&gt;&lt;/a&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;” for more information about process recycling. When the worker process is recycled, all of the AppDomains in that process are also recycled. The configuration setting&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.configuration.hostingenvironmentsection.idletimeout.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.web.configuration.hostingenvironmentsection.idletimeout.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;HostingEnvironmentSection.IdleTimeout&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;can control AppDomain recycling. Also an AppDomain can be recycled if critical files for the application are changed. These files include web.config, assemblies in the “\bin” directory, code files in the “\App_Code” directory, etc.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Whenever a .svc file is modified in application, the AppDomain is also recycled. This is to simplify the service recycling mechanism. When the AppDomain is recycled, the ServiceHostingEnvironment tries to close all of the cached WCF services in a timely manner. Services not closed timely are aborted at the end. The timeout is controlled by the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.configuration.hostingenvironmentsection.shutdowntimeout.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.web.configuration.hostingenvironmentsection.shutdowntimeout.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;HostingEnvironmentSection.ShutdownTimeout&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;property.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The drawback of service recycling is that all of the sessionful data is lost. This means that Security and ReliableMessaging break when recycling happens. The workaround is to leverage the ASP.NET state service features by enabling AspNetCompatibility mode. I will expand on this in a later blog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-7557808181134412812?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/7557808181134412812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=7557808181134412812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/7557808181134412812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/7557808181134412812'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/hosting-indigo-wcf-service.html' title='Hosting an “Indigo” (WCF) Service'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-1084353911285628711</id><published>2008-11-28T00:39:00.001-08:00</published><updated>2008-11-28T00:39:53.249-08:00</updated><title type='text'>ASP.NET Async Pages vs Async WCF Service Operation</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;In Dmitry’s&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://blogs.msdn.com/dmitryr/archive/2005/06/23/432100.aspx" mce_href="http://blogs.msdn.com/dmitryr/archive/2005/06/23/432100.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;blog&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;, he mentioned about how to write ASP.NET async pages with ASP.NET 2.0. Basically, the server page can handle the request asynchronously without blocking the request thread and the server thread can be returned to the thread pool to handle other requests.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;WCF is quite flexible in supporting asynchronous programming. Actually the client and the service can use any pattern (sync or asnc) in their own way to perform the same operation. For example, you can use the following service contract with an async operation in it:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;[&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;(Namespace =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: maroon;"&gt;"http://tempuri.org"&lt;/span&gt;, Name =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: maroon;"&gt;" HelloService"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;interface&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;IHelloService&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;(IsOneWay =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;, AsyncPattern =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal;"&gt;IAsyncResult&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;BeginHello(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;text,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;AsyncCallback&lt;/span&gt;callback,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;state);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;EndHello(&lt;span style="color: teal;"&gt;IAsyncResult&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;result);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This allows you to implement the service operation in the same way as ASP.NET async pages.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;On the client side, you can access the service either from an async call or a sync call. For example, you can have a sync client to access the above async service operation with the following client contract:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;[&lt;span style="color: teal;"&gt;ServiceContract&lt;/span&gt;(Namespace =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: maroon;"&gt;"http://tempuri.org"&lt;/span&gt;, Name =&lt;span style="color: maroon;"&gt;"HelloService"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;interface&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;IHelloService&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[&lt;span style="color: teal;"&gt;OperationContract&lt;/span&gt;(IsOneWay =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Hello(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;text);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-1084353911285628711?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/1084353911285628711/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=1084353911285628711' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1084353911285628711'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1084353911285628711'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/aspnet-async-pages-vs-async-wcf-service.html' title='ASP.NET Async Pages vs Async WCF Service Operation'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-4203894983124360048</id><published>2008-11-28T00:37:00.002-08:00</published><updated>2008-11-28T00:38:26.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><category scheme='http://www.blogger.com/atom/ns#' term='SVC'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Cannot Find Server (404) or Get Plain Text for WCF .svc Files From IIS?</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;Question&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;After upgrading WCF (or NetFx-3.0) from an older beta version to RC1, I get “Page Not Found” (404) error or get the plain text content of the .svc file for .svc files. Is .svc extension removed from IIS?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;Why&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you installed WCF or NetFx-3.0 RC1 or later versions, you may get this problem. On Windows XP SP2, you may get the plain text of the .svc file. On Windows 2003 Server, you may get error like “Cannot find the page” (404) error. It looks like .svc extension is not supported in IIS.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Is .svc mapping removed from IIS? No. Definitely not! The reason why you saw this is because your IIS Metabase got messed up by an earlier WCF installer due to a nasty bug. You need to clean up the IIS Metabase manually so that it works again. How? Please keep on reading.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Before RC1, there was a bug in WCF installer. It accidentally populates .svc mapping to every path/node in IIS Metabase. This messed up the Metabase and has potential security concern. Fortunately, we found this issue in RC1 and fixed it. By fixing it, we only install .svc mapping to the template of the root /W3SVC of IIS Metabase. However, those machines with earlier WCF beta versions installed still have the messy ScriptMaps. They stop the inheritance of the .svc ScriptMaps from the template at the root /W3SVC. This is especially true for the “Default Web Site” and its virtual applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you create a new web site with WCF RC1 installed, you won’t have this problem for that web site.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:Verdana;"&gt;Solutions&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Here are different ways that can help you to resolve the problem:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Download tool: CleanIISScriptMaps.exe&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Please find the tool “CleanIISScriptMaps.exe” in the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;a href="http://blogs.msdn.com/wenlong/attachment/748294.ashx" mce_href="http://blogs.msdn.com/wenlong/attachment/748294.ashx" style="color: rgb(0, 111, 247);"&gt;attached zip file&lt;/a&gt;. The source for the tool is also included. You also find this tool and corresponding information on &lt;a title="http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx" href="http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx" mce_href="http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span title="http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx" style="font-size: 11pt; font-family: Calibri,sans-serif;"&gt;http://wcf.netfx3.com/files/folders/product_team/entry5648.aspx&lt;/span&gt;&lt;/a&gt;. The usage for this tool is simple, just run it without any argument from any command window. After running it, everything should just work fine. You don’t need to rerun any other setup.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you find that .svc is still not supported for some virtual directories but you want them to be supported as well, you can run the tool with more options to explicitly remove the ScriptMaps properties from those paths. Here is the full usage of the tool:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;Usage: CleanIISScriptMaps &lt;options&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;Options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;By default, the tool removes redundant ScriptMaps properties.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;/f&lt;span&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;Remove ScriptMaps from all nodes in IIS Metabase except for&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;the root "/W3SVC".&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;/p&lt;span&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;Prompt for confirmation when removing ScriptMaps at a node&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 1in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;that is different than that of the root "/W3SVC".&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;/v&lt;span&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;Print out verbose information.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 8pt; color: blue; font-family: 'Courier New';"&gt;/?&lt;span&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;Print this help.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;span style="font-weight: normal; font-size: 10pt; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;Reinstall IIS or re-create web sites&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="StyleStyleVerdanaTimesNewRoman14pt"&gt;&lt;span style="font-weight: normal; font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can uninstall IIS and reinstall it so that the IIS Metabase is cleaned up. Then you will need to run the WCF install tool manually as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /r /y&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you are running Windows 2003 Server, you may be able to delete the “Default Web Site” and re-create it. The problem will be fixed as well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Install .svc manually as a temporary workaround&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can run the following command to install .svc mapping manually. However, this does not clean up the mess of the IIS Metabase. You will see the same problem again when you install newer WCF. So this is the least recommended approach comparing to the above two options:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /s:W3SVC&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Though this does not clean up the Metabase for you, it does not mess up new web sites.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-4203894983124360048?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/4203894983124360048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=4203894983124360048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/4203894983124360048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/4203894983124360048'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/cannot-find-server-404-or-get-plain.html' title='Cannot Find Server (404) or Get Plain Text for WCF .svc Files From IIS?'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-5175027215139834275</id><published>2008-11-28T00:37:00.001-08:00</published><updated>2008-11-28T00:37:58.697-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSDualHttpBinding'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How to use WSDualHttpBinding on Windows XP for Hosted Services</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;On Windows XP, Internet Information Service (IIS) does not use&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/http/http/http_server_api_version_1_0_functions.asp" mce_href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/http/http/http_server_api_version_1_0_functions.asp" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;HTTP.sys&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;which is the HTTP driver that can be used to share HTTP traffic on the same port by multiple applications. This means that when IIS is running, the default port 80 is taken by IIS and no other applications can use it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;So if you use WSDualHttpBinding for your service, the client won’t be able to open the listener against the default port 80 on the same machine and it would fail with AddressAlreadyInUseException.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;To workaround this, you need to change the ClientBaseAddress of WSDualHttpBinding on the client side so that it uses a different port than the one that IIS is using. From client config, you can do the following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.serviceModel&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;client&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;endpoint&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;WSDualOnXP&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;               &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;address&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;http://localhost/WSDualOnXP/HelloWorld.svc&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;               &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;wsDualHttpBinding&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;               &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;bindingConfiguration&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;WSDualOnXP&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;               &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;contract&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;HelloWorldClient.IHelloContract&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;client&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;bindings&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;wsDualHttpBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;WSDualOnXP&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;clientBaseAddress&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://localhost:&lt;b&gt;808&lt;/b&gt;/WSDualOnXP/&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;wsDualHttpBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;bindings&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.serviceModel&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;From code, you can also set the ClientBaseAddress:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;WSDualHttpBinding&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;binding =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;WSDualHttpBinding&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;binding.ClientBaseAddress =&lt;span style="color: maroon;"&gt;"http://localhost:&lt;b&gt;808&lt;/b&gt;/WSDualOnXP/"&lt;/span&gt;;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;On the server side, you don’t have to specify the ClientBaseAddress since the addressing correlation is automatically done by WCF infrastructure.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-5175027215139834275?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/5175027215139834275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=5175027215139834275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5175027215139834275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5175027215139834275'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/how-to-use-wsdualhttpbinding-on-windows.html' title='How to use WSDualHttpBinding on Windows XP for Hosted Services'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-1578966532966884769</id><published>2008-11-28T00:36:00.000-08:00</published><updated>2008-11-28T00:39:09.057-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WINFX'/><category scheme='http://www.blogger.com/atom/ns#' term='CTP'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>WinFX February CTP is released!</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;GREAT NEWS! The WinFX February CTP has just been released today and can be downloaded from&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F51C4D96-9AEA-474F-86D3-172BFA3B828B&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F51C4D96-9AEA-474F-86D3-172BFA3B828B&amp;amp;displaylang=en" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;. Here is the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://msdn.microsoft.com/windowsvista/support/relnotes/winfxfebctp/default.aspx" mce_href="http://msdn.microsoft.com/windowsvista/support/relnotes/winfxfebctp/default.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;readme&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt; document. This CTP has consumed a lot of customer feedback and thus brings quite a lot of breaking changes over the January one. The detailed WCF breaking changes can be found&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://windowscommunication.net/collateral/pages/BreakingChangesJanCTPToFebCTP.htm" mce_href="http://windowscommunication.net/collateral/pages/BreakingChangesJanCTPToFebCTP.htm" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;. The changes include namespaces, APIs, configuration, setup, etc. Ed Pinto has a quick&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="https://blogs.msdn.com/edpinto/archive/2006/02/22/537027.aspx" mce_href="https://blogs.msdn.com/edpinto/archive/2006/02/22/537027.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;blog entry&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;on this.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The biggest change to WebHost is that the .svc file format is changed. This was actually reflected in my earlier blog entries.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Before:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;%&lt;span style="color: maroon;"&gt;@Service&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;language&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;C#&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;Debug&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;class&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;Microsoft.ServiceModel.Samples.CalculatorService&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;%&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;b&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;After:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;%&lt;span style="color: maroon;"&gt;@ServiceHost&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;language&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;C#&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;Debug&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;Service&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;Microsoft.ServiceModel.Samples.CalculatorService&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;%&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can also use the factory model to create your own ServiceHost with the following advanced syntax:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;%&lt;span style="color: maroon;"&gt;@ServiceHost&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;language&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;C#&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;Debug&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Factory&lt;/span&gt;&lt;/b&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;Microsoft.ServiceModel.Samples.CalculatorServiceHostFactory&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;Service&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;Microsoft.ServiceModel.Samples.CalculatorService&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;%&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The Visual Studio CTP for this WinFX can be found at this&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0CE56E-D7B6-44BC-910D-E91F3E370477&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=AD0CE56E-D7B6-44BC-910D-E91F3E370477&amp;amp;displaylang=en" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;link&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The WinFX SDK is also released as part of the larger&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9BE1FC7F-0542-47F1-88DD-61E3EF88C402&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9BE1FC7F-0542-47F1-88DD-61E3EF88C402&amp;amp;displaylang=en" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;Windows SDK&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;which includes pre-release documentation, samples, and tools for both Win32® and WinFX® in Windows Vista.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-1578966532966884769?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/1578966532966884769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=1578966532966884769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1578966532966884769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/1578966532966884769'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/winfx-february-ctp-is-released.html' title='WinFX February CTP is released!'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-2763813189491348930</id><published>2008-11-28T00:34:00.002-08:00</published><updated>2008-11-28T00:36:36.973-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS7'/><title type='text'>What is IIS7?</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;What is IIS7? What is the difference between IIS6 and IIS7? Here are the simple answers:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 39.75pt; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;IIS7 is a new revision (version 7.0) of the Internet Information Services that is shipped on Windows Vista and the next Windows Server version.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 39.75pt; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The most attractive features of IIS7 are: modular design (thanks to the new Windows componentization technology first introduced in Windows Vista), extensible architecture (with public web server APIs), and unified distributed configuration system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 39.75pt; text-indent: -0.25in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; font-family: Wingdings;"&gt;&lt;span&gt;§&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Another big change to IIS7 is that it first introduced a new NT service “Windows Process Activation Service” (WAS). WAS manages application pool configuration and worker processes. This enables process activation through both HTTP and non-HTTP transports.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;More details about IIS7 can be found in the IIS7 public web site:&lt;/span&gt;&lt;a href="http://www.iis.net/" mce_href="http://www.iis.net/" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;http://www.iis.net/&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;When people asked me how to host WCF services on IIS7? I would always say: it is the same as on IIS6. Well, this is generally correct. People still kept on hitting unique problems on IIS7. I will expand this in more details in my future blog entries.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-2763813189491348930?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/2763813189491348930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=2763813189491348930' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/2763813189491348930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/2763813189491348930'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/what-is-iis7.html' title='What is IIS7?'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-6393237428415686248</id><published>2008-11-28T00:34:00.001-08:00</published><updated>2008-11-28T00:36:01.681-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VIRTUAL DIRECTORY'/><category scheme='http://www.blogger.com/atom/ns#' term='APPLICATION'/><title type='text'>Virtual Application vs Virtual Directory</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;People are always confused by these two IIS concepts, especially for the new IIS7/WAS. These are not new concepts. They are available since IIS6 on Windows 2003 Server. However the terms were misused in IIS6 and they are corrected in IIS7 in Windows Vista and higher versions of Windows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Virtual Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;h5 style="margin: 12pt 0in 3pt;"&gt;&lt;em&gt;&lt;span style="font-size:130%;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family: 'Times New Roman';"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;&lt;span style="font-family:Verdana;"&gt;What is it?&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/h5&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The term “virtual application” is a fundamental concept for IIS and ASP.NET. Here is the definition in my own words: a virtual application is a construction unit of a web site that participates protocol listening and process management. It can be uniquely identified by its absolute virtual path from that web site. For example, you can create a virtual application with virtual path “/foo” in the “Default Web Site”. For simplicity, we also call virtual application as "Default Web Site/foo" or simply “/foo”. Every web site has at least one virtual application, a.k.a, the root virtual application “/”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;A web site can be uniquely identified by its site ID. All of the web sites are under the same root “/W3SVC”. So each web site can be represented in the format of “/W3SVC/&lt;siteid&gt;”. For example, the “Default Web Site” can be represented as “/W3SVC/1”. With this, we can uniquely identify a virtual application with its full path, for example,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;/W3SVC/1/Root/foo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you have the IIS6 scripting tool “adsutil.vbs” installed, you would be able to check the settings of the virtual application with the following command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;cscript %systemdrive%\inetpub\adminscripts\adsutil.vbs enum /W3SVC/1/Root/foo&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;&lt;span style="font-family:Verdana;"&gt;Protocol Listening&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h5&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;When you create a virtual application, you would expect your new virtual application to receive requests that are dedicated to it. There are two aspects of “protocol listening”:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;For a particular protocol (for example HTTP), a web site is nothing but a list of virtual applications. This means that the protocol activation service (which is IIS or W3SVC in the HTTP case) registers a list of Urls in the protocol listener service (which is HTTP.sys driver for HTTP). Each of this Url is associated with a virtual application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You can specify which protocol is enabled for a virtual application. In IIS6, you can specify HTTP or HTTPS. In IIS7, however, you can specify any protocol(s) through the “enabledProtocols” property of the virtual application. For example, you can specify protocols “net.tcp”, “net.pipe”, “net.msmq”, or “msmq.formatname” that are implemented by WCF.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h5 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;&lt;span style="font-family:Verdana;"&gt;Application Pool&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h5&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The other aspect of a virtual application is that it also participates in process management. IIS/WAS has the concept of application pools. An application pool is a definition or template of a worker process (w3wp.exe) that is used by IIS/WAS to create new worker process instances. Two most important properties of an application pool are:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;It has an identity which is the running account of the worker process in this pool. You can configure the identity to a specific account so that you can achieve security isolation from other pools.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;It has a list of settings to control the health of worker processes running in this pool. For example, you can set process recycling and idle timeout, enable debugging, configure&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;st1:place st="on"&gt;&lt;st1:placename st="on"&gt;Web&lt;/st1:placename&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;st1:placetype st="on"&gt;Gardens&lt;/st1:placetype&gt;&lt;/st1:place&gt;, or enable Rapid-Fail Protection (RFP), etc. For IIS6, more information can be found at&lt;/span&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/c9b5db6f-874e-4ec9-93ed-1733367c117b.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/c9b5db6f-874e-4ec9-93ed-1733367c117b.mspx?mfr=true" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/c9b5db6f-874e-4ec9-93ed-1733367c117b.mspx?mfr=true&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Each virtual application must be assigned to an application pool in IIS. All of the requests (except for static content) will be handled in worker processes in that application pool.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;Please note that Application Pool is managed by WAS instead of IIS in the IIS7 family. This separation makes non-HTTP activation possible. With this refactoring, “IIS” is simply the web server that only handles HTTP/HTTPS requests.&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h5 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;em&gt;&lt;span style="font-family:Verdana;"&gt;ASP.NET Application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h5&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;For ASP.NET, a virtual application has its real meaning as an “&lt;i&gt;application&lt;/i&gt;”. When an ASP.NET request is first received in a virtual application, a new AppDomain is created in the worker process that handles subsequent ASP.NET requests. This includes all WCF requests. So in the ASP.NET world, a virtual application is mapped to an AppDomain. This provides important code isolation for managed applications that sits in the same worker process. It is even more important for web hosting when the applications are running in the partial trust environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Virtual Directory&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Isn’t “virtual directory” the same as “virtual application”? In IIS6, from the IIS Manager (UI), if you right click on “Default Web Site” -&gt; New, you will see “Virtual Directory …” from the list. What is going on there? Well, as I said, the terms are misused in IIS6. When it says “Virtual Directory”, it actually means “Virtual Application”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Am I kidding? No. A real “virtual directory” is just a container of files. It is a construction unit of a virtual application, just like a virtual application to a web site. A virtual application must have at least one virtual directory. Here is a sample configuration section that defines the virtual application “/foo” and its virtual directories in the WAS' configuration file %windir%\system32\inetsrv\config\applicationhost.config:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;sites&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;site&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;Default Web Site&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;id&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;1&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;application&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;path&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;/foo&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;enabledProtocols&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;virtualDirectory&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;path&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;/&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;physicalPath&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;c:\inetpub\foo&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;virtualDirectory&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;path&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;/bar&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;physicalPath&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"\&lt;span style="color: blue;"&gt;\myremote1\bar&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 24pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;application&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; text-indent: 24pt;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;site&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;sites&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Note that the virtual directory “/bar” points to a different physical path, actually it points to a network share (UNC) path!&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;How can we create a&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;i&gt;real&lt;/i&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;virtual directory in IIS6 then? It is a little bit trickier from the UI. In the IIS Manager UI, you can right click on the virtual application and then click on New -&gt; “Virtual Directory …”. After specifying the alias and path, you will get the virtual directory using all default settings.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;However, there is another trick to convert a virtual application into a virtual directory. Here are the steps:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Create a virtual application “/foo” and a sub virtual application “/foo/bar”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Right click on the virtual application “/foo/bar” and select properties. You will see the properties dialog popped up.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Under the “Virtual Directory” tab, look for the “Remove” button. See the image below:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;img src="http://blogs.msdn.com/photos/wdong/images/1123959/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123959/original.aspx" hspace="50" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Click the “Remove” button and click on “OK” button.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Now you have created a virtual directory “/bar” under the virtual application “/foo”. The icon for the virtual application is different than that of the virtual application. Here is what you will see:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;o:p&gt;&lt;img src="http://blogs.msdn.com/photos/wdong/images/1123956/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123956/original.aspx" style="width: 438px; height: 260px;" width="438" height="260" hspace="50" /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 12pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Nesting&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Virtual applications and virtual directories can be nested, meaning, a virtual application or directory can be created under another virtual application or directory in any combinations.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This nesting has the following implications:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The virtual path of the parent application/directory is the prefix of the child application/directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;For ASP.NET, the web.config of the parent virtual application/directory affects the child application/directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;For ASP.NET, the assemblies referenced by the parent virtual application are inherited by the children.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Other than those, virtual applications still have their own isolation that I mentioned in the above sections.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-6393237428415686248?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/6393237428415686248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=6393237428415686248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/6393237428415686248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/6393237428415686248'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/virtual-application-vs-virtual.html' title='Virtual Application vs Virtual Directory'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-5376944994544512677</id><published>2008-11-28T00:34:00.000-08:00</published><updated>2008-11-28T00:35:54.940-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WAS'/><category scheme='http://www.blogger.com/atom/ns#' term='installation'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS7'/><title type='text'>IIS7/WAS Installation</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;IIS7 has a modular design which allows you to selectively install components that are needed. This design is based on the new manifest-driven Componentization technology that was first introduced in Windows Vista. As the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://www.iis.net/default.aspx?tabid=7" mce_href="http://www.iis.net/default.aspx?tabid=7" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-family:Verdana;"&gt;IIS site&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:Verdana;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;claimed, there are more than 40 standalone feature components of IIS7 which can be independently installed. This is good or bad. The good part is that IT professionals can easily customize the installation as needed. The bad part is that it’s hard for developers to understand which components are needed. Here I would like to write something regarding the latter.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you are familiar with CMI (Component Management Interface) or CBS (Component Based Setup), you would know that there are many different ways to install components on&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;st1:place st="on"&gt;Vista&lt;/st1:place&gt;. You can use the GUI interface (called Software Explorer) which is available from “Control Panel” -&gt; Programs -&gt; “Turn Windows features on or off”. Or you can use command-line tools such as pkgmgr.exe or ocsetup.exe (which is a wrapper of pkgmgr.exe). I will talk about the simplest approach, GUI interface, below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;Minimal Installation: Installing WAS&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;The minimal installation of the whole IIS7 package is to install the Windows Process Activation Service (WAS). WAS is a standalone feature and it is the only feature from the IIS7 family that is available for all Windows Vista client SKUs (Basic, Home, Business, and Ultimate, etc).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;From the “Turn Windows features on or off” UI of the control panel, you will see the WAS component listed in the list as in the following image:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;o:p&gt;&lt;img src="http://blogs.msdn.com/photos/wdong/images/1123454/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123454/original.aspx" hspace="50" /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This feature has three sub-components:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;.NET Environment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Configuration APIs&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Process Model&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you select the root node of WAS, only the “Process Model” sub-node is checked to be installed by default with the root. Please note that with this installation, you still cannot do anything interesting today. It only means that you can get WAS to work.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;If you further check the “Internet Information Services” feature from the feature list, you will find out that the “Configuration APIs’ node is automatically checked.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;In order to make WCF or any ASP.NET application to work, you need to further check the sub-node “.NET Environment”. This means that all of WAS components are needed in order to make WCF/ASP.NET to work well. Fortunately these are automatically checked once you install any of those components.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;IIS7: Default Installation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;By simply checking the “Internet Information Services” feature from the UI, you will see that quite some sub-nodes are automatically marked as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;o:p&gt; &lt;img src="http://blogs.msdn.com/photos/wdong/images/1123458/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123458/original.aspx" style="width: 373px; height: 503px;" width="373" height="503" hspace="50" /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This is the default installation of IIS7. In this way, you can use IIS7 to service static content (such as HTML pages etc). However, you can’t run ASP.NET or CGI applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;IIS7: Installlation with ASP.NET support&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;From the above image, it’s obvious that you need to install “ASP.NET” to make ASP.NET work on IIS7. After checking “ASP.NET”, you will find the following UI:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;&lt;o:p&gt;&lt;img src="http://blogs.msdn.com/photos/wdong/images/1123459/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123459/original.aspx" style="width: 373px; height: 503px;" width="373" height="503" hspace="50" /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;This is the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;minimal environment&lt;/i&gt;&lt;/b&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;for both WCF and ASP.NET applications to work in IIS7.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;Installation with IIS6 Compatibility Components&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;Many people still have problems with the above installation when they run Visual Studio 2005 or some automation scripts/tools (for example, adsutil.vbs) to configure virtual applications. The main reason is because those tools depend on the legacy IIS6 Metabase API support as well as the legacy IIS6 scripting tools. Here is the UI that shows what are missing from above:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt; &lt;img src="http://blogs.msdn.com/photos/wdong/images/1123471/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123471/original.aspx" style="width: 438px; height: 411px;" width="438" height="411" hspace="50" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You need to check “IIS 6 Scripting Tools” (which automatically checks other three subnodes of “IIS 6 Management Compatibility”). After that, you will see the following UI:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;span style="font-family:Verdana;"&gt;&lt;img src="http://blogs.msdn.com/photos/wdong/images/1123460/original.aspx" mce_src="http://blogs.msdn.com/photos/wdong/images/1123460/original.aspx" style="width: 438px; height: 411px;" width="438" height="411" hspace="50" /&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;With this installation, you are good to play with IIS7, ASP.NET, and WCF features and samples available on the web.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 12pt 0in 3pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Verdana;"&gt;Maximum Installation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;&lt;span class="StyleVerdana"&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="font-family:Verdana;"&gt;You may want to play with other components that are not installed by default. To install them, you can simply go through the whole tree of the IIS and check every leaf node. In this way, you will get the full IIS7 feature set installed.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-5376944994544512677?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/5376944994544512677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=5376944994544512677' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5376944994544512677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/5376944994544512677'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/iis7was-installation.html' title='IIS7/WAS Installation'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-6325431724606779300</id><published>2008-11-28T00:32:00.002-08:00</published><updated>2008-11-28T00:34:02.743-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Double identities'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><title type='text'>Impersonation with Double Identities</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;There are two different levels of security that you can use for WCF services: Message level and Transport level. For Transport level, in HTTP case, you can use different IIS Authentication mechanisms to perform client authentication. If you do not carefully set the settings of the WCF binding, you may end up with both security levels enabled. This has a direct impact of impersonation. The reason is because WCF does not know which identity you want to apply to impersonation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Generally, it is not recommended to have double securities enabled. However, there is actually a reason why people could get into this dilemma:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;ul style="margin-top: 0in;" type="square"&gt;&lt;li class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;It is normal for people to disable anonymous access in IIS. In WCF, we want to make sure that a service explicitly specifies its transport level security settings. In this case, it means that you have to configure the service to not use anonymous authentication at transport layer. So when you also want to enable message-level security to perform message signing or encryption, you would get into this double-identity situation.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Here is a simple custom binding configuration that demonstrates how it is the case of double identities:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;customBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; color: blue; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;mixedSecureBinding&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;         &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;security&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;         &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;httpTransport&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;authenticationScheme&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;Ntlm&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;customBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;It enables both message-level security and it also enables the NTLM authentication at the transport layer.&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;In this case, if you have an operation which requires impersonation, you would get the following error on the server side (you can see it from a debugger):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;System.InvalidOperationException: Cannot start impersonation because the SecurityContext for the UltimateReceiver role from the request message with the 'http://www.microsoft.com/test/IHelloContract/Hello' action is not mapped to a Windows identity.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;This is because WCF actually set the ServiceSecurityContext to WindowsIdentity.Anonymous when multiple identifies are found.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;There are three different ways to resolve this issue.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 12pt 0in 3pt 0.25in; text-indent: -0.25in; line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;1.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 7pt; font-family: Cambria,serif;"&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Enable Anonymous Access from IIS&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;This is the simplest way, though there is a security concern for this approach. Here is the binding configuration that does not have the transport-layer authentication enabled:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;customBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 12pt; color: blue; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;mixedSecureBinding&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;         &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;security&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;         &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;httpTransport&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;binding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;customBinding&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;You have to enable the anonymous access in IIS to make this work, otherwise you would get ServiceActivationException on the server side due to mismatched settings between WCF binding and IIS.&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;This is not the ideal solution if you have other services in the same application that you want to have anonymous access disabled for security purpose.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 12pt 0in 3pt 0.25in; text-indent: -0.25in; line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;2.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 7pt; font-family: Cambria,serif;"&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Use Imperative Impersonation&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;When I said impersonation would fail above, I meant declarative (or automatic) impersonation. Here is the sample service operation that does this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;[&lt;span style="color: teal;"&gt;OperationBehavior&lt;/span&gt;(Impersonation =&lt;span style="color: teal;"&gt;ImpersonationOption&lt;/span&gt;.Required)]&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Hello(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;greeting)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman',serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;To use imperative impersonation, you need to remove the “Impersonation” setting from the above declaration and perform impersonation from code. This requires having a Windows identity being retrieved from the context. Fortunately WCF provides a way for you to find the identities that are available in the stack:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: teal; font-family: 'Courier New';"&gt;OperationContext&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;.Current.ServiceSecurityContext.AuthorizationContext.Properties[&lt;span style="color: maroon;"&gt;"Identities"&lt;/span&gt;]&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;You can cast this into List&lt;iidentity&gt; and examine each identity of them. You cannot tell which identity is from which layer though. However, in WCF V1, the identity from the transport layer is always the first one. But this is guaranteed in future versions.&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Once you have the Windows identity, you can perform the impersonation by yourself:&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Verdana,sans-serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;(identity.Impersonate())&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;// Do something&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman',serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 12pt 0in 3pt 0.25in; text-indent: -0.25in; line-height: normal;"&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;3.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 7pt; font-family: Cambria,serif;"&gt;    &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Remove Unnecessary Identities Using Custom Authorization Policy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;If you are still not satisfied by the above approaches, here is another choice for you. You need to use the ServiceAuthorizationBehavior.ExternalAuthorizationPolicies extension point to add an extra authorization policy to remove identities which are not needed. Here is a good sample about how to implement a custom authorization policy:&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;a href="http://msdn2.microsoft.com/en-gb/library/aa702720.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="color: blue;"&gt;http://msdn2.microsoft.com/en-gb/library/aa702720.aspx&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;In our case, we can implement the Evaluate() method of the custom MyAuthorizationPolicy as following so that the last identity is picked:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;bool&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Evaluate(&lt;span style="color: teal;"&gt;EvaluationContext&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;evaluationContext,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;ref&lt;/span&gt;&lt;span style="color: blue;"&gt;object&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;state)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal;"&gt;IList&lt;/span&gt;&lt;&lt;span style="color: teal;"&gt;IIdentity&lt;/span&gt;&gt; identities = evaluationContext.Properties[&lt;span style="color: maroon;"&gt;"Identities"&lt;/span&gt;]&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;as&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;IList&lt;/span&gt;&lt;&lt;span style="color: teal;"&gt;IIdentity&lt;/span&gt;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;(identities !=&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;null&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&amp;amp;&amp;amp; identities.Count &gt; 1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// Pick the last one (which is likely to be the identity embeded in the message.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;evaluationContext.Properties[&lt;span style="color: maroon;"&gt;"Identities"&lt;/span&gt;] =&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;List&lt;/span&gt;&lt;&lt;span style="color: teal;"&gt;IIdentity&lt;/span&gt;&gt;(&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;IIdentity&lt;/span&gt;[] { identities[identities.Count - 1] });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Times New Roman',serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Times New Roman',serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;Now you can configure the Authorization behavior in your ServiceHost. You need to implement ServiceHostFactory so that this custom behavior can be added to the ServiceHost. Here is an implementation of the CreateServiceHost method:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;override&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceHostBase&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;CreateServiceHost(&lt;span style="color: blue;"&gt;string&lt;/span&gt;constructorString,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;Uri&lt;/span&gt;[] baseAddresses)&lt;/span&gt;&lt;span style="font-size: 12pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;serviceHost =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span style="color: teal;"&gt;ServiceHost&lt;/span&gt;(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: teal;"&gt;HelloService&lt;/span&gt;), baseAddresses);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;serviceHost.Authorization.ExternalAuthorizationPolicies =&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;ReadOnlyCollection&lt;/span&gt;&lt;&lt;span style="color: teal;"&gt;IAuthorizationPolicy&lt;/span&gt;&gt;(&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;IAuthorizationPolicy&lt;/span&gt;[] {&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;new&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: teal;"&gt;MyAuthorizationPolicy&lt;/span&gt;()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;});&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;serviceHost;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.25in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 12pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;The sample code for this blog entry is&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;a title="Sample code" href="https://blogs.msdn.com/wenlong/attachment/1180257.ashx" target="_blank" style="color: rgb(0, 111, 247);"&gt;&lt;span style="color: blue;"&gt;attached&lt;/span&gt;&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-6325431724606779300?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/6325431724606779300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=6325431724606779300' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/6325431724606779300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/6325431724606779300'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/impersonation-with-double-identities.html' title='Impersonation with Double Identities'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-4473966046570195271</id><published>2008-11-28T00:32:00.001-08:00</published><updated>2008-11-28T00:33:56.391-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS6'/><category scheme='http://www.blogger.com/atom/ns#' term='WSDL'/><title type='text'>How to change HostName in WSDL for an IIS-hosted service?</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;If you have a web-hosted service “simple.svc” under the virtual application “/simple”, you would probably get the following service address in the WSDL:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:service name&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;SimpleService&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:port name&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;BasicHttpBinding_ISimpleContract&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;binding&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;tns:BasicHttpBinding_ISimpleContract&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;soap:address&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;location&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;b&gt;http://mycomputer.private.mydomain.com/simple/Simple.svc&lt;/b&gt;&lt;span style="color: blue;"&gt;" /&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:port&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:service&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;The host name “&lt;span&gt;mycomputer.private.mydomain.com&lt;/span&gt;” is automatically picked up by WCF. In the real production environment, you would want to use a public host name or even an IP address in the address. Here are a few steps that can help you to make the change:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="margin: 0in 0in 10pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;&lt;span&gt;1)&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Change IIS Site Binding&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;WCF populates service base addresses based on IIS site bindings. The format of a site binding looks like “&lt;ip&gt;:&lt;port&gt;:&lt;hostname&gt;”. For HTTP, the default site binding for the default web site is “:80:”. This means that the service can receive messages from any IP addresses for the host and it uses “weak” wildcard for address registration. You need to change it to be an “exact” host name for the site so that it shows up in your service base address. You can use the IIS utility tool adsutil.vbs (or appcmd.exe on IIS7) to achieve that.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;You can query your current site bindings for the default web site as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;cscript //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs get W3SVC/1/ServerBindings&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Here is the command to change it:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;cscript //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs set W3SVC/1/ServerBindings “:80:www.fancydomain.com”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;You can also change it from IIS Manager UI. For HTTPS, the following command would work:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;cscript //nologo %systemdrive%\inetpub\adminscripts\adsutil.vbs set W3SVC/1/&lt;b&gt;SecureBindings&lt;/b&gt;“:443:www.fancydomain.com”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraph" style="margin: 0in 0in 10pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;&lt;span&gt;2)&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Recycle the AppDomain&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Once you changed IIS settings, WCF does not automatically pick up the changes from IIS Metabase. You have to recycle the current AppDomain for the virtual application. There are a few different ways to do that:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Change web.config file for the virtual application&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Kill w3wp.exe process&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Symbol;"&gt;&lt;span&gt;·&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Run “iisreset.exe”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.25in; text-indent: -0.25in;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;&lt;span&gt;3)&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Query the WSDL&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: Cambria,serif;"&gt;Now when you query the WSDL of your service, you will see the new addresses:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:service name&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;SimpleService&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:port name&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;BasicHttpBinding_ISimpleContract&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;binding&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;="&lt;/span&gt;&lt;b&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;tns:BasicHttpBinding_ISimpleContract&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;"&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;soap:address&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(153, 0, 0);"&gt;location&lt;/span&gt;&lt;span style="color: blue;"&gt;="&lt;/span&gt;&lt;b&gt;http://www.fancydomain.com /simple/Simple.svc&lt;/b&gt;&lt;span style="color: blue;"&gt;" /&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:port&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 9pt; color: rgb(153, 0, 0); font-family: Cambria,serif;"&gt;wsdl:service&lt;/span&gt;&lt;span style="font-size: 9pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-4473966046570195271?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/4473966046570195271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=4473966046570195271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/4473966046570195271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/4473966046570195271'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/how-to-change-hostname-in-wsdl-for-iis.html' title='How to change HostName in WSDL for an IIS-hosted service?'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-7671144651645560838</id><published>2008-11-28T00:32:00.000-08:00</published><updated>2008-11-28T00:33:19.845-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>How to use .asmx extension to handle WCF requests?</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;For backward compatibility, WCF supports easy server-side migration from ASMX to WCF. This is good news for existing ASMX customers. Generally, the clients of ASMX may have server Urls hard-coded with the extension “.asmx”. For example, here is a sample Url:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;a href="http://www.myserver.com/foo/MyService.asmx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size:100%;color:#0000ff;"&gt;http://www.myserver.com/foo/MyService.asmx&lt;/span&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;After installing WCF on the box, you can let WCF to handle the same client requests. Here are the steps about how to achieve this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 10pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:100%;color:#4f81bd;"&gt;Replace BuildProvider for ASMX&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;You need to use the WCF service build provider for .asmx extension by seting the following in the web.config file of your virtual application:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.web&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;compilation&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;buildProviders&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;remove&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;extension&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;.asmx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;add&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;extension&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;.asmx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.ServiceModel.Activation.ServiceBuildProvider, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;buildProviders&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;compilation&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.web&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;When WCF is running in the Mixed Transport mode (instead of AspNetCompatibility mode), WCF would intercept the request based on the BuildProvider information for the extension.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 10pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:100%;color:#4f81bd;"&gt;Replace HttpHandler for ASMX&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;If you are running WCF in AspNetCompatibility mode, you would also need to change the HttpHandler s for .asmx to the WCF HttpHandler. On IIS6, you just need to have something as following in your config:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.web&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;httpHandlers&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;remove&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;path&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;*.asmx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;verb&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*&lt;/span&gt;"&lt;span style="color: blue;"&gt;&gt;&lt;/&lt;/span&gt;&lt;span style="color: maroon;"&gt;remove&lt;/span&gt;&lt;span style="color: blue;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;add&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;path&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;*.asmx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;verb&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/span&gt;"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;validate&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;false&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;httpHandlers&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.web&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;On IIS7, things are different. IIS7 introduces two different HTTP pipelines: Integrated and Classic. The latter works similar as IIS6 in the way that all of the managed requests go through the ASP.NET ISAPI filter. When this happens, the HttpModules and HttpHandlers defined in web.config files would be invoked for the corresponding requests.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;When the virtual application is running in the Integrated mode, however, the modules and handlers defined in web.config files under the &lt;system.web&gt; section are totally ignored. All of the requests are handled straightforward by IIS7. So you need to make sure that you have integrated handlers defined for the corresponding extensions. We can set the following in the web.config of the virtual application to achieve this:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.webServer&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;handlers&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;remove&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;WebServiceHandlerFactory-Integrated&lt;/span&gt;"&lt;span style="color: blue;"&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;     &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;add&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;name&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;MyNewAsmxHandler&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;path&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*.asmx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;verb&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;*&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;type&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;preCondition&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;integratedMode,runtimeVersionv2.0&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;handlers&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;validation&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: Cambria,serif;"&gt;validateIntegratedModeConfiguration&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: Cambria,serif;"&gt;"&lt;span style="color: blue;"&gt;false&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: Cambria,serif;"&gt;system.webServer&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: Cambria,serif;"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;The section &lt;system.webserver&gt; is actually rooted in %windir%\system32\inetsrv\config\applicationhost.config instead of in the root web.config in %windir%\Microsoft.Net\Framework{64}\v2.0.50727\config. The &lt;remove&gt; element takes the “name” as the key instead of the “path” as we did to the &lt;system.web&gt; section. You must specify “validateIntegratedModeConfiguration” to false to make IIS happy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 10pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:100%;color:#4f81bd;"&gt;Correct SOAP Actions&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Once you configured above settings, you can create a .asmx file which looks exactly as a .svc file. For example, you can have the following content:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;&lt;% @ServiceHost language = "c#" Factory="HelloWorld.SimpleServiceHostFactory" %&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Now you can browse your service with an .asmx extension. At this point, all requests will go through happily into WCF channel stack.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;One last thing that you need to be aware is that you need to make sure your WCF service is backward compatible to ASMX so that ASMX clients can communicate with it. Basically you need to use the interoperable binding such as BasicHttpBinding. And you need to make sure the request/response SOAP actions are expected for ASMX clients. Here is an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;[&lt;span style="color: rgb(43, 145, 175);"&gt;ServiceContract&lt;/span&gt;(Name =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"RequestReplyService"&lt;/span&gt;, Namespace =&lt;span style="color: rgb(163, 21, 21);"&gt;"http://myoldasmxworld.org/"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;interface&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;IRequestReplySyncServiceAsmx&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[&lt;span style="color: rgb(43, 145, 175);"&gt;OperationContract&lt;/span&gt;(IsOneWay =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;false&lt;/span&gt;, Action =&lt;span style="color: rgb(163, 21, 21);"&gt;"http://myoldasmxworld.org/HelloRequestReply"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;HelloRequestReply(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;text);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;It is compatible to the following ASMX web service:&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;[&lt;span style="color: rgb(43, 145, 175);"&gt;WebService&lt;/span&gt;(Name =&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;"MyAsmxService"&lt;/span&gt;, Namespace =&lt;span style="color: rgb(163, 21, 21);"&gt;"http://myoldasmxworld.org/"&lt;/span&gt;)]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;public&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;AsmxRequestReplyService&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;[&lt;span style="color: rgb(43, 145, 175);"&gt;WebMethod&lt;/span&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;HelloRequestReply(&lt;span style="color: blue;"&gt;string&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;text)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// Implementation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-7671144651645560838?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/7671144651645560838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=7671144651645560838' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/7671144651645560838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/7671144651645560838'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/how-to-use-asmx-extension-to-handle-wcf.html' title='How to use .asmx extension to handle WCF requests?'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-3691333518712982176</id><published>2008-11-28T00:31:00.000-08:00</published><updated>2008-11-28T00:32:02.887-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='IIS6'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><category scheme='http://www.blogger.com/atom/ns#' term='IIS7'/><title type='text'>How to redirect a Url in IIS6/IIS7 and in ASP.NET?</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;div style="border-style: none none solid; border-width: medium medium 1pt; border-bottom: 1pt solid rgb(79, 129, 189); padding: 0in 0in 4pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Sometimes you want to redirect users request to a different one when you want to retire old ones but still provide backward-compatibility. David Wang has a good summary on different redirects for IIS in his&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;a href="http://blogs.msdn.com/david.wang/archive/2005/08/01/HOWTO_Common_URL_Redirection_Techniques_for_IIS_Summary.aspx" style="color: rgb(0, 111, 247);"&gt;&lt;span style="font-size:100%;"&gt;blog entry&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:100%;"&gt;. Here I just want to add a few points which have helped people to resolve tricky problems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;First of all, as David pointed out, there are two (or three in David’s terms) types of redirects:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;u&gt;&lt;span style="font-family: Cambria,serif;"&gt;Client-side redirection&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Cambria,serif;"&gt;: the server sends a “302 Redirect” response to the client together with the new location header.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;u&gt;&lt;span style="font-family: Cambria,serif;"&gt;Server-side redirection&lt;/span&gt;&lt;/u&gt;&lt;span style="font-family: Cambria,serif;"&gt;: the server rewrites the request with another URL transparently and the client is not aware of anything.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 10pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:100%;color:#4f81bd;"&gt;Client-side redirection&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;It is also called HTTP redirection. You can achieve it in the following ways.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 10pt 0in 0pt;"&gt;&lt;em&gt;&lt;span style="font-family:Cambria;color:#4f81bd;"&gt;Redirect in IIS6&lt;/span&gt;&lt;/em&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;You can use the&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;b&gt;HttpRedirect&lt;/b&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Metabase setting to perform redirection in IIS6. This property can be set to a virtual application, a file, or a virtual directory (a.k.a. web folder). It requires the physical existence of these “source” items. To achieve that, you can use IIS Manager. Here are the steps on how to set it for a file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Right click on the file and click on Properties&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Click on “File” tab of the dialog&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Select “A redirection to a URL” radio box&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Type in your new Url, and/or make any other changes, and click OK.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;After this, you would have setup the file so that all requests to this file is redirected to the new Url. You can check the Metabase setting with the following command:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New';"&gt;cscript.exe %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs get /w3svc/1/Root/foo/p1.aspx/HttpRedirect&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;If the file does not have any Metabase property pre-defined in the Metabase, you cannot use adsutil.vbs to set this property. But you can set it with the script to a virtual application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 10pt 0in 0pt;"&gt;&lt;em&gt;&lt;span style="font-family:Cambria;color:#4f81bd;"&gt;Redirect in IIS7&lt;/span&gt;&lt;/em&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;In IIS7, the concept is similar as that of IIS6. You can use the new command “appcmd.exe” to enable redirection as following:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt 0.5in;"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: 'Courier New';"&gt;%windir%\system32\inetsrv\appcmd set config "Default Web Site/foo" -section:system.webServer/httpRedirect -enabled:true -destination:"http://localhost/bar/p1.aspx"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;This tells IIS to redirect all request sending to the virtual application “/foo” to “/bar/p1.aspx”. The actual result is that appcmd.exe adds the following section to the web.config file for the application “/foo”:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.webServer&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;httpRedirect&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; color: red; font-family: 'Courier New';"&gt;enabled&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;=&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;/span&gt;&lt;span style="color: red;"&gt;destination&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;http://localhost/bar/bbb.aspx&lt;/span&gt;"&lt;span style="color: blue;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;/&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&lt;/&lt;/span&gt;&lt;span style="font-size: 10pt; color: maroon; font-family: 'Courier New';"&gt;system.webServer&lt;/span&gt;&lt;span style="font-size: 10pt; color: blue; font-family: 'Courier New';"&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 10pt 0in 0pt;"&gt;&lt;em&gt;&lt;span style="font-family:Cambria;color:#4f81bd;"&gt;Redirect with ASP.NET&lt;/span&gt;&lt;/em&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;You can also use ASP.NET to implement client-side redirection. If you don’t want ASP.NET pipeline to intercept any such request, you would need to implement the logic in the global.asax file. This is important for WCF applications since WCF intercepts requests from the pipeline for WCF requests. Here is some sample code for a global.asax file:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;%@ Application Language=&lt;span style="color: maroon;"&gt;"C#"&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Debug=&lt;span style="color: maroon;"&gt;"true"&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;%&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;script runat="&lt;span" style="color: maroon;"&gt;"server"&lt;/span&gt;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// This is the application file that handles ASP.NET application-level&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// events. It works for ASP.NET HTTP pipeline. Note that this mechanism&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: green;"&gt;// does not work for non-HTTP case.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;Application_BeginRequest(&lt;span style="color: blue;"&gt;object&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;sender, EventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt;.Compare(&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Request.Url.AbsolutePath,&lt;span style="color: maroon;"&gt;"/foo/p1.aspx"&lt;/span&gt;, StringComparison.OrdinalIgnoreCase) == 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;           &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Response.Redirect(&lt;span style="color: maroon;"&gt;"/foo/p2.aspx"&lt;/span&gt;,&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;span&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;       &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;span&gt;   &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: 'Courier New';"&gt;&lt;/script&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;This approach is more flexible than those provided by IIS:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;It does not require the existence of the physical file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;It is imperative and thus you can add any custom programming logic to determine whether you want to redirect the request. For example, you can check the query string to see whether it contains the information that requires a redirection.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style="margin: 10pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:100%;color:#4f81bd;"&gt;Server-side redirection&lt;/span&gt;&lt;/h3&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;It is sometimes also called Url rewriting or Url aliasing. One of the advantages for server-side redirection is performance because there is no round-trip involved if the redirection is on the same machine.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style="margin: 10pt 0in 0pt;"&gt;&lt;em&gt;&lt;span style="font-family:Cambria;color:#4f81bd;"&gt;Redirect with ASP.NET&lt;/span&gt;&lt;/em&gt;&lt;/h4&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;You can use ASP.NET to implement the server-side redirection with Server.Transfer(path) method.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6277951066083602277-3691333518712982176?l=kaushikrabadiya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kaushikrabadiya.blogspot.com/feeds/3691333518712982176/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6277951066083602277&amp;postID=3691333518712982176' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/3691333518712982176'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6277951066083602277/posts/default/3691333518712982176'/><link rel='alternate' type='text/html' href='http://kaushikrabadiya.blogspot.com/2008/11/how-to-redirect-url-in-iis6iis7-and-in.html' title='How to redirect a Url in IIS6/IIS7 and in ASP.NET?'/><author><name>Kaushik Rabadiya</name><uri>http://www.blogger.com/profile/12496254545694993258</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6277951066083602277.post-1617007415296482390</id><published>2008-11-28T00:30:00.000-08:00</published><updated>2008-11-28T00:32:07.625-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='WCF WebHost'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><title type='text'>WCF Request Throttling and Server Scalability</title><content type='html'>&lt;span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Tahoma; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;h1 style="margin: 24pt 0in 0pt;"&gt;&lt;span style="font-family:Cambria;font-size:180%;color:#365f91;"&gt;Two Threads per Request&lt;/span&gt;&lt;/h1&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;In .NET 3.0 and 3.5, there is a special behavior that you would observe for IIS-hosted WCF services. Whenever a request comes in, the system would use two threads to process the request:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 37.5pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;One thread is the CLR ThreadPool thread which is the worker thread that comes from ASP.NET.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 37.5pt; text-indent: -0.25in;"&gt;&lt;span style="font-family: Symbol;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;·&lt;/span&gt;&lt;span style="font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;        &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;Another thread is an I/O thread that is managed by the WCF IOThreadScheduler (actually created by ThreadPool.UnsafeQueueNativeOverlapped).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;When you have a high latency request, you would see the following callstack in the debugger before the request is completed (with&lt;span&gt; &lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;.NET 3.5):&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6ee8c 5094dad5 mscorlib_ni!System.Threading.WaitHandle.WaitOne()+0xa&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6ee8c 50951e3b System_ServiceModel_ni!System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(System.Web.HttpApplication, Boolean)+0x8d&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6eeb4 65fe626d System_ServiceModel_ni!System.ServiceModel.Activation.HttpModule.ProcessRequest(System.Object, System.EventArgs)+0x143&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0214e4f4 65fe3fd1 System_Web_ni!System.Web.HttpApplication+SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()+0x5d&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6ef08 65fe804f System_Web_ni!System.Web.HttpApplication.ExecuteStep(IExecutionStep, Boolean ByRef)+0x41&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6efb8 65fe4df2 System_Web_ni!System.Web.HttpApplication+PipelineStepManager.ResumeSteps(System.Exception)+0x63b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;060f05dc 66003a92 System_Web_ni!System.Web.HttpApplication.BeginProcessRequestNotification(System.Web.HttpContext, System.AsyncCallback)+0x56&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f040 65fd8022 System_Web_ni!System.Web.HttpRuntime.ProcessRequestNotificationPrivate(System.Web.Hosting.IIS7WorkerRequest, System.Web.HttpContext)+0x352&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f0c4 65fd7e07 System_Web_ni!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)+0x1f2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f0f4 01782374 System_Web_ni!System.Web.Hosting.PipelineRuntime.ProcessRequestNotification(IntPtr, IntPtr, IntPtr, Int32)+0x1b&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f138 6a2abf3c webengine!MgdGetCurrentNotification+0x236&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f19c 74a22ea0 webengine!MgdGetPreloadedSize+0x4d&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f1b0 74a23696 iiscore+0x2ea0&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f560 6a2ac222 webengine!MgdCanDisposeManagedContext+0xb5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;0ee6f570 015f1311 webengine!MgdIndicateCompletion+0x22&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;System_Web_ni!System.Web.Hosting.PipelineRuntime.ProcessRequestNotificationHelper(IntPtr, IntPtr, IntPtr, Int32)+0x289&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;span style="font-size:100%;"&gt;This is the worker thread that comes from ASP.NET. Another thread is still processing the request in WCF:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 10pt;"&gt;&lt;span style="font-family: Cambria,serif;"&gt;&lt;o:p&gt;&lt;span style="font-size:100%;"&gt; &lt;/span&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf0ac 0e9001c7 App_Web_rsfhd6l1!HelloWorld.SimpleService.Hello(System.String)+0x14&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf0ac 50b8d90b System_ServiceModel_ni!DynamicClass.SyncInvokeHello(System.Object, System.Object[], System.Object[])+0x3f&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf0ac 50b6d245 System_ServiceModel_ni!System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(System.Object, System.Object[], System.Object[] ByRef)+0x1fb&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf108 509137ad System_ServiceModel_ni!System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(System.ServiceModel.Dispatcher.MessageRpc ByRef)+0xd5&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf148 509136a6 System_ServiceModel_ni!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(System.ServiceModel.Dispatcher.MessageRpc ByRef)+0xad&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;01fbf174 50913613 System_ServiceModel_ni!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(System.ServiceModel.Dispatcher.MessageRpc ByRef)+0x76&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin: 0in 0in 0pt 0.5in; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: 'Courier New';"&gt;062b75a8 50913459 System_ServiceModel_ni!System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(System.ServiceModel.Dispatcher.MessageRpc By
