diff --git a/src/app/FakeLib/AssemblyInfoFile.fs b/src/app/FakeLib/AssemblyInfoFile.fs index 7e423844d02..b863c90575e 100644 --- a/src/app/FakeLib/AssemblyInfoFile.fs +++ b/src/app/FakeLib/AssemblyInfoFile.fs @@ -101,7 +101,9 @@ type Attribute(name, value, inNamespace) = let private writeToFile outputFileName (lines : seq) = let fi = fileInfo outputFileName if fi.Exists then fi.Delete() - System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(outputFileName)) |> ignore + let dirName = System.IO.Path.GetDirectoryName(outputFileName) + if not (isNullOrEmpty dirName) then + System.IO.Directory.CreateDirectory(dirName) |> ignore use writer = new System.IO.StreamWriter(outputFileName, false, System.Text.Encoding.UTF8) lines |> Seq.iter writer.WriteLine tracefn "Created AssemblyInfo file \"%s\"." outputFileName