电子表格齿轮未加载 [英] Spreadsheetgear not loading

查看:159
本文介绍了电子表格齿轮未加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只要我到达生成excel表的代码部分,就会收到此错误.

I receive this error whenever I reach the part of the code that generates an excel table.

无法加载SpreadsheetGear2012.Drawing.dll或 SpreadsheetGear2012.Windows.WPF.dll,其中包含图形 功能.

Unable to load SpreadsheetGear2012.Drawing.dll or SpreadsheetGear2012.Windows.WPF.dll which contain graphics capabilities.

我尝试卸载并重新安装SpreadsheetGear;删除组件并将其放回原处,但问题仍然存在.

I tried uninstalling and reinstalling SpreadsheetGear; removing the assembly and bringing it back but the problem still persists.

我正在使用带有c#的电子表格.

I'm using spreadsheetgear with c#.

推荐答案

发生此异常的一个常见原因是,如果您有多个直接或间接利用SpreadsheetGear的VS项目,例如:

One common reason this exception can occur is if you have multiple VS Projects that utilize SpreadsheetGear directly and indirectly, such as the following:

  • 项目A –直接利用SpreadsheetGear
  • 项目B –直接使用项目A,但不直接使用SpreadsheetGear

在这种情况下,您仍然需要在Project中添加对其中一个图形程序集( SpreadsheetGear2012.Drawing.dll SpreadsheetGear2012.WPF.dll )的引用. B,因为核心"会在运行时动态尝试加载可用的图形程序集,而Visual Studio不会始终将所有必要的SpreadsheetGear程序集复制到Project B的bin文件夹中.您还可以确保将所有程序集的属性"面板中的复制本地"选项设置为true,并确保它们都匹配版本号.

In such a case you would still need to add a reference to one of the graphics assemblies (SpreadsheetGear2012.Drawing.dll or SpreadsheetGear2012.WPF.dll) in Project B because the "Core" dynamically attempts to load an available graphics assembly at runtime and Visual Studio won't always copy over all the necessary SpreadsheetGear assemblies into Project B's bin folder. You might also ensure that the "Copy Local" option in the Properties panel for all of our assemblies is set to true, and that they all match as far as version number.

通常,即使您在工作簿上执行的任务不涉及UI,核心"通常也需要访问图形程序集以执行某种类型的文本测量类型的工作.例如,在一系列单元格上调用AutoFit()将触发对我们图形组件之一的调用,以测量文本并相应地调整列.如果要保存的文件包含形状,形状依赖行/列偏移进行定位,则保存工作簿的行为也可能触发对图形程序集的调用,而形状又依赖于使用默认值测量的字符单位"工作簿的字体.

Often times the "Core" needs to access a graphics assembly to do some sort of text-measuring type of work, even if the task you are performing on the workbook does not involve a UI. For instance, calling AutoFit() on a range of cells would trigger a call into one of our graphics assemblies to measure text and fit the column(s) accordingly. Just the act of saving a workbook could also trigger a call into a graphics assembly if the file being saved contains shapes, which rely on row/column offsets for their positioning, which in turn rely on "Character Units" that are measured using the default font for the workbook.

您可以在以下位置阅读有关SpreadsheetGear的各种汇编文件的更多信息: http://www.spreadsheetgear.com/support/help/eBookgear.net.7.0/#Key_Concept_SpreadsheetGear_Assemblies.html

You can read more about SpreadsheetGear's various assembly files at: http://www.spreadsheetgear.com/support/help/spreadsheetgear.net.7.0/#Key_Concept_SpreadsheetGear_Assemblies.html

这篇关于电子表格齿轮未加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆