0

I added a new reference in my project and it works locally but when I copy the site to another server it doesnt work because it cant see the DLL. When I check the object explorer it seems the dll is located at:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15\Microsoft.Office.Interop.Excel.dll

How can I update this so it points to the dll inside the project and I can copy it? I did look at this answer Visual Studio: Relative Assembly References Paths but there is no paths or reference paths section in my properties window (its a website not an application)

Community
  • 1
  • 1
CerIs
  • 527
  • 3
  • 6
  • 14
  • _"when I copy the site to another server"_ - you [need to install Excel on the server](http://stackoverflow.com/questions/11448197/how-to-use-microsoft-office-interop-excel-on-a-machine-without-installed-ms-offi), and [that is not recommended nor supported](https://support.microsoft.com/en-us/kb/257757). – CodeCaster Jan 17 '16 at 17:46

1 Answers1

-1

Manually copy the Interop.Excel.dll to the BIN / Debug folder on the server - next to your 'web' DLL

Jon
  • 1,608
  • 7
  • 25
  • 38
  • You don't have to do that if you install the Primary Interop Assemblies with Excel on the server, the latter of which you need to do anyway (but shouldn't). – CodeCaster Jan 17 '16 at 17:49
  • Added dll to the bin but coming up: Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. – CerIs Jan 17 '16 at 19:03
  • Need Office installed or PIA - InterOp Excel is a wrapper for Excel. – Jon Jan 17 '16 at 22:55