Why is the Copy Local property for my reference disabled?

C#Visual StudioDll

C# Problem Overview


I am trying to set a referenced DLL to be explicitly copied to my local folder however when I go to the properties for this reference, the Copy Local property is grayed out / disabled.

Disabled Copy Local property

Usually my VB.NET projects have a My Project item directly below the project name which I can double-click >> references and set the Copy Local property, however my C# console application does not seem to have this.

My Project References

Have I perhaps configured my project incorrectly? Any help on this will be greatly appreciated.

C# Solutions


Solution 1 - C#

[Directly from this SO post:][1]

> Your comment to Hans answer indicates this is a COM assembly and that > you are using Visual Studio 2010. > > This means the assembly reference was likely added with the "Embed > Interop Types" setting set to true. This has the effect of linking the > COM assembly into your binary removing the need to deploy it > altogether. The following link has a more detailed explanation > •http://msdn.microsoft.com/en-us/library/dd409610.aspx If you do > want to deploy it though then will need to do the following •Click on > the reference in the references tab •Hit F4 to bring up the > properties grid •Set "Embed Interop Types" to False (this will ungray > Copy Local) •Set "Copy Local" to true

If you want to copy local, you must set Embed Interop Types to False for the assembly, in your case, Microsoft.Office.Interop.Excel. Embed Interop Types makes deployment easier for COM assemblies in that it embeds the assemblies within your assembly, taking away the need to deploy interop assemblies with the application. [1]: https://stackoverflow.com/questions/3635716/visual-studio-copy-dll-refrences-to-output-folder

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionClarice BouwerView Question on Stackoverflow
Solution 1 - C#StoriKnowView Answer on Stackoverflow