Published and installed program using LinqToExcel throws an "Exception has been thrown by the target of an invocation" exception. Inner exeption is not displayed but on my computer if I run exe file separately w/o another source files there is Could not load file or assembly linqtoexcel. but it is only on my PC when I tried to run it separately. But I beleave it is similar?
Both PCs are Win10, Access DB Engine 64bits or 64bits Offices are installed.
public void ImportNewData(String file)
{
ExcelConnector excel = new ExcelConnector(file);
foreach(var result in excel.ReadNewData())
{
this.loopsList.Add((Loop) result);
}
}
public IEnumerable ReadNewData() {
try
{
var query = from a in this.ExcelConnection.Worksheet < Loop > ("Data")
select a;
return query;
}
catch (Exception exeption)
{
MessageBox.Show(exeption.Message + "\n" + exeption.InnerException.Message + "\n" + exeption.InnerException.Source, "Warning");
return null;
}
}
I expect it will run on any Windows machine :)