Skip to content

duplicate fs file add to tempfiles #18

@ingted

Description

@ingted

Description

when codeStrings has not only one string in it
provider.CompileAssemblyFromSource(params', codeStrings)
would throw exception at CodeProvide.fs

around line 113 when AddExtension("fs", false)

Repro steps

Expected behavior

different .fs file name should be generated and add to tempfiles

Actual behavior

the second Array.map would call AddExtension("fs", false)
but with the same file name

Known workarounds

I use guid string file name with AddFile to replace AddExtension

            sources |> Array.map (fun src ->
                let fn = Guid.NewGuid().ToString() + ".fs"
                res.TempFiles.AddFile(fn, false)
                use wr = new StreamWriter(fn)
                wr.Write(src)
                fn)

Related information

  • Operating system
    Win 2012R2
  • Branch
    master
  • .NET Runtime
    4.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions