<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>.NET Slave</title>
    <description>by Mads Kristensen</description>
    <link>http://madskristensen.net/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.5.0.7</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://madskristensen.net/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Mads Kristensen</dc:creator>
    <dc:title>.NET Slave</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/netSlave" /><feedburner:info uri="netslave" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><image><link>http://blog.madskristensen.dk/</link><url>http://blog.madskristensen.dk/themes/standard/madskristensen.png</url><title>.NET slave</title></image><item>
      <title>Web Developer Checklist - the Chrome extension</title>
      <description>&lt;p&gt;Earlier this year, &lt;a href="http://sedodream.com/" target="_blank"&gt;Sayed&lt;/a&gt; and I released &lt;a href="http://webdevchecklist.com/" target="_blank"&gt;Web Developer Checklist&lt;/a&gt; to help web developer adhere to best practices. Checklists like these can be really helpful to make sure we don’t forget anything before releasing new or updated websites. &lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 6px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" align="right" src="http://madskristensen.net/image.axd?picture=image_73.png" width="279" height="580" /&gt;Now we’re introducing Web Developer Checklist as a &lt;a href="https://chrome.google.com/webstore/detail/web-developer-checklist/iahamcpedabephpcgkeikbclmaljebjp" target="_blank"&gt;Chrome extension&lt;/a&gt; that can automate a big portion of the checklist. The extension let’s you run checks for various best practices on any website - including your own running from localhost.&lt;/p&gt;  &lt;p&gt;It performs a serious of checks by analyzing the DOM as well as integrating with 3&lt;sup&gt;rd&lt;/sup&gt;-party services like &lt;a href="https://developers.google.com/speed/pagespeed/" target="_blank"&gt;Google PageSpeed&lt;/a&gt;.&lt;/p&gt;  &lt;h2&gt;Next steps&lt;/h2&gt;  &lt;p&gt;This first version of the &lt;a href="https://chrome.google.com/webstore/detail/web-developer-checklist/iahamcpedabephpcgkeikbclmaljebjp" target="_blank"&gt;Web Developer Checklist Chrome extension&lt;/a&gt; does a serious of really valuable checks. The next releases will have even more.&lt;/p&gt;  &lt;p&gt;Specifically, we’re looking at adding:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;HTML validation &lt;/li&gt;    &lt;li&gt;CSS validation &lt;/li&gt;    &lt;li&gt;Accessibility validation &lt;/li&gt;    &lt;li&gt;JSHint &lt;/li&gt;    &lt;li&gt;CssLint &lt;/li&gt;    &lt;li&gt;&lt;strike&gt;Guidance for each item&lt;/strike&gt; &lt;strong&gt;Done v.1.4.4&lt;/strong&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;We think these checks would be hugely beneficial. If you have ideas for other checks that can be automated, please let us know in the comments below.&lt;/p&gt;  &lt;h2&gt;Open source&lt;/h2&gt;  &lt;p&gt;The Web Developer Checklist Chrome extension is open source and hosted on our &lt;a href="https://github.com/ligershark/BestPracticesChromeExtension" target="_blank"&gt;GitHub org&lt;/a&gt;. As always, pull requests are more than welcome.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/akVgqyIfexQ/post.aspx</link>
      <comments>http://madskristensen.net/post/Chrome-extension-Web-Developer-Checklist.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=9fa751db-c036-435b-97e3-bd6373b0991b</guid>
      <pubDate>Thu, 06 Jun 2013 08:44:23 -0700</pubDate>
      <category>Client-side</category>
      <category>Tips and tricks</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=9fa751db-c036-435b-97e3-bd6373b0991b</pingback:target>
      <slash:comments>43</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=9fa751db-c036-435b-97e3-bd6373b0991b</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Chrome-extension-Web-Developer-Checklist.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=9fa751db-c036-435b-97e3-bd6373b0991b</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=9fa751db-c036-435b-97e3-bd6373b0991b</feedburner:origLink></item>
    <item>
      <title>Talk to, hear, touch and see your code</title>
      <description>&lt;p&gt;When coding, I use both of my hands for typing and both my eyes fixed on the code I’m writing. When I don’t know a certain keyboard shortcut, I reach for the mouse and in doing so, look away from the main Visual Studio window. My hands stop typing. I’m not productive anymore. For me, being productive is the foundation of my developer happiness. &lt;/p&gt;  &lt;p align="center"&gt;&lt;strong&gt;Loss of productivity = developer unhappiness &lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Another situation that sometimes occur is when I’m &lt;em&gt;in the zone&lt;/em&gt; coding like I’m on steroids. We’ve all tried that. It’s the best and most fulfilling part of being a developer. Highly productive and my developer happiness is at max. When I’m &lt;em&gt;in the zone&lt;/em&gt;, nothing disturbs me. I don’t notice people entering or leaving the room and sometimes not even various status messages inside Visual Studio. Did the build just fail? What about the unit tests? I have no idea and that could be problematic.&lt;/p&gt;  &lt;p&gt;My eyes are used for seeing what’s on the screen (input) and my hands are used for typing (output). The problem is that I only have 1 pair of &lt;strong&gt;hands&lt;/strong&gt;, 1 pair of &lt;strong&gt;eyes&lt;/strong&gt; and I’m using &lt;strong&gt;both&lt;/strong&gt;. I’ve maxed out my IO.&lt;/p&gt;  &lt;p align="center"&gt;&lt;strong&gt;The body parts useful for coding is a limited resource&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Mother nature did provide us with much higher IO bandwidth than what can be achieved by only using eyes and hands. One of them is sound. The ears are hearing (input) and your voice is speaking (output). &lt;/p&gt;  &lt;p&gt;So why not try to increase our IO using sound? What if we could hear when the build brakes? What if we, using our voice, could tell our editor to format the document in case we forgot that keyboard shortcut? It seems like a perfectly reasonable idea to me.&lt;/p&gt;  &lt;p&gt;To experiment with this idea, I wrote two extensions for Visual Studio 2012. &lt;/p&gt;  &lt;h2&gt;Voice Commands&lt;/h2&gt;  &lt;p&gt;&lt;img title="preview" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="preview" align="left" src="http://madskristensen.net/image.axd?picture=preview.png" width="175" height="175" /&gt;&lt;/p&gt;  &lt;p&gt;This extension let’s you speak any command out load. The extension will be able to recognize the voice command and execute it in Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;font style="font-weight: normal"&gt;It really is impressive how far speech recognition has come since I started playing around with it in the early nineties. All credit is given to the researchers and developers who kept evolving Windows Speech Recognition through all those years.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font style="font-weight: normal"&gt;I started pronouncing each word very clearly, because I expected it would more easily recognize the words like that. What I’ve found is quite the opposite. You have to speak to it like you would speak to any normal human being. It felt counter intuitive, but that’s how far speech recognition has come. The accuracy is astonishing.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font style="font-weight: normal"&gt;V&lt;/font&gt;&lt;font style="font-weight: normal"&gt;oice Commands starts listening when you type Alt+V. Then just speak any command, such as &lt;/font&gt;&lt;em&gt;&lt;font style="font-weight: normal"&gt;Format Document&lt;/font&gt;&lt;/em&gt;&lt;font style="font-weight: normal"&gt;, &lt;/font&gt;&lt;em&gt;&lt;font style="font-weight: normal"&gt;Save All&lt;/font&gt;&lt;/em&gt;&lt;font style="font-weight: normal"&gt;, &lt;/font&gt;&lt;em&gt;&lt;font style="font-weight: normal"&gt;Options&lt;/font&gt;&lt;/em&gt;&lt;font style="font-weight: normal"&gt;, &lt;/font&gt;&lt;em&gt;&lt;font style="font-weight: normal"&gt;Toggle bookmark&lt;/font&gt;&lt;/em&gt;&lt;font style="font-weight: normal"&gt;, &lt;/font&gt;&lt;font style="font-weight: normal"&gt;&lt;em&gt;Collapse To Definition. &lt;/em&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font style="font-weight: normal"&gt;D&lt;/font&gt;&lt;font style="font-weight: normal"&gt;ownload: &lt;/font&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/ce35c120-405a-435b-af2a-52ff24eb2c30"&gt;&lt;font style="font-weight: normal"&gt;VS Gallery&lt;/font&gt;&lt;/a&gt;     &lt;br /&gt;&lt;font style="font-weight: normal"&gt;Source code: &lt;/font&gt;&lt;a href="https://github.com/ligershark/VoiceExtension/"&gt;&lt;font style="font-weight: normal"&gt;GitHub&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Farticus&lt;/h2&gt;  &lt;p&gt;&lt;img title="farticus" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="farticus" align="left" src="http://madskristensen.net/image.axd?picture=farticus.png" width="140" height="140" /&gt;Because every app store needs a fart app – including the Visual Studio Gallery.&lt;/p&gt;  &lt;p&gt;Granted, this is a joke. However, it’s a joke in disguise, because it does solve my problem of missing occasional build errors by playing a sound every time the build breaks. With Farticus installed, I’ve never missed a build error. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://sedodream.com/"&gt;Sayed&lt;/a&gt; and I build Farticus with a few goals in mind:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;It should be useful and solve a real problem &lt;/li&gt;    &lt;li&gt;It must be open source &lt;/li&gt;    &lt;li&gt;It should be easy for others to learn from the code &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Don’t like the fart sounds? No problem. Fork the project and substitute the sounds with more appropriate ones. &lt;em&gt;Doh!&lt;/em&gt; or &lt;em&gt;You can’t do that, Dave&lt;/em&gt; comes to mind. Why not play a sound when unit tests fail as well? Fork the source code and release your own version or send us a pull request and we’ll add it to Farticus.&lt;/p&gt;  &lt;p&gt;Download: &lt;a href="http://visualstudiogallery.msdn.microsoft.com/33b0242d-7158-4d39-9a01-0a08cf7c28bd"&gt;VS Gallery&lt;/a&gt;     &lt;br /&gt;Source code: &lt;a href="https://github.com/ligershark/Farticus"&gt;GitHub&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So there you have it folks. Two extensions that adds a natural user interface to Visual Studio and adds some body parts to our coding arsenal.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/X-0dunx-jAo/post.aspx</link>
      <comments>http://madskristensen.net/post/Talk-to-hear-touch-and-see-your-code.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=ad695174-f04a-451e-ac7c-c20bf2786ab9</guid>
      <pubDate>Mon, 27 May 2013 17:16:00 -0700</pubDate>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=ad695174-f04a-451e-ac7c-c20bf2786ab9</pingback:target>
      <slash:comments>10</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=ad695174-f04a-451e-ac7c-c20bf2786ab9</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Talk-to-hear-touch-and-see-your-code.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=ad695174-f04a-451e-ac7c-c20bf2786ab9</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=ad695174-f04a-451e-ac7c-c20bf2786ab9</feedburner:origLink></item>
    <item>
      <title>Introducing Pretty Paste for VS2012</title>
      <description>&lt;p&gt;Download &lt;a href="http://visualstudiogallery.msdn.microsoft.com/6a23234d-45f6-4212-bac3-f6d9bb08fb1e"&gt;Pretty Paste&lt;/a&gt; now!&lt;/p&gt;  &lt;p&gt;One of the things that have annoyed me about Visual Studio for many years, is the inconsistency when pasting code copied from websites. Depending on the browser you get different results. Consider the code snippet below copied from one of &lt;a href="http://sedodream.com/2013/03/02/MSDeployHowToUpdateAppSettingsOnPublishBasedOnThePublishProfile.aspx"&gt;Sayed’s blog posts&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://madskristensen.net/image.axd?picture=image_66.png" width="359" height="107" /&gt; &lt;/p&gt;  &lt;p&gt;If I copy that from Internet Explorer and paste it into Visual Studio, this is what I get:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_67.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://madskristensen.net/image.axd?picture=image_thumb_39.png" width="522" height="425" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And copied from Chrome result in this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_68.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://madskristensen.net/image.axd?picture=image_thumb_40.png" width="476" height="284" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;As you can see, both browsers include the line numbers, but they interpret them differently. Both browsers fail to understand my intent for copying the text and it has been that way forever. Very annoying. In tooling, understanding the user’s intent is the holy grail.&lt;/p&gt;  &lt;p&gt;So, in a rare moment of clarity a few days ago, I decided to fix this issue by writing an extension for Visual Studio - &lt;a href="http://visualstudiogallery.msdn.microsoft.com/6a23234d-45f6-4212-bac3-f6d9bb08fb1e"&gt;Pretty Paste&lt;/a&gt;. The idea is to inject some logic just before the regular Paste command in VS executes. That logic will quickly analyze the text being pasted and correct any non-intended line numbers and extra blank lines.&lt;/p&gt;  &lt;p&gt;With &lt;a href="http://visualstudiogallery.msdn.microsoft.com/6a23234d-45f6-4212-bac3-f6d9bb08fb1e"&gt;Pretty Paste&lt;/a&gt;, the result of pasting the above code sample now shows this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_69.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://madskristensen.net/image.axd?picture=image_thumb_41.png" width="472" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It automatically formats the code I pasted using the settings from each individual language. Here, my settings are set to use spaces instead of tabs and that is respected. &lt;/p&gt;  &lt;p&gt;In the case where you actually wanted the raw copied text instead of the cleaned up version provided by &lt;a href="http://visualstudiogallery.msdn.microsoft.com/6a23234d-45f6-4212-bac3-f6d9bb08fb1e"&gt;Pretty Paste&lt;/a&gt;, you can just undo the paste &lt;strong&gt;once&lt;/strong&gt; to get the raw paste. Here’s the result of a Pretty Paste followed by an undo:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_70.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="http://madskristensen.net/image.axd?picture=image_thumb_42.png" width="470" height="286" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This way we can have the best of both worlds. You decide. Nothing is lost.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://visualstudiogallery.msdn.microsoft.com/6a23234d-45f6-4212-bac3-f6d9bb08fb1e"&gt;Pretty Paste&lt;/a&gt; is my 6th Visual Studio extension and I love that extensibility let’s me fix use cases that are important to me. The code is simple, short and sweet. &lt;a href="https://github.com/madskristensen/PasteR "&gt;Check it out on GitHub&lt;/a&gt; and fork away. Pull requests are more then welcome.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/p0boZH7-kF0/post.aspx</link>
      <comments>http://madskristensen.net/post/Introducing-Pretty-Paste-for-VS2012.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=80c37fb9-1911-490b-b654-5fdd791ffce7</guid>
      <pubDate>Sun, 24 Mar 2013 12:22:29 -0700</pubDate>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=80c37fb9-1911-490b-b654-5fdd791ffce7</pingback:target>
      <slash:comments>12</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=80c37fb9-1911-490b-b654-5fdd791ffce7</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Introducing-Pretty-Paste-for-VS2012.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=80c37fb9-1911-490b-b654-5fdd791ffce7</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=80c37fb9-1911-490b-b654-5fdd791ffce7</feedburner:origLink></item>
    <item>
      <title>AngularJS Intellisense in Visual Studio 2012</title>
      <description>&lt;p&gt;Recently, a lot of people have asked for Intellisense support for &lt;a href="http://angularjs.org/"&gt;AngularJS&lt;/a&gt; in the Visual Studio HTML editor. The bad news is that there is no extensibility for providing additional HTML attribute Intellisense, so I can&amp;rsquo;t ship this support in &lt;a href="http://vswebessentials.com/"&gt;Web Essentials&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The good news is that we can accomplish this through a more manual mechanism.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_65.png"&gt;&lt;img style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" title="image" src="http://madskristensen.net/image.axd?picture=image_thumb_38.png" alt="image" width="278" height="231" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s what you need to do:&lt;/p&gt;
&lt;h2&gt;Step 1&lt;/h2&gt;
&lt;p&gt;Find the file &lt;strong&gt;commonHTML5Types.xsd&lt;/strong&gt; located in the Visual Studio install directory and back it up (just in case). Mine is here:&lt;em&gt; C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Packages\schemas\html&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Step 2&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://madskristensen.net/file.axd?file=2013%2f2%2fcommonHTML5Types.xsd"&gt;Download this new version&lt;/a&gt; of commonHTML5Types.xsd and replace the existing&amp;nbsp;one&amp;nbsp;from the directory&amp;nbsp;in &lt;em&gt;Step 1&lt;/em&gt; with it.&lt;/p&gt;
&lt;h2&gt;Step 3&lt;/h2&gt;
&lt;p&gt;Restart Visual Studio and that's it. You now have all the ng-* attributes available in Intellisense.&amp;nbsp;This Works On My Machine&lt;sup&gt;tm&lt;/sup&gt;, so please let me know if it works on yours too.&lt;/p&gt;
&lt;p&gt;I still want to add native support in either Visual Studio or Web Essentials, so if this is something you&amp;rsquo;re interested in, please &lt;a href="http://webessentials.uservoice.com/forums/140520-general/suggestions/3487580-intellisense-for-angularjs"&gt;vote for it here&lt;/a&gt;.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/4Xky73XZDyo/post.aspx</link>
      <comments>http://madskristensen.net/post/AngularJS-Intellisense-in-Visual-Studio-2012.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=17594bb3-3121-4879-8a92-df00fe92b2dc</guid>
      <pubDate>Tue, 19 Feb 2013 14:04:00 -0700</pubDate>
      <category>Web Essentials</category>
      <dc:publisher>Mads Kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=17594bb3-3121-4879-8a92-df00fe92b2dc</pingback:target>
      <slash:comments>28</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=17594bb3-3121-4879-8a92-df00fe92b2dc</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/AngularJS-Intellisense-in-Visual-Studio-2012.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=17594bb3-3121-4879-8a92-df00fe92b2dc</wfw:commentRss>
    <enclosure url="http://madskristensen.net/file.axd?file=2013%2f2%2fcommonHTML5Types.xsd" length="38229" type="application/octet-stream" /><feedburner:origLink>http://madskristensen.net/post.aspx?id=17594bb3-3121-4879-8a92-df00fe92b2dc</feedburner:origLink></item>
    <item>
      <title>Web Tools 2012.2 and Web Essentials</title>
      <description>&lt;p&gt;Today the ASP.NET and Web Tools 2012.2 update was released. &lt;a href="http://go.microsoft.com/fwlink/?LinkId=282650"&gt;Go download it right now&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;It contains a lot of new and updated Visual Studio tooling features including:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;First class LESS editor &lt;/li&gt;    &lt;li&gt;Knockout.js Intellisense &lt;/li&gt;    &lt;li&gt;Paste JSON as classes &lt;/li&gt;    &lt;li&gt;CoffeeScript editor &lt;/li&gt;    &lt;li&gt;Mustache/Handlebars/JsRender syntax highlighting &lt;/li&gt;    &lt;li&gt;Page Inspector      &lt;ul&gt;       &lt;li&gt;Live CSS auto-sync as you type &lt;/li&gt;        &lt;li&gt;JavaScript selection mapping and callstack &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Some of them are features that started their lives in &lt;a href="http://vswebessentials.com/"&gt;Web Essentials 2012&lt;/a&gt; and are now ported into an official release. Every time we move features from the experimental Web Essentials extension into the official product, we try to make the transition as smooth as possible. &lt;/p&gt;  &lt;p&gt;However, this time we moved some substantial features that are mutually exclusive – they register the same MEF components and that leads to this rather ugly exception:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=clip_image002.gif"&gt;&lt;img title="An exception has been encountered. This may be caused by an extension" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="An exception has been encountered. This may be caused by an extension" src="http://madskristensen.net/image.axd?picture=clip_image002_thumb.gif" width="496" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This exception occurs when Web Tools 2012.2 is installed and you haven’t updated Web Essentials to version 2.5. The solution is simply to update Web Essentials. &lt;a href="http://vswebessentials.com/download"&gt;Go do that now&lt;/a&gt;. If you don’t have Web Essentials installed at all, you won’t get this error because then there is no conflict. &lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/QPYXrMvnzEo/post.aspx</link>
      <comments>http://madskristensen.net/post/Web-Tools-20122-and-Web-Essentials.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=7b38cc04-8e63-4189-be53-05ad7fd28d2b</guid>
      <pubDate>Sun, 17 Feb 2013 16:08:33 -0700</pubDate>
      <category>Web Essentials</category>
      <category>ASP.NET</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=7b38cc04-8e63-4189-be53-05ad7fd28d2b</pingback:target>
      <slash:comments>21</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=7b38cc04-8e63-4189-be53-05ad7fd28d2b</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Web-Tools-20122-and-Web-Essentials.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=7b38cc04-8e63-4189-be53-05ad7fd28d2b</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=7b38cc04-8e63-4189-be53-05ad7fd28d2b</feedburner:origLink></item>
    <item>
      <title>Google Analytics vs. Google Page Speed</title>
      <description>&lt;p&gt;&lt;strong&gt;Nerd alert&lt;/strong&gt;: This post is only for crazy website performance freaks. Proceed at your own risk.&lt;/p&gt;  &lt;p&gt;The holy grail for us crazy website performance freaks is to reach a perfect score of 100/100 in &lt;a href="https://developers.google.com/speed/pagespeed/"&gt;Google Page Speed&lt;/a&gt; without sacrificing important features of the website we’re building. One of those important features is &lt;a href="http://google.com/analytics"&gt;Google Analytics&lt;/a&gt;. Gotta have Google Analytics, right?!&lt;/p&gt;  &lt;p&gt;Let’s say that you’ve optimized your website to the perfect score of 100/100 and now decide to add Google Analytics. Too bad, your score is now 98/100. That’s because the &lt;em&gt;ga.js&lt;/em&gt; JavaScript file loaded from Google’s servers doesn’t have a far-future &lt;em&gt;expires&lt;/em&gt; HTTP header. To get the perfect score back, we need to fix this problem.&lt;/p&gt;  &lt;h2&gt;Getting back to 100/100&lt;/h2&gt;  &lt;p&gt;Here’s a solution that I use on &lt;a href="http://vswebessentials.com/"&gt;one of my websites&lt;/a&gt;. It involves the addition of a single .ashx file to your web project. It’s isolated, safe to use and works. &lt;/p&gt;  &lt;p&gt;The role of the .ashx file is to act as a proxy to the Google Analytics &lt;em&gt;ga.js&lt;/em&gt; script file by downloading its content and serving it with a sufficient &lt;em&gt;expires&lt;/em&gt; header. It caches the script file on the server, so it doesn’t have to download the &lt;em&gt;ga.js&lt;/em&gt; file every time a visitor hits your website.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;: Add an empty .ashx file (Generic Handler) to the root of you project and call it &lt;em&gt;ga.ashx&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;: Copy &lt;a href="https://github.com/ligershark/webdevchecklist.com/blob/6e64d062680542e6c7916256def183cecec17714/GoogleAnalytics.ashx"&gt;this code&lt;/a&gt; into the .ashx file you created in step 1.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;: Modify the Google Analytics tracking script on your page to look like this:&lt;/p&gt;  &lt;p&gt;&amp;lt;script&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var _gaq = _gaq || [];     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; _gaq.push(['_setAccount', 'UA-12345678-9']);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; _gaq.push(['_trackPageview']);     &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;script src=&amp;quot;/ga.ashx&amp;quot; async=&amp;quot;async&amp;quot; defer=&amp;quot;defer&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  &lt;p&gt;Voila! That’s it. You now have the perfect score back.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Optional step 4&lt;/strong&gt;: Don’t like the .ashx extension? Then change it to .js by adding this to the web.config:&lt;/p&gt;  &lt;p&gt;&amp;lt;rewrite&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;rules&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;rule name=&amp;quot;analytics&amp;quot;&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;match url=&amp;quot;^ga.js&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;action type=&amp;quot;Rewrite&amp;quot; url=&amp;quot;ga.ashx&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/rule&amp;gt;     &lt;br /&gt;&amp;#160; &amp;lt;/rules&amp;gt;     &lt;br /&gt;&amp;lt;/rewrite&amp;gt;&lt;/p&gt;  &lt;p&gt;You need to add it to the &amp;lt;system.webServer&amp;gt; section of web.config. Remember to run the AppPool in Integrated Pipeline Mode for the &amp;lt;system.webServer&amp;gt; section to kick in.&lt;/p&gt;  &lt;p&gt;Then just change the script tag to this:&lt;/p&gt;  &lt;p&gt;&amp;lt;script src=&amp;quot;&lt;strong&gt;/ga.js&lt;/strong&gt;&amp;quot; async=&amp;quot;async&amp;quot; defer=&amp;quot;defer&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  &lt;h2&gt;Wait, is this a good idea?&lt;/h2&gt;  &lt;p&gt;I’ll let you be the judge of that. What I can tell you is that this exact code is running on one of my websites and it reports data to Google Analytics just fine. &lt;/p&gt;  &lt;p&gt;Does it work? &lt;strong&gt;Yes&lt;/strong&gt;     &lt;br /&gt;Is it cool? &lt;strong&gt;Totally&lt;/strong&gt;     &lt;br /&gt;Should I do it? &lt;strong&gt;N/A&lt;/strong&gt;&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/bTWcqxo0rWQ/post.aspx</link>
      <comments>http://madskristensen.net/post/Google-Analytics-vs-Google-Page-Speed.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=b99eef0a-7f4d-42b2-bd24-13866ecc2ac4</guid>
      <pubDate>Wed, 16 Jan 2013 18:44:10 -0700</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=b99eef0a-7f4d-42b2-bd24-13866ecc2ac4</pingback:target>
      <slash:comments>22</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=b99eef0a-7f4d-42b2-bd24-13866ecc2ac4</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Google-Analytics-vs-Google-Page-Speed.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=b99eef0a-7f4d-42b2-bd24-13866ecc2ac4</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=b99eef0a-7f4d-42b2-bd24-13866ecc2ac4</feedburner:origLink></item>
    <item>
      <title>The ASP.NET developer checklist</title>
      <description>&lt;p&gt;&lt;a title="ASP.NET Web Developer Checklist" href="http://webdevchecklist.com/asp.net/"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" align="right" src="http://madskristensen.net/image.axd?picture=image_64.png" width="215" height="244" /&gt;&lt;/a&gt;In the beginning of January, we released the &lt;a href="http://webdevchecklist.com/"&gt;Web Developer Checklist&lt;/a&gt; with great interest from the general web community. The checklist helps raising awareness of common best practices for building websites.&lt;/p&gt;  &lt;p&gt;It was always the plan to branch the checklist out into technology specific checklists to make it even easier to apply all the best practices.&lt;/p&gt;  &lt;p&gt;Today we’re excited to announce the first technology specific checklist – the &lt;a href="http://webdevchecklist.com/asp.net/"&gt;ASP.NET Developer Checklist&lt;/a&gt;. It contains links to many ASP.NET specific tools and solutions to common problems. &lt;/p&gt;  &lt;p&gt;Not only is it a great tool for all ASP.NET developers to learn from, but also to track the progress of implementing the various best practices. &lt;/p&gt;  &lt;p&gt;We hope it will be received well and add value to the millions of ASP.NET developers worldwide. In the meantime we will be working on finishing &lt;a href="http://webdevchecklist.com/asp.net/performance/"&gt;another ASP.NET specific checklist&lt;/a&gt; that focuses on website performance. &lt;/p&gt;  &lt;p&gt;ASP.NET is just the first of many web technologies to receive its own checklist, so remember to check the &lt;a href="http://webdevchecklist.com/"&gt;Web Developer Checklist&lt;/a&gt; often for updates.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/foB7YXRlzs4/post.aspx</link>
      <comments>http://madskristensen.net/post/The-ASPNET-developer-checklist.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=50c1f571-d34a-408d-9ce7-dbe6142c5b91</guid>
      <pubDate>Tue, 15 Jan 2013 20:04:05 -0700</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=50c1f571-d34a-408d-9ce7-dbe6142c5b91</pingback:target>
      <slash:comments>20</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=50c1f571-d34a-408d-9ce7-dbe6142c5b91</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/The-ASPNET-developer-checklist.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=50c1f571-d34a-408d-9ce7-dbe6142c5b91</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=50c1f571-d34a-408d-9ce7-dbe6142c5b91</feedburner:origLink></item>
    <item>
      <title>Fix for uncompressed JS files on IIS</title>
      <description>&lt;p&gt;Rule #1 in website optimization is to enable GZip compression on the web server. This is very easy using web.config as &lt;a href="http://www.iis.net/configreference/system.webserver/urlcompression"&gt;explained here&lt;/a&gt;. However, some web servers have disabled automatic compression of JavaScript files, because they are served with the content type: &lt;strong&gt;application/x-javascript&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;For these web servers we can use a web.config trick to change the content type of JavaScript files to &lt;strong&gt;text/javascript&lt;/strong&gt;. This is a completely valid content type supported by all browsers.&lt;/p&gt;  &lt;p&gt;Just paste the following XML snippet in to your web.config’s &amp;lt;system.webServer&amp;gt; section.&lt;/p&gt;  &lt;p&gt;&amp;lt;staticContent&amp;gt;   &lt;br /&gt;&amp;#160; &amp;lt;remove fileExtension=&amp;quot;.js&amp;quot;/&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;mimeMap fileExtension=&amp;quot;.js&amp;quot; mimeType=&amp;quot;text/javascript&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;lt;/staticContent&amp;gt;&lt;/p&gt;  &lt;p&gt;Chances are that you don’t have this issue, since it seems to only apply to some hosters, but now you know how to get around it should you ever end up in the situation with uncompressed JavaScript files.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/gOCrlHhTVQM/post.aspx</link>
      <comments>http://madskristensen.net/post/Fix-for-uncompressed-JS-files.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=e9a15cdc-9e08-47d0-b7b6-bff1e611f4df</guid>
      <pubDate>Sun, 13 Jan 2013 19:18:09 -0700</pubDate>
      <category>ASP.NET</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=e9a15cdc-9e08-47d0-b7b6-bff1e611f4df</pingback:target>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=e9a15cdc-9e08-47d0-b7b6-bff1e611f4df</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Fix-for-uncompressed-JS-files.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=e9a15cdc-9e08-47d0-b7b6-bff1e611f4df</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=e9a15cdc-9e08-47d0-b7b6-bff1e611f4df</feedburner:origLink></item>
    <item>
      <title>Cache busting in ASP.NET</title>
      <description>&lt;p&gt;Optimizing for website performance includes setting long expiration dates on our static resources, such s images, stylesheets and JavaScript files. Doing that tells the browser to cache our files so it doesn’t have to request them every time the user loads a page. This is one of the most important things to do when optimizing websites.&lt;/p&gt;  &lt;p&gt;In ASP.NET on IIS7+ it’s really easy. Just add this chunk of XML to the web.config’s &amp;lt;system.webServer&amp;gt; element:&lt;/p&gt;  &lt;p&gt;&amp;lt;staticContent&amp;gt;    &lt;br /&gt;&amp;#160; &amp;lt;clientCache cacheControlMode=&amp;quot;UseMaxAge&amp;quot; cacheControlMaxAge=&amp;quot;365:00:00&amp;quot; /&amp;gt;     &lt;br /&gt;&amp;lt;/staticContent&amp;gt;&lt;/p&gt; &lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;  &lt;p&gt;The above code tells the browsers to automatically cache all static resources for 365 days. That’s good and you should do this right now.&lt;/p&gt;  &lt;p&gt;The issue becomes clear the first time you make a change to any static file. How is the browser going to know that you made a change, so it can download the latest version of the file? The answer is that it can’t. It will keep serving the same cached version of the file for the next 365 days regardless of any changes you are making to the files.&lt;/p&gt;  &lt;h2&gt;Fingerprinting&lt;/h2&gt;  &lt;p&gt;The good news is that it is fairly trivial to make a change to our code, that changes the URL pointing to the static files and thereby tricking the browser into believing it’s a brand new resource that needs to be downloaded.&lt;/p&gt;  &lt;p&gt;Here’s a little class that I use on several websites, that adds a fingerprint, or timestamp, to the URL of the static file.&lt;/p&gt;  &lt;p&gt;using System;    &lt;br /&gt;using System.IO;     &lt;br /&gt;using System.Web;     &lt;br /&gt;using System.Web.Caching;     &lt;br /&gt;using System.Web.Hosting;&lt;/p&gt;  &lt;p&gt;public class Fingerprint    &lt;br /&gt;{     &lt;br /&gt;&amp;#160; public static string Tag(string rootRelativePath)     &lt;br /&gt;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (HttpRuntime.Cache[rootRelativePath] == null)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string absolute = HostingEnvironment.MapPath(&amp;quot;~&amp;quot; + rootRelativePath);&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DateTime date = File.GetLastWriteTime(absolute);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; int index = rootRelativePath.LastIndexOf('/');&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string result = rootRelativePath.Insert(index, &amp;quot;/v-&amp;quot; + date.Ticks);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HttpRuntime.Cache.Insert(rootRelativePath, result, new CacheDependency(absolute));     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;  &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return HttpRuntime.Cache[rootRelativePath] as string;    &lt;br /&gt;&amp;#160; }     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;All you need to change in order to use this class, is to modify the references to the static files.&lt;/p&gt;  &lt;h2&gt;Modify references&lt;/h2&gt;  &lt;p&gt;Here’s what it looks like in Razor for the stylesheet reference:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;@Fingerprint.Tag(&amp;quot;&lt;/span&gt;/&lt;span class="attr"&gt;content&lt;/span&gt;/&lt;span class="attr"&gt;site&lt;/span&gt;.&lt;span class="attr"&gt;css&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;quot;)&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;…and in WebForms:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;&amp;lt;%=Fingerprint.Tag(&amp;quot;&lt;/span&gt;/&lt;span class="attr"&gt;content&lt;/span&gt;/&lt;span class="attr"&gt;site&lt;/span&gt;.&lt;span class="attr"&gt;css&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;quot;) %&amp;gt;&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The result of using the FingerPrint.Tag method will in this case be:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;/content/v-634933238684083941/site.css&amp;quot;&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;

.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Since the URL now has a reference to a non-existing folder (v-634933238684083941), we need to make the web server pretend it exist. We do that with URL rewriting.&lt;/p&gt;

&lt;h2&gt;URL rewrite&lt;/h2&gt;

&lt;p&gt;By adding this snippet of XML to the web.config’s &amp;lt;system.webServer&amp;gt; section, we instruct IIS 7+ to intercept all URLs with a folder name containing “v=[numbers]” and rewrite the URL to the original file path.&lt;/p&gt;

&lt;p&gt;&amp;lt;rewrite&amp;gt;
  &lt;br /&gt;&amp;#160; &amp;lt;rules&amp;gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;rule name=&amp;quot;fingerprint&amp;quot;&amp;gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;match url=&amp;quot;([\S]+)(/v-[0-9]+/)([\S]+)&amp;quot;&amp;#160; /&amp;gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;action type=&amp;quot;Rewrite&amp;quot; url=&amp;quot;{R:1}/{R:3}&amp;quot; /&amp;gt;

  &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/rule&amp;gt;

  &lt;br /&gt;&amp;#160; &amp;lt;/rules&amp;gt;

  &lt;br /&gt;&amp;lt;/rewrite&amp;gt;&lt;/p&gt;

&lt;p&gt;You can use this technique for all your JavaScript and image files as well.&lt;/p&gt;

&lt;p&gt;The beauty is, that every time you change one of the referenced static files, the fingerprint will change as well. This creates a brand new URL every time so the browsers will download the updated files.&lt;/p&gt;

&lt;p&gt;FYI, you need to run the AppPool in &lt;a href="http://msdn.microsoft.com/en-us/magazine/cc135973.aspx"&gt;Integrated Pipeline mode&lt;/a&gt; for the &amp;lt;system.webServer&amp;gt; section to have any effect.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/iv99ndOLHAo/post.aspx</link>
      <comments>http://madskristensen.net/post/Cache-busting-in-ASPNET.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=c8a7f71e-b5b4-44e1-802c-daa7802af3b6</guid>
      <pubDate>Wed, 09 Jan 2013 13:03:05 -0700</pubDate>
      <category>ASP.NET</category>
      <category>Tips and tricks</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=c8a7f71e-b5b4-44e1-802c-daa7802af3b6</pingback:target>
      <slash:comments>38</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=c8a7f71e-b5b4-44e1-802c-daa7802af3b6</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Cache-busting-in-ASPNET.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=c8a7f71e-b5b4-44e1-802c-daa7802af3b6</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=c8a7f71e-b5b4-44e1-802c-daa7802af3b6</feedburner:origLink></item>
    <item>
      <title>Web Developer Checklist</title>
      <description>&lt;p&gt;&lt;a href="http://madskristensen.net/image.axd?picture=image_59.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" align="right" src="http://madskristensen.net/image.axd?picture=image_thumb_35.png" width="305" height="269" /&gt;&lt;/a&gt;So you just built a website and are about to make it public to the world. You go through a few checks to make sure that everything works as expected. Perhaps run HTML validation and other similar services. &lt;/p&gt;  &lt;p&gt;But are you sure you remembered to implement all the best practices? Does it look good on mobile devices, in Windows 8 snapped view and what about basic accessibility?&lt;/p&gt;  &lt;p&gt;Enter &lt;a href="http://webdevchecklist.com/"&gt;Web Developer Checklist&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;We’ve tried to come up with the complete list of tasks and checks that every web developer should go through when developing any kind of website. The &lt;a href="http://webdevchecklist.com/"&gt;Web Developer Checklist&lt;/a&gt; is structured in a way that makes it really easy to follow the progress as well as getting help to perform all the checks.&lt;/p&gt;  &lt;p&gt;Give it a try and let me know what you think.&lt;/p&gt;&lt;a href="http://www.winhost.com/a/benet_l_6" style="color:#555;display:block;background:#f1f1f1;padding: 10px" target="_blank"&gt;* $4.95/month ASP.NET Hosting with FREE SQL 2012 DB! – Click Here!&lt;/a&gt;</description>
      <link>http://feedproxy.google.com/~r/netSlave/~3/gZWbueWili8/post.aspx</link>
      <comments>http://madskristensen.net/post/Web-Developer-Checklist.aspx#comment</comments>
      <guid isPermaLink="false">http://madskristensen.net/post.aspx?id=e4073031-072c-485c-a5ed-ed67a61735eb</guid>
      <pubDate>Mon, 07 Jan 2013 19:06:31 -0700</pubDate>
      <category>ASP.NET</category>
      <category>Tips and tricks</category>
      <dc:publisher>mads kristensen</dc:publisher>
      <pingback:server>http://madskristensen.net/pingback.axd</pingback:server>
      <pingback:target>http://madskristensen.net/post.aspx?id=e4073031-072c-485c-a5ed-ed67a61735eb</pingback:target>
      <slash:comments>7</slash:comments>
      <trackback:ping>http://madskristensen.net/trackback.axd?id=e4073031-072c-485c-a5ed-ed67a61735eb</trackback:ping>
      <wfw:comment>http://madskristensen.net/post/Web-Developer-Checklist.aspx#comment</wfw:comment>
      <wfw:commentRss>http://madskristensen.net/syndication.axd?post=e4073031-072c-485c-a5ed-ed67a61735eb</wfw:commentRss>
    <feedburner:origLink>http://madskristensen.net/post.aspx?id=e4073031-072c-485c-a5ed-ed67a61735eb</feedburner:origLink></item>
  </channel>
</rss>
