Aniruddha Pondhe
Aniruddha Pondhe

Reputation: 1870

Visual Studio Publish Not Copying All DLLs to Publish Folder

I have a Web Project A which is my startup project and I publish from this web project.

A refers to another project -> B (A has project reference to B)

B contains a reference "ref.dll"

When I build B, all DLLs of B including "ref.dll" gets copied to bin folder of A

However, when I publish A, I cannot see the "ref.dll" in the published folder.

I learnt somewhere that Visual Studio is intelligent enough to not copy a DLL if the any of it's methods are not being used anywhere. In my case, I have verified that methods in "ref.dll" are being used.

Why is it so? Do I need to explicitly add reference to "ref.dll" in WebProject A, for it to appear in the publish folder?

Upvotes: 11

Views: 8496

Answers (1)

Anwar Ul-haq
Anwar Ul-haq

Reputation: 1881

Try setting Copy Local = true for the dll which is in project B.

enter image description here

Upvotes: 2

Related Questions