Rick Strahl's Web Log
Wind, waves, code and everything in between...
Ad-free experience sponsored by:
- the market leader of .NET and Java APIs for file formats – natively work with DOCX, XLSX, PPT, PDF, images and more
WebLog Posts in Category IIS
September, 2018 (1)
August, 2018 (2)
July, 2018 (1)
June, 2018 (3)
May, 2018 (2)
April, 2018 (2)
March, 2018 (1)
February, 2018 (1)
January, 2018 (1)
December, 2017 (2)
November, 2017 (4)
October, 2017 (2)
September, 2017 (6)
August, 2017 (1)
July, 2017 (3)
June, 2017 (2)
May, 2017 (2)
April, 2017 (4)
March, 2017 (5)
February, 2017 (2)
January, 2017 (4)
December, 2016 (5)
November, 2016 (4)
October, 2016 (4)
Visual Studio (48)
ASP.NET Core (30)
Web Services (19)
Web Api (16)
.NET Core (10)
Microsoft AJAX (8)
Sql Server (8)
Web Connection (7)
West Wind Ajax Toolkit (7)
Entity Framework (6)
Internet Explorer (6)
Live Writer (5)
Html Help Builder (5)
Source Control (4)
Markdown Monster (4)
Help Builder (3)
Software Development (3)
Web Browser Control (3)
ASP.NET vNext (2)
ASP.NET Markdown (1)
Visual Studio (1)
.NET Standard (1)
Dynamic Types (1)
Control Development (1)
Visual Studio Code (1)
Web Assembly (1)
Web Deployment Projects (1)
Web Design (1)
Configuring LetsEncrypt for ASP.NET Core and IIS
September 09, 2017 - Hood River, OR
LetsEncrypt makes it easy to create SSL certificates for your applications for free and lets you automate the process. When using LetsEncrypt with IIS and ASP.NET Core however a few extra steps are required to make an ASP.NET Core site work with LetsEncrypt. I show you how in this post.
Handling HTML5 Client Route Fallbacks in ASP.NET Core
August 07, 2017 - Hood River, OR
HTML5 client routes work great on the client, but when deep linking into a site or pressing refresh in the browser, HTML5 client side routes have a nasty habit of turning into server HTTP requests. Requests to routes that the server is likely not configured for. In this post I look at why HTML5 client routes require server cooperation to handle and how to set them up on IIS and/or ASP.NET Core.
Bypassing IIS Error Messages in ASP.NET
June 01, 2017 - Hood River, OR
IIS Error handling is the source of lots of confusion. I've been using IIS for nearly 20 years now, and figuring out the right combination of error configuration settings and code to properly serve custom error pages or error responses in API still makes fumble a few times before I get it just right. This post provides a few hints and some background on how to deal with error handling.
Automating IIS Feature Installation with Powershell
May 25, 2017 - Hood River, OR
IIS often gets a bad wrap for being diffcult to install and configure. However, using some of the built-in tooling for administration using PowerShell it's actually quite easy to configure IIS and even set up a new site and application pool with a few short scripts that are much quicker, and more repeatable than using the various Windows UI features. Here's how.
IIS and ASP.NET Core Rewrite Rules for Static Files and Html 5 Routing
April 27, 2017 - Hood River, OR
If you're running ASP.NET Core under Windows with IIS, you'll want to take advantage of letting IIS serve up your static content and handle your HTML 5 Client and home routes. IIS is very efficient at handling static content and content re-routing and in this post I describe how you can properly configure ASP.NET Core applications using the AspNetCoreModule and IIS Rewrite Rules
More on ASP.NET Core Running under IIS
March 16, 2017 - Maui, Hawaii
Since my last post about hosting ASP.NET Core on IIS I've gotten quite a few questions and comments in regards to working with this mixed IIS/Kestrel hosting environment. There are quite a few not so obvious arrangement in this set up and some surprising discoveries in terms of performance and segragation of feature usage between IIS and Kestrel.
External Network Access to Kestrel and IIS Express in ASP.NET Core
September 28, 2016 - Hood River, Oregon
Recently I needed to connect to my Windows based ASP.NET Core API from my Mac and in order for that to work some configuration settings are necesary so that the ASP.NET applications can serve HTTP content to the external network connection that this entails. In this post I show what you have to do to enable remote connections both using the Kestrel and IIS Express Web servers.
ASP.NET Web Site Project Publishing and Changing ACLs
June 28, 2016 - Hood River, OR
When publishing ASP.NET Web Site Projects, the project publish will overwrite server ACLs by clearing them to the inherited defaults and removing rights from common accounts. The result is that if you have custom ACLs set on the server they will be wiped by default. This occurs only on Web Site projects and in this post I remind myself of the .pubxml override setting that disables this default behavior
Use Powershell to bind SSL Certificates to an IIS Host Header Site
June 23, 2016 - Maui, HI
Managing SSL certificates on Windows has always been a pain in the ass and recently with the introduction of SNI to support multiple SSL certificates per site things have changed slightly in order to register certificates with IIS programmatically. In this post I show how to use PowerShell and the IIS WebAdministration snap in commands to create or import and register an SSL Certificate via the Command Line along with how this convoluted process works
IIS Channel Listener Errors in Windows 10 Insider Build 14342
May 30, 2016 - Maui, HI
After installing Insider Build 14342 I ran into some major issues with IIS crashing hard and resulting in stopped Application Pools. After some tracking it turns out this is due to application pool bitness which causes 32 bit Application Pools to crash for me.
Getting 'motivated' to move to SSL and HTTPS
May 09, 2016 - Maui, HI
The pressure is on: HTTPS is pushed front and center more and more as we see the browser vendors and API tools providers, making SSL encryption no longer an optional part for many things that you build on the Web. SSL and HTTPS are becoming a requirement and for good reasons. I personally ran into this with the Google Maps API in one of my applications that now requires an HTTPS based client page in order to use this API. In this post I discuss some of the issues and why this is actually a good thing, and some of the steps I took to move my existing site to HTTPS.
Using Let's Encrypt with IIS on Windows
February 22, 2016 - Maui, HI
Let's Encrypt is a new, open source certificate authority for creating free SSL certificates. In this post I show you how you can use some of the API clients on Windows to create Let's Encrypt certificates for use in IIS.
Windows 10 Upgrade and IIS 503 Errors
July 05, 2015 - Hood River, OR
After upgrading my machine to Windows 10 today I found that IIS, while working was throwing 503 Service Unavailable errors on every page. Turns out the issue is the Rewrite Module wasn't updated in the upgrade and that's causing a hard crash of the IIS module. Here's how to fix this issue.
Forms Auth loginUrl not working after Windows Update?
February 15, 2014 - Maui, HI
Ran into a problem with Windows Update last week that seems to have broken forms authentication and the loginUrl attribute when set. Looks like new default settings are changing default behavior, and an extra configuration key is required to get the old default behavior back.
Re-examining ASP.NET and Helios Performance Tests
December 09, 2013 - Maui, HI
Spend a little time over the weekend re-running some of my ASP.NET raw throughput benchmarks on my new machine and found some interesting results. Much faster, but also some surprises with self-hosting and efficiency surprises with various Web API approaches.
Checking out the Helios IIS Owin Web Server Host
November 23, 2013 - Maui, HI
During last week's MVP summit Microsoft showed a new light weight, Owin host called Helios, that can run directly on the IIS core without using the ASP.NET Runtime. It's light weight and fast, and offers a glimpse into where Microsoft is heading for building a more nimble and componentized runtime that is bound to be more flexible and agile. In this post I describe how to set up Helios to play around with and some of the implications it brings.
Use IIS Application Initialization for keeping ASP.NET Apps alive
October 02, 2013 - Maui, HI
Ever want to run a service-like, always-on application inside of ASP.NET instead of creating a Windows Service or running a Console application? Need to make sure that your ASP.NET application is always running and comes up immediately after an Application Pool restart even if nobody hits your site? The IIS Application Initialization Module provides this functionality in IIS 7 and later, making it much easier to create always-on ASP.NET applications that can act like a service.
Debugging Application_Start and Module Initialization with IIS and Visual Studio
December 15, 2011 - Maui, Hawaii
If you're running the full version of IIS and you try to debug your Web application's startup code in Application_Start you might have found that you can't debug this code as the debugger doesn't break there. Here's why and some easy ways you can work around this limitation.
Figuring out the IIS Version for a given OS in .NET Code
September 18, 2011 - Hood River, Oregon
Need to find the IIS version available for a given OS via code? Here's a small routine that handles this.
IIS 7 Error Pages taking over 500 Errors
April 29, 2009 - Maui, Hawaii
I've been running into a problem with IIS returning error pages when my application is actually returning 500 errors along with custom content. IOW, IIS is taking over error display completely even if I send my own content for errors. This has some profound effects on error handling and on some custom handler implementations that relying on returning error information to the client. Thankfully there's a new ASP.NET 3.5 property that helps with this problem, although it's a rather obscure fix for this issue.
ISAPI Module Crashing on Application Pool Shutdown
August 22, 2008 - Maui, Hawaii
So I have an odd issue with an ISAPI DLL that one of my products uses. The ISAPI interface provides a gateway interface to application servers and the actual module itself works fine without any problems. The problem is that the module is apparently crashing occasionally when the Application Pool is shutting down, but it's crashing after any of the DLL code has long stopped running. However, on...
Moving my Site onto a 64 Bit Server
August 07, 2008 - Hood River, Oregon
I'm finally getting ready to install my new Server and after some back and forth and testing on Windows 2008 I decided to go ahead and bite the bullet and go with the 64 bit version of Server. I've had mixed feelings about installing 64 bit given that I have had exactly zero experience running under 64 bit. I've not really seen a compelling reason on the desktop to run a 64 bit OS especially...
Non ASPX Extensions and Authentication in the IIS 7 Integrated Pipeline
May 23, 2008 - Frankfurt, Germany
Ran into an issue where IIS 7's integrated pipeline exhibits different behavior authenticating non ASPX extensions. Looks like IIS 7 only authenticates mainline files resulting in Context.User==null or Context.User.Identity.IsAuthenticated==false. For example hitting CustomHit.axd doesn't provide user credentials where an ASPX url does.
Where's my .NET 3.5 (on IIS), Dude?
March 24, 2008 - Maui, Hawaii
I just delivered a small 3.5 application to a customer in compiled form and told him to install the application on IIS. The company is one I've dealt with on a few occasions and they are .NET aware shop where I deal with developers and a .NET familiar IT department. But it wasn't long after I sent my email that I got a call back from the customer who - slightly embarrassed - mentioned that they couldn't find the 3.5 Runtime option in the ASP.NET configuration panel.
HttpModule and HttpHandler sections in IIS 7 web.config files
October 10, 2007 - Hood River, Oregon
Moving between IIS 5/6 and IIS 7 often causes some web.config conflict between the system.web and system.webserver handler and module sections. IIS 7 expects its handlers and modules defined only in its configuration section - if you still have handlers in system.web a configuration error occurs. Here's a useful switch that lets you turn off validation of system.web handlers and modules so you can ship web.config files that contain both.
Strong Name Validation failed when Debugging ASP.NET on IIS7
August 21, 2007 - Hood River, Oregon
Ugh, since I installed a new machine I ran into this error message above earlier. That's a pretty omnious sounding error message which seems to hint at a mis-configuration during installation. The error occurs as soon as you try to debug a Web application against IIS 7... As it turns out the...
IIS/ASP.NET Settings and Virtual Directory Inheritance
August 11, 2007 - Hood River, Oregon
Root directory web.config settings can easily interfere with child virtual application settings causing all sorts of problems. Here's why this is a problem and how to get around it.
Recent Patch hosing ASP Classic COM?
July 16, 2007 - Hood River, Oregon
Since about a week and a half ago my server is jo-joing up and down frequently apparently due to IIS 6 Application Pool crashes. The problem started (in hindsight) right after installation of the maintenance patches from two weeks ago the week before Win2003 SP2 was released and installed (didn't...
GoDaddy and SocketPermissions
July 11, 2007 - Hood River, Oregon
So I just got off the phone with support at GoDaddy for one of my customers and was told "Sorry we can't do that", when asked to provide socket permissions to go out and hit a POP3 server. GoDaddy has the web.config locked down and so you can't override the originUrl="site" so my customer is dead...
IIS Application Pool Crashes due to Temp File Permissions
July 10, 2007 - Hood River, Oregon
My Web Server has been throwing a bunch of nasty errors recently and I've been trying to figure out what the heck is going on. The problem is that apparently App Pools have been crashing hard fairly frequently. In most cases this isn't a big deal as IIS will immediately spin up another app pool,...
64 Bit Servers, ISAPI and Managed Modules on IIS
July 06, 2007 - Hood River, Oregon
So i took a support call from a customer of mine today who ran into problems installing Web Connection on a 64 bit machine. Web Connection works through a 32 bit ISAPI extension and sure enough a standard configuration will not allow this ISAPI extension to run. Any attempt to access a 32 bit...
HttpWebRequest and GZip Http Responses
June 29, 2007 - Hood River, Oregon
I've talked a bit about GZip compression (here and here and here) on the server recently. It's pretty straight forward to use GZip compression either by letting IIS do it for you automatically or by using some simple ASP.NET code to compress content. As a quick review to create GZip content on...
June 22, 2007 - Hood River, Oregon
IIS 7 has improved and simplified support for GZip encoding enabled out of the box and for the most part it seems to be working well on my Vista install. I see my CSS and other text content properly GZip encoded. IIS 7 also allows you to encode dynamic content easily which is nice because that was...
Apache and Script Mapping
June 09, 2007 - Hood River, Oregon
I've been struggling with mapping scripts to a custom ISAPI handler in Apache for some in Web Connection (which is a FoxPro based ISAPI interface). Web Connection works with Apache, but recently with version 2.2 Apache changed its module binary format and required recompilation so I ended up...
IIS 6 Compression and App_Themes CSS
June 05, 2007 - Hood River, Oregon
Hmmm. I finally got around to setting up static GZip compression on my server. I can't remember the reason why I didn't do this sooner, but I today I was looking at some of my CSS files getting out of hand so I thought I better check into this again. It's easy enough to do. MVP Omar Al Zabir has a...
Blocking IIS IP Addresses with ASP.NET
April 28, 2007 - Maui, Hawaii
Over the last few months I've had increasing SPAM traffic coming to my site, usually from a few select IP address groups. Most of this site spamming crap that I actually catch tries to simply POST to every possible URL on the site apparently that contains a FORM tag, spewing forth a plethora of...
Dynamically hooking up HttpModules
April 06, 2007 - Maui, Hawaii
Ran into an interesting question on the ASP.NET newsgroup today regarding a problem I've run into a few times myself. The issue revolves around virtual directory folder inheritance and web.config settings getting inherited from a root Web site. Anyway - one issue that has come up a few times is...
A dynamic class loading HttpHandlerFactory
April 02, 2007 - Maui, Hawaii
Here are a couple of examples of how you can route custom script map extensions to your custom HttpHandlers.
Nested Item Templates for custom script extensions in Visual Studio
March 27, 2007 - Maui, Hawaii
I'm working on an application that's using custom HTTP handlers to handle inbound Web requests where each script request is pointing at an HTTP handler. In this case the handlers need to be individual files so I have a script map configured in IIS with a special extension and then mapped to my...
System.Argument Exceptions in W3wp.exe and the VS Just-in Time Debugger
March 25, 2007 - Maui, Hawaii
I've been noticing that on my server quite frequently I get managed exceptions bubbling up to the Dr. Watson and/or the Visual Studio Just In Time Debugging dialog on the desktop. Now this being a server machine I'm not happy about this happening of course because it clutters the desktop the next...
Update to free Web Configuration Utility
January 25, 2007 - Maui, Hawaii
I've updated my Web Configuration Utility with better support for IIS 7 and configuring .NET versions for a given Web Virtual.
Programmatically listing, getting and setting Application Pools
January 17, 2007 - Maui, Hawaii
Ever need to programmatically list, or get or set an IIS Application Pool? Here's the code to this programmatically with .NET code using DirectoryServices.
IIS 7 Integrated Pipeline Debugging on Vista, again
December 29, 2006 - Maui, Hawaii
Mike Volodarsky posts more information how to get F5 debugging working properly in Visual Studio. Due to the way Authentication works in ASP.NET 2.0 some debugging scenarios with F5 fail and a workaround is required.
IIS 7 Integrated Pipeline Debugging, Visual Studio 2005 SP1 and Request Tracing
December 26, 2006 - Maui, Hawaii
Visual Studio 2005 SP 1 allows debugging IIS 7 applications in Integrated Pipeline mode. In most cases - I've run into a few problems and solutions trying to figure out what went wrong and into one problem that I haven't been able to resolve yet.
IIS 7 and Rapid Fail Protection
December 19, 2006 - Maui, Hawaii
IIS 7 has a new default feature called Rapid Fail Protection which detects failures and if too many failures occur in a specified period shuts down an Application Pool. Useful feature, but a little unexpected if you don't know about it and are wondering why your Application Pool has just shut down and won't restart automatically.
503 Service Unavailable in IIS 7 - watch those Application Pools
December 04, 2006 - Maui, Hawaii
I ran into a funky issue with an application on IIS 7 today on my development machine: One of my Web applications simply would not respond to requests and IIS was reporting a 503 Error – Service Unavailable. Oddly enough though the rest of my Web site was working just fine – just this one...