Relative file path in XML for FileListGenerator?
Try2BWise
Posts: 4
I have a number of custom file lists I have implemented by creating custom generator configurations. I would like to have the ability to use a relative file path to the text file.
When I select my custom generator I receive the error that the text file specified in the XML cannot be found in the application-wide "External files" path even though the XML and TXT file are both located in the "User defined generators" path.
I suppose I could enter an absolute path in the XML, but I am not sure that would work since SQL Data Generator interpreted my attempt at a relative path as a literal string.
I would like the ability to use a relative path since my SQL Data Generator projects are edited and used by multiple personnel working out of different local source-controlled (Team Foundation Server) directories.
Please let me know if / how I can clarify. Thanks!
When I select my custom generator I receive the error that the text file specified in the XML cannot be found in the application-wide "External files" path even though the XML and TXT file are both located in the "User defined generators" path.
I suppose I could enter an absolute path in the XML, but I am not sure that would work since SQL Data Generator interpreted my attempt at a relative path as a literal string.
I would like the ability to use a relative path since my SQL Data Generator projects are edited and used by multiple personnel working out of different local source-controlled (Team Foundation Server) directories.
Please let me know if / how I can clarify. Thanks!
Comments
SQL Data Generator is actually looking in the "External Files" path set in the application settings when you specify a text file to use as a data source and do not include a path.
You can copy the file to c:\program files (x86)\red gate\sql data generator 3\Config and then go into the .sqlgen file (the project file) using a text editor and change the FileName property for that column's generator to just the filename and it will load the file when you load the project in SDG.
Hopefully that will help.
I'll need to rethink how I manage my solutions with source control ...
Thanks for the reply!
So, a TXT file with a list of tools such as ...
adze
allen wrench
anvil
...becomes (adze|allen wrench|anvil).
I used a macro in Notepad++ to reformat the text and kept the original TXT file around for reference. Now all the values are embedded in the XML, stored in source control, and my file path problem is eliminated.