Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.Office.Interop.Excel.dll not included in Build Folder

Tags:

c#

excel

I write a Console Application with C#, .NET Framework 4.0.

This project reference to Microsoft.Office.Interop.Excel.dll.

When i build project successful, but in build folder not included Microsoft.Office.Interop.Excel.dll.

When i change to .NET 2.0 and build it, Microsoft.Office.Interop.Excel.dll is included!

But i want to build and run my program in .NET 4.0.

I use VS 2010.

Show me how to fix.

like image 599
Sonrobby Avatar asked Dec 27 '12 03:12

Sonrobby


1 Answers

Check if the Copy Local is set to true for the referenced DLL.

You will first need to set "Embed Interop Types" property to false. Then you can set the Copy Local" property to true.

enter image description here



Embed Interop Types property was introduced in VS 2010 to remove the dependency of deploying PIAs.

like image 150
coder_bro Avatar answered Oct 19 '22 18:10

coder_bro