[英]Program using LinqToExcel works on my computer but after publishing and installation on another one it does not
Published and installed program using LinqToExcel throws an "Exception has been thrown by the target of an invocation" exception.使用 LinqToExcel 发布和安装的程序会引发“调用目标已引发异常”异常。 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.
内部排除不显示,但在我的计算机上,如果我单独运行 exe 文件而没有其他源文件,则会出现无法加载文件或程序集 linqtoexcel。 but it is only on my PC when I tried to run it separately.
但当我尝试单独运行它时,它仅在我的 PC 上。 But I beleave it is similar?
但我相信它是相似的吗?
Both PCs are Win10, Access DB Engine 64bits or 64bits Offices are installed.两台PC都是Win10,安装了Access DB Engine 64bits或64bits Office。
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 :)我希望它可以在任何 Windows 机器上运行:)
I unchecked this check box and now it works also with 64bit Office.我取消选中此复选框,现在它也适用于 64 位 Office。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.