The parameter to the CSV type provider needs to be a constant, so that the types can be generated at compile-time (without actually evaluating the program. However, you can load a different file with the same schema at runtime.
So, the best way to handle this is to copy one of your actual inputs to some well-known location (e.g. sample.csv
in the same directory as your script) and then use the actual path at runtime:
// Generate type based on a statically known sample file
type GenomeFile = CsvProvider<"sample.csv">
// Load the data from the actual input at runtime
let actualData = GenomeFile.Load(fstFile.FullName.ToString())