diff --git a/fsxc/Fsxc.fs b/fsxc/Fsxc.fs
index 7eb8bc0..44975b4 100644
--- a/fsxc/Fsxc.fs
+++ b/fsxc/Fsxc.fs
@@ -710,6 +710,17 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
: FileInfo =
let projectFile = GetAutoGenerationTargets origScript "fsproj"
+ let addFile relativeOrAbsoluteFilePath =
+ let fsProjFragment =
+ sprintf
+ ""
+ relativeOrAbsoluteFilePath
+
+ File.AppendAllText(
+ projectFile.FullName,
+ fsProjFragment + Environment.NewLine
+ )
+
let rec iterate(lines: List) : unit =
match lines with
| head :: tail ->
@@ -741,16 +752,13 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
+ Environment.NewLine
)
| PreProcessorAction.Load fileName ->
- let fsProjFragment =
+ addFile(
sprintf
- ""
+ "..%c%s"
Path.DirectorySeparatorChar
fileName
-
- File.AppendAllText(
- projectFile.FullName,
- fsProjFragment + Environment.NewLine
)
+
| PreProcessorAction.Ref refName ->
let fsProjFragment =
if refName.ToLower().EndsWith(".dll") then
@@ -797,13 +805,9 @@ let fsi = { CommandLineArgs = System.Environment.GetCommandLineArgs() }
iterate contents
- File.AppendAllText(
- projectFile.FullName,
- "
-
- "
- .Replace("{userScriptFileName}", origScript.Name)
- )
+ addFile origScript.Name
+
+ File.AppendAllText(projectFile.FullName, "")
projectFile
#endif