I have a main application (web application) that consumes various other project (directly and chain). One of the projects happens to be Project named Parser. Parser project contains a dll, which is not refered as it is native dll. Properties of the dll file says Build Action: Content and Copy to o/p directory: copy always.

Now when i do a build of my main aplication the native dll is copied to my applications bin and everything works great. But when I publish the application the packages bin does not contain the native dll.

My question is why is the dll not copied when I publish?

There is another project in the solution that has a folder within called temps, it contains a bunch of htm files. the properties of the files are Build Action: Content and Copy to o/p directory: copy always.. In the published package these files and folders are present.

So why are the htm files copied and not the dll file? Are they treated any differently?

None of the projects have any pre or post build events.

2 Years
Discussion Span
Last Post by LaxLoafer

I believe you need to add the native DLL to the project in Solution Explorer. However selecting 'Include in Project' alone is not always enough. Depending on the filetype you may need to manually set the 'Copy to Output Directory' property. I don't know why Visual Studio behaves this way, perhaps it's a bug?

Setting the property within Solution Explorer can be a laborious task. If you ever need to set the property on multiple files you'll probably find it quicker to edit the project file directly.

Which version of VS are you using?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.