Http Client Protocol Issues

If you use any of these solutions, Please let me know so I can track if any of this is useful to you! Thanks! This is an area to share observations I have made working with Http Client Protocols and the associated technologies. I currently work for the Microsoft team that supports the WinInet, WinHTTP and System.Net API's and classes associated with these technologies. This is not a replacement for Microsoft Support, but an area to discuss these technologies. These postings are provided "AS IS" with no warranties, and confer no rights. Use of included code samples are subject to the terms specified at Microsoft - Information on Terms of Use

System.ArgumentException: Absolute path information is required.

You have a .NET 2.0 control hosted in a browser.  The control uses the System.Uri class.  When upgrading to .NET 2.0 SP1 you can get an error: System.ArgumentException: Absolute path information is required.

Four conditions must exist for this to happen:

1. Using the 2.0 Framework SP1
2. Control uses the System.Uri class
3. Uri class passed a URI that has escaped characters (% escaped or puny code)
4. Control has a .config file on the http server

The same error can occur in an application that Creates an AppDomain and points to a web location for the application configuration file.

The problem occurs because of a new test in the System.Uri class that checks for a config file when it encounters an escaped URI as an input.  It demands that the configuration file reside on a local disk.  If the class is a WebApplication (ASP.NET) then it will not have the problem.  Due to the nature of this test, you have to fool the code to make it think it is a web application.  The control will have to have the necessary permissions to modify the appdomain however.

For a Browser hosted control you could do this:

AppDomain.CurrentDomain.SetData(".appVPath", "/");

or if you have created your own domain (in a desktop app for example) set that domain property:

myNewDomain.SetData(".appVPath", "/");

Hope this helps!  Let me know if you are able to use this information.

Published Tuesday, December 18, 2007 9:07 AM by jpsanders

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker