问题
I have a problem that could be viewed as an extension of this question in which the user is having problems with external aliases not working.
The variation I am experiencing is that the two projects output the same file name. The first (we'll call Legacy since it's the older version) contains classes which have been binary-serialized. The second (Current) is the next version of my domain. I'm trying to create a conversion library (Compatibility) which will map Legacy to Current for use in the new domain.
Because both projects build to MyApp.Domain.dll, one is overwritten by the other when the assemblies are copied into the output folder for Compatibility. When this happens, the compiler can't recognize that I have two versions of the same assembly because I actually have only one file with that name.
It looks something like this:
Project Output
MyApp MyApp.exe
Legacy MyApp.Domain.dll
Current MyApp.Domain.dll
I realize that one solution would be to alter the output file name of Current (adding a 'V2' or similar), but I'd prefer not to if it can be avoided; I like keeping the 'MyApp.Domain' signature. Alternatively, is there a way I can instruct the compiler to copy the output of Legacy into a subfolder of the output folder and then reference them there? Are there any other solutions?
来源:https://stackoverflow.com/questions/15238705/extern-alias-with-same-assembly-file-name