I'm working on a C# application which requires integrating with another company's software. I have isolated all of the code that is tightly coupled to this integration in a single C# project. This way, if the company changes something with their integration, I only have to change code in this one project. The project is a non-executable class library (Project A).
One weird/annoying part of this integration though is that it involves manually copying compiled .dll
files from the company's SDK into the bin
directory of the project after the project is built. I can't just use a nuget package or something similar. While annoying, I have automated it with a post-build script and it works well enough for that specific project.
I then reference this project/class library from an executable class library, such as a .NET Framework Console project (Project B).
Now I have a problem:
Build Project A
Runs post-build script XCopy C:\CompanyIntegration\Autofac.dll "${TargetDir}"
.
Compiles without any issues.
Build Project B
Compiles Project A, copies .dlls from Project A bin
to Project B bin
.
The copied Autofac.dll
from Project A overwrites one installed via a nuget package.
The build throws an exception because it expected a different Autofac.dll
.
How can I tell the build process to differentiate between these two different Autofac
versions/dlls?
Why are the company integration .dll
files copied from the bin
folder of Project A to the bin
folder of Project B in the first place?