Microsoft Knowledge Base Email Alertz

Error message when a CGI program that is written by using the .NET Framework 2 makes Web service calls: System.ArgumentException: Illegal characters in path

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 922780 - Last Review: August 5, 2006 - Revision: 1.2

Error message when a CGI program that is written by using the .NET Framework 2 makes Web service calls: "System.ArgumentException: Illegal characters in path"

SYMPTOMS

Consider the following scenario. A Common Gateway Interface (CGI) program is written by using the Microsoft .NET Framework 2. The CGI program is running on Microsoft Internet Information Services (IIS) 6.0. When the CGI program makes Web service calls, the CGI program fails. Additionally, you receive the following exception error message:
System.ArgumentException: Illegal characters in path

CAUSE

This problem occurs because IIS 6.0 starts CGI processes with the \\?\ path prefix to prevent path canonicalization attacks. Certain components of the .NET Framework 2 cannot handle such paths correctly.

WORKAROUND

To work around this problem, follow these steps:
  1. Click Start, click Run, type inetmgr, and then click OK.
  2. In the left pane, expand the computer_name, and then expand Web Sites.
  3. Right-click the Web site that hosts the CGI program, and then click Properties.
  4. Click the Home Directory tab, and then click Configuration.
  5. Click the Mappings tab, and then click Add.
  6. Click Browse, locate and then double-click the CGI program executable file.

    Note After the path appears in the Executable box, click in the Executable box to initialize the path.
  7. In the Extension box, type .exe, and then click OK three times.

APPLIES TO
  • Microsoft .NET Framework 2.0
Keywords: 
kbprb kbtshoot KB922780
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate