[corlib] Improve file:// url handling in AppDomainSetup. (#16161)
commit068660732fbf10cae688182ef67f72cf80ebb632
authorNikolay Sivov <nsivov@codeweavers.com>
Thu, 22 Aug 2019 14:54:32 +0000 (22 17:54 +0300)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 22 Aug 2019 14:54:32 +0000 (22 16:54 +0200)
tree913402025acf1b97cdcab0167d49f8aff97ad7f9
parente74736a471f50781db06914f1c048aadabfb52bc
[corlib] Improve file:// url handling in AppDomainSetup. (#16161)

* [corlib] Improve file:// url handling in AppDomainSetup.

WiX 3 installer toolkit uses file:/// prefix when setting ApplicationBase for newly created domain.
Currently this leads to invalid path exception:

file:///C:\... -> /C:\... -> full path expansion with current workdir on different drive -> Y:\C:\...

Later it fails check for multiple ':' -> NotSupportedException ("The given path's format is not supported.").

This patch uses logic already present in AppDomain::Load().

* [Test] Add a test for file:/// application base.

* [Test] Fix test failure on Windows.

* [corlib] Simplify file: protocol check for AppDomainSetup.
mcs/class/corlib/System/AppDomainSetup.cs
mcs/class/corlib/Test/System/AppDomainSetupTest.cs