IIS is having a problem when someone requests a malformed URL like this:

http://www.our_web_site.com/directory/dir/a:a.aspx

The exception is "NotSupportedException / The given path's format is not
supported. (The event that appears in the event viewer is a little lengthy; I
have included it at the bottom of this message.)

"dir" is configured as an ASP.NET 2.0 application.

I want IIS to process a custom error page, preferably in the 4xx range. Is
it possible to configure IIS and/or ASP.NET to do this?

Here is the text of the event:
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 2008/06/30
Time: 3:02:12 PM
User: N/A
Computer: WEBMACHINE7
Description:
Event code: 3005
Event message: An unhandled exception has occurred.

Application information:
Application domain:
/LM/W3SVC/87292621/Root/directory/dir-2-128593332321213556
Trust level: Full
Application Virtual Path: /directory/dir
Application Path: D:\site\content\directory\dir\
Machine name: WEBMACHINE7

Process information:
Process ID: 6352
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: NotSupportedException
Exception message: The given path's format is not supported.

Request information:
Request URL: http://our_web_site/directory/dir/a:a.aspx
Request path: /directory/dir/a:a.aspx
User host address: 172.31.255.104
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 6
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID,
VirtualPath path)
at
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String siteID, VirtualPath vpath)
at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath
virtualPath, Boolean permitNull)
at System.Web.CachedPathData.GetConfigPathData(String configPath)
at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath,
Boolean permitPathsOutsideApp)
at System.Web.HttpContext.GetFilePathData()
at System.Web.HttpContext.GetConfigurationPathData()
at System.Web.Configuration.RuntimeConfig.GetLKGConfig(HttpContext context)

Re: bad URL generates unhandled exception by Ken

Ken
Wed Jul 02 21:10:19 CDT 2008

Hi,

This isn't an IIS error - it's ASP.NET saying that it won't handle requests
with a specific string in the path name. What HTTP status is ASP.NET
generating? HTTP 500 Internal Server Error is my guess. You can perhaps use
the global exception handling routines (in .NET) to catch the error , and
substitute your own HTTP status code instead.

Cheers
Ken

--
My IIS blog: http://adopenstatic.com/blog


"Cam" <Cam@discussions.microsoft.com> wrote in message
news:293B2F0D-AA96-470D-B7C1-4D278B1822CD@microsoft.com...
> IIS is having a problem when someone requests a malformed URL like this:
>
> http://www.our_web_site.com/directory/dir/a:a.aspx
>
> The exception is "NotSupportedException / The given path's format is not
> supported. (The event that appears in the event viewer is a little
> lengthy; I
> have included it at the bottom of this message.)
>
> "dir" is configured as an ASP.NET 2.0 application.
>
> I want IIS to process a custom error page, preferably in the 4xx range. Is
> it possible to configure IIS and/or ASP.NET to do this?
>
> Here is the text of the event:
> Event Type: Warning
> Event Source: ASP.NET 2.0.50727.0
> Event Category: Web Event
> Event ID: 1309
> Date: 2008/06/30
> Time: 3:02:12 PM
> User: N/A
> Computer: WEBMACHINE7
> Description:
> Event code: 3005
> Event message: An unhandled exception has occurred.
>
> Application information:
> Application domain:
> /LM/W3SVC/87292621/Root/directory/dir-2-128593332321213556
> Trust level: Full
> Application Virtual Path: /directory/dir
> Application Path: D:\site\content\directory\dir\
> Machine name: WEBMACHINE7
>
> Process information:
> Process ID: 6352
> Process name: w3wp.exe
> Account name: NT AUTHORITY\NETWORK SERVICE
>
> Exception information:
> Exception type: NotSupportedException
> Exception message: The given path's format is not supported.
>
> Request information:
> Request URL: http://our_web_site/directory/dir/a:a.aspx
> Request path: /directory/dir/a:a.aspx
> User host address: 172.31.255.104
> User:
> Is authenticated: False
> Authentication Type:
> Thread account name: NT AUTHORITY\NETWORK SERVICE
>
> Thread information:
> Thread ID: 6
> Thread account name: NT AUTHORITY\NETWORK SERVICE
> Is impersonating: False
> Stack trace: at
> System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String
> siteID,
> VirtualPath path)
> at
> System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath2.MapPath(String
> siteID, VirtualPath vpath)
> at System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath
> virtualPath, Boolean permitNull)
> at System.Web.CachedPathData.GetConfigPathData(String configPath)
> at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath,
> Boolean permitPathsOutsideApp)
> at System.Web.HttpContext.GetFilePathData()
> at System.Web.HttpContext.GetConfigurationPathData()
> at System.Web.Configuration.RuntimeConfig.GetLKGConfig(HttpContext
> context)
>