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.
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.
Embed Interop Types property was introduced in VS 2010 to remove the dependency of deploying PIAs.
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