Let's say we have a solution with the following structure:
When Project.UI is compiled, VS is smart enough to copy Project.DAL.dll to the output directory, but it's not smart enough to figure out that I wanted Oracle.DataAccess to be copied to the output directory as well for distribution to clients.
Can anyone explain why this is so? Is it because it sees Oracle.DataAccess in the GAC and assumes that clients will have it in the GAC as well?
It's not that big of a deal, but it's kinda annoying that every time I add a new assembly reference, I have to remember to set it to copy local and add an item to copy it in my build script as well.
"Copy to Output Directory" is the property of the files within a Visual Studio project, which defines if the file will be copied to the project's built path as it is. Coping the file as it is allows us to use relative path to files within the project.
Right-click on the project node in Solution Explorer and select Properties. Expand the Build section, and select the Output subsection. Find the Base output path for C#, and type in the path to generate output to (absolute or relative to the root project directory), or choose Browse to browse to that folder instead.
The root of the uncompressed files tree is formed by a subfolder called Target System in the package's output folder; this corresponds to the Target System root node on the Files and folders project page. The other folders are created under the Target System subfolder.
One more thing.
When you don't use the referenced DLL in your code at all, it will ignore the CopyLocal and won't copy it to your output directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With