Repro Steps:
static void Main(string[] args)
{
var d = new DirectoryInfo(@"C:\");
d.CreateSubdirectory("blah");
}
Fail when building with netcoreapp2.1
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>
## version 2.1.300
> dotnet.exe run
Unhandled Exception: System.ArgumentException: The directory specified, 'blah', is not a subdirectory of 'C:\'.
Parameter name: path
at System.IO.DirectoryInfo.CreateSubdirectory(String path)
at dumpConsole.Program.Main(String[] args) in E:\arena\dotnetApp\test\dumpConsole\Program.cs:line 11
Work when building with netcoreapp2.0
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>
## version 2.1.300
> dotnet.exe run
## the folder "c:\blah" was created successfully.
This regression might be introduced by dotnet/corefx#27810