Freigeben über


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.