0
votes

I have a C# program that uses Excel Automation. I tried to mono compile this VS program on Windows and get the following exceptions. Being a newbie, I'm not sure how to correct this problem. This program does work when I build using VS.

c:\RedLines011Test>mono bin\redlines.exe

//Unhandled Exception: System.IO.FileNotFoundException: Could not load file or ass //embly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, Public //KeyToken=71e9bce111e9429c' or one of its dependencies. //File name: 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, P //ublicKeyToken=71e9bce111e9429c' //[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not lo //ad file or assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=n //eutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. //File name: 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, P //ublicKeyToken=71e9bce111e9429c'

1
Isn't MS.office.Interop based on COM? Not sure if Mono does COM or not.kenny

1 Answers

1
votes

The error message means your Office interop assemblies are not available. They are most likely installed in .NET GAC which Mono does not use (it has its own GAC). You could use Mono's gacutil to install them or simply copy them to the folder where your .exe is. Having said that the COM interop in Mono is not very advanced and it may fail on the first hurdle and you definitely cannot expect this to work on non-Windows machine.