<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>A Taste of Logic : IIS7</title><link>http://blogs.msdn.com/jamesche/archive/tags/IIS7/default.aspx</link><description>Tags: IIS7</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Error When Opening ASP.NET Site on IIS 7 Using Visual Studio 2005</title><link>http://blogs.msdn.com/jamesche/archive/2008/02/25/error-when-opening-asp-net-site-on-iis-7-using-visual-studio-2005.aspx</link><pubDate>Mon, 25 Feb 2008 21:46:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7895658</guid><dc:creator>jamesche</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jamesche/comments/7895658.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesche/commentrss.aspx?PostID=7895658</wfw:commentRss><description>&lt;p&gt;Now that Windows Server 2008 is out the door, we're starting to see more customers using IIS 7. I recently worked on a case where one of our engineers was dealing with a customer using Visual Studio 2005 and IIS 7. He was encountering an error message when attempting to open his ASP.NET 2.0 application running on his local instance of IIS that displayed the following message:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/error.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="242" alt="The site is currently configured for use with ASP.NET 1.1 error." src="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/error_thumb.jpg" width="528" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;When we checked the application pool in IIS, it was configured correctly for the 2.0 Framework, so what exactly is the problem here?&lt;/p&gt; &lt;p&gt;The problem is that Visual Studio 2005 came out prior to IIS 7. Therefore, it doesn't deal well with the way that the handler mappings work in IIS 7. As it turns out, the .aspx file extension is mapped to both the ASPNET-ISAPI-1.1-PageHandlerFactory (for 1.1) and to the PageHandlerFactory-ISAPI-2.0. When Visual Studio 2005 hits the site to check for ASP.NET, it is fooled into thinking that the site is configured for ASP.NET 1.1 by the mapping for the ASPNET-ISAPI-1.1-PageHandlerFactory. &lt;/p&gt; &lt;p&gt;To correct this problem, you can either click Yes to the dialog shown above (and you'll have to do that each time you open the project) or you can change the order of the handlers mapped to your application.&lt;/p&gt; &lt;p&gt;To change the order of the handlers, follow these steps:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Select your application in the IIS Manager.  &lt;li&gt;Double-click on the Handler Mappings feature as shown below.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/handlermappings.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="443" alt="handlermappings" src="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/handlermappings_thumb.jpg" width="509" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;ol&gt; &lt;li value="3"&gt;&amp;nbsp; Click the View Ordered List link on the right side of the IIS Manager as shown below.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/ordered.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="340" alt="ordered" src="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/ordered_thumb.jpg" width="278" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;ol&gt; &lt;li value="4"&gt;Select the &lt;strong&gt;PageHandlerFactory-ISAPI-2.0&lt;/strong&gt; (or &lt;strong&gt;PageHandlerFactory-ISAPI-2.0-64&lt;/strong&gt; on 64-bit Windows). &lt;li&gt;Click the Move Up link as shown below until the handler appears above the ASPNET-ISAPI-1.1-PageHandlerFactory handler.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;a href="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/movehandler.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="427" alt="movehandler" src="http://www.jimcobooks.com/blog/Error.NETSiteonIIS7UsingVisualStudio2005_7832/movehandler_thumb.jpg" width="657" border="0"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;You should now be able to open the project without any issues.&lt;/p&gt; &lt;p&gt;By the way, this issue does not occur in Visual Studio 2008.&lt;/p&gt; &lt;p&gt;Jim&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7895658" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesche/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/jamesche/archive/tags/IIS7/default.aspx">IIS7</category></item><item><title>Cool Things You Can Do with AppCMD in IIS 7</title><link>http://blogs.msdn.com/jamesche/archive/2008/01/16/cool-things-you-can-do-with-appcmd-in-iis-7.aspx</link><pubDate>Wed, 16 Jan 2008 21:43:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7134013</guid><dc:creator>jamesche</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jamesche/comments/7134013.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jamesche/commentrss.aspx?PostID=7134013</wfw:commentRss><description>&lt;p&gt;If you haven't had a chance yet to mess around with IIS 7, you should take the time. One of the changes that will impact everyone is configuration. Not only have we changed where configuration settings are stored, but we've also released a very cool command-line tool for examining and changing configuration called appcmd.exe. However, appcmd.exe is not just about configuration. There are some really cool things that you can do with it.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;Wildcard Mapping&lt;/h1&gt;  &lt;p&gt;You can use wildcard characters with appcmd using the following syntax:&lt;/p&gt;  &lt;p class="debugCmd"&gt;appcmd list apppool /name:&amp;quot;$=*2007&amp;quot;&lt;/p&gt;  &lt;p&gt;This command will list all application pools with a name ending in &amp;quot;2007&amp;quot;. Using a variation on the same method, you can find all application pools running under the identify of users in a particular domain.&lt;/p&gt;  &lt;p class="debugCmd"&gt;appcmd list apppool /processModel.userName:&amp;quot;$=MyDomain\*&amp;quot;&lt;/p&gt;  &lt;p&gt;This will list all application pools with running with an identity of users in the &amp;quot;MyDomain&amp;quot; domain.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Tip: &lt;/strong&gt;You can find out all of the attributes that can be used with appcmd by querying for help after using an attribute. For example:&lt;/p&gt;  &lt;p class="debugCmd"&gt;appcmd list apppools /name:DefaultAppPool -?    &lt;br /&gt;    &lt;br /&gt;ERROR ( message:-name     &lt;br /&gt;-queueLength     &lt;br /&gt;-autoStart     &lt;br /&gt;-enable32BitAppOnWin64     &lt;br /&gt;-managedRuntimeVersion     &lt;br /&gt;-enableConfigurationOverride     &lt;br /&gt;-managedPipelineMode     &lt;br /&gt;-passAnonymousToken     &lt;br /&gt;-processModel.identityType     &lt;br /&gt;-processModel.userName     &lt;br /&gt;-processModel.password     &lt;br /&gt;-processModel.loadUserProfile     &lt;br /&gt;-processModel.manualGroupMembership     &lt;br /&gt;-processModel.idleTimeout     &lt;br /&gt;-processModel.maxProcesses     &lt;br /&gt;-processModel.shutdownTimeLimit     &lt;br /&gt;-processModel.startupTimeLimit     &lt;br /&gt;-processModel.pingingEnabled     &lt;br /&gt;-processModel.pingInterval     &lt;br /&gt;-processModel.pingResponseTime     &lt;br /&gt;-recycling.disallowOverlappingRotation     &lt;br /&gt;-recycling.disallowRotationOnConfigChange     &lt;br /&gt;-recycling.logEventOnRecycle     &lt;br /&gt;-recycling.periodicRestart.memory     &lt;br /&gt;-recycling.periodicRestart.privateMemory     &lt;br /&gt;-recycling.periodicRestart.requests     &lt;br /&gt;-recycling.periodicRestart.time     &lt;br /&gt;-recycling.periodicRestart.schedule.[value='timespan'].value     &lt;br /&gt;-failure.loadBalancerCapabilities     &lt;br /&gt;-failure.orphanWorkerProcess     &lt;br /&gt;-failure.orphanActionExe     &lt;br /&gt;-failure.orphanActionParams     &lt;br /&gt;-failure.rapidFailProtection     &lt;br /&gt;-failure.rapidFailProtectionInterval     &lt;br /&gt;-failure.rapidFailProtectionMaxCrashes     &lt;br /&gt;-failure.autoShutdownExe     &lt;br /&gt;-failure.autoShutdownParams     &lt;br /&gt;-cpu.limit     &lt;br /&gt;-cpu.action     &lt;br /&gt;-cpu.resetInterval     &lt;br /&gt;-cpu.smpAffinitized     &lt;br /&gt;-cpu.smpProcessorAffinityMask     &lt;br /&gt;-cpu.smpProcessorAffinityMask2     &lt;br /&gt;)&lt;/p&gt;  &lt;p&gt;By appending &amp;quot;-?&amp;quot; to the command above, appcmd generates an error that lists all of the attributes that can be used with application pools.&lt;/p&gt;  &lt;h1&gt;&lt;/h1&gt;  &lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;  &lt;h1&gt;Piping Output&lt;/h1&gt;  &lt;p&gt;You can pipe appcmd output to another appcmd command. Having this capability is extremely powerful, especially in the area of scripting functionality around appcmd.&lt;/p&gt;  &lt;p&gt;The following command will find all application pools with names ending in &amp;quot;2007&amp;quot; and will then recycle each of them.&lt;/p&gt;  &lt;p class="debugCmd"&gt;appcmd apppool list /name:&amp;quot;$=*2007&amp;quot; /xml | appcmd apppool recycle /in&lt;/p&gt;  &lt;p&gt;(The &amp;quot;/in&amp;quot; switch causes the output from the first command to be sent to stdin.)&lt;/p&gt;  &lt;p&gt;A more useful example might be to restart all application pools serving requests that have been executing for longer than a particular amount of time. The following command will recycle all application pools serving requests that have been executing for more than 30 seconds.&lt;/p&gt;  &lt;p class="debugCmd"&gt;Appcmd list request /xml /time:&amp;quot;$&amp;gt;30000&amp;quot; | appcmd recycle apppool /in&lt;/p&gt;  &lt;p&gt;In such situations, you might want to also obtain a list of the application pools. You can use multiple pipes to achieve that result.&lt;/p&gt;  &lt;p class="debugCmd"&gt;Appcmd list request /xml /time:&amp;quot;$&amp;gt;30000&amp;quot; | appcmd list apppool /in /xml | appcmd recycle apppool /in&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;h1&gt;AppcmdUI&lt;/h1&gt;  &lt;p&gt;These examples only touch on the capabilities of appcmd.exe. One of the best ways to discover the capabilities of this tool is to use AppcmdUI. AppcmdUI is an interface into appcmd.exe. It gives you auto-completion for appcmd.exe commands and nicely formatted documentation so that you can more easily learn this powerful tool.&lt;/p&gt;  &lt;p&gt;AppcmdUI is available from the &lt;a href="http://www.iis.net/downloads/default.aspx?tabid=34&amp;amp;g=6&amp;amp;i=1446"&gt;IIS.net website&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;By the way, those of you familiar with PowerShell might think that appcmd.exe uses PowerShell for some of its functionality. It doesn't. Therefore, appcmd.exe can be used with Windows 2008 Server Core as well.&lt;/p&gt;  &lt;p&gt;Jim&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7134013" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jamesche/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.msdn.com/jamesche/archive/tags/AppCmd/default.aspx">AppCmd</category></item></channel></rss>