的引用我正在嘗試在Windows Mobile的C#程序中包含一個html轉換爲pdf轉換器。 我找到了Pdfizer。 我向Pdfizer.dll添加了一個引用,並將其與using Pdfizer;
一起添加了。另外我還添加了對Pdfizer所需的itextsharp的引用。您必須添加對程序集'系統,版本= 1.0.5000.0
Pdfizer正確添加,我可以使用它的許多功能和類,但我不能使用HtmlToPdfConverter.Run()
我的代碼:
FileStream filePDF;
filePDF = File.Create(path + ".pdf"); // path is string
html2pdf.Open(filePDF);
html2pdf.AddChapter(@"Chapter name");
html2pdf.Run(html); // html is a string that contains html code
html2pdf.Close();
問題是線html2pdf.Run(html);
它說:
Error 1 The type 'System.Uri' is defined in an assembly that is not referenced.
You must add a reference to assembly 'System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
的Run
定義是
public void Run(string html);
public void Run(Uri uri);
我正在嘗試使用Run(string html)
選項,但Uri已定義,Visual Studio表示它未被引用,但是是。
我有using System;
,其中包含Uri
類,的確我在其他功能中使用它並正常工作。
問題是什麼?我應該添加對System, Version=1.0.5000.0
的引用嗎?我在哪裏可以找到它?有沒有辦法告訴Pdfizer Uri在System.Uri中?
感謝
我在嘗試使用RestSharp時遇到了類似的情況。此代碼: RestRequest請求=新的RestRequest(「api/departments /」,Method.GET); 引發編譯時錯誤:「類型'System.Uri'在未引用的程序集中定義,您必須添加對程序集'System,Version = 2.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'的引用」 「我已經在其他地方看到RestSharp可以從Windows CE客戶端使用,所以我陷入了僵局...... – 2013-10-10 16:26:47
我引用的系統程序集位於C:\ Program Files(x86)\ Microsoft.NET \ SDK \ CompactFramework \ V3.5 \ Windows CE的\ System.dll中。運行時版本== v2.0.50727,版本== 3.5.0.0 – 2013-10-10 16:30:03
*所有*程序集必須引用CF.所有第三方程序集,DLL等都必須已經引用CF來構建。 – ctacke 2013-10-10 16:47:42