简体   繁体   English

使用 LinqToExcel 的程序可以在我的电脑上运行,但在另一台电脑上发布和安装后就不行了

[英]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。

32

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C#MysqlConnector可在我的一台计算机上运行,​​但不能在另一台计算机上运行 - C# MysqlConnector works on one of my computers but not on another computer OpenCV程序无法在另一台计算机上运行 - OpenCV Program does not work on another computer 一个程序在我的计算机上工作正常,但是当我使用荷兰语Windows在另一个程序上发送该程序时,DateTimePicker出现了问题 - A program worked fine on my computer but when I sent it on another one with a Dutch Windows it has problems with the DateTimePicker 为什么我的应用程序可以在我的计算机上运行,但不能在其他计算机上运行 - Why does my app works on my computer but not on others C#DllImport调用在一台计算机上引发异常,但在另一台计算机上有效 - C# DllImport call throws an exception on one computer, but works on another webrequest的相同方法在一个程序中有效,而在另一个程序中无效 - The same method with webrequest works in one program but not in another 无法从我的程序写入另一台计算机上的XML文件 - Cannot write to XML file in another computer from my program 为什么dataGridView只在我自己的计算机上工作? - Why does the dataGridView works only on my own computer? 在另一台计算机上使用我编译的.exe文件后,声音无法播放 - Sound doesn't play after using my compiled .exe file on another computer 使用LinqToExcel创建XML - Using LinqToExcel to Create XML
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM