fix name collision with multiple copied files from seperate dll (s) in a test project

150 views Asked by At

I'm making a translation program.

I have multiple project (s), which are class libraries, one for translating to English and Spanish.

They both have a file called irregulars.txt, which has "Copy if Newer" set, for irregular verbs but when I run the unit tests I get a name collision of both irregulars.txt. So, the Spanish and English irregular verbs are both the Spanish which makes it not work.

I am using Visual Studio Enterprise 2017 RC on Windows 10.

How can I stop this name collision?

1

There are 1 answers

0
Herman On BEST ANSWER

The best approach would be not to hardcode the path of the files, but instead use some kind of configuration. For example, use a configuration file or command line parameters.

An ugly solution would be to use #if and compiler constants to change the source based on which DLL it is used in.