1

我已经为项目添加了参考 PDFSharp 类。当我尝试在包含 PDFSharp 库的类中使用方法时,我得到一个FileNotFoundException声明我缺少引用的 (PDFSharp) 文件(虽然我可以向您保证 dll 文件在那里)。

所以我尝试添加、读取和更改 dll 版本,但仍然没有成功。所以我切换到 PDFClown,一个类似用途的库,但错误是一样的:FileNotFoundException在运行时。

甚至在方法执行之前就抛出异常。

调用方法(抛出异常的地方):

//method call: here the debugger stops at the breakpoint
ReportUtils.CreateFile(tempDirectoryPath ecc);

调用方法:

using org.pdfclown.documents;
using org.pdfclown.documents.contents.composition;
using org.pdfclown.documents.contents.fonts;
using clownFiles = org.pdfclown.files;

class ReportUtils
{
    public static void CreateFile(/*parameters*/)
    {
             //the debugger never enter here: the exception is thrown before
             string filename = Settings.ReportFileName + String.Format("{0:yyyyMMddHHmmssffff}", DateTime.Now);
             //ecc
    }
//...

为什么会出现这个异常?添加参考文献我做错了吗?

4

1 回答 1

1

Copy Local我可以通过将我的库上的选项设置为false. 请确保此布尔值设置为true..

在此处输入图像描述

于 2013-09-19T11:00:41.550 回答