无法加载文件或程序集'itextsharp',但我添加了引用,所以 [英] Could not load file or assembly 'itextsharp' but i have added the reference and so an

查看:545
本文介绍了无法加载文件或程序集'itextsharp',但我添加了引用,所以的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法加载文件或程序集''itextsharp,Version = 5.4.1.0,Culture = neutral,PublicKeyToken = 8354ae6d2174ddca''或其依赖项之一。系统找不到指定的文件。





Could not load file or assembly ''itextsharp, Version=5.4.1.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca'' or one of its dependencies. The system cannot find the file specified.


Could not load file or assembly 'itextsharp, Version=5.4.1.0, Culture=neutral, PublicKeyToken=8354ae6d2174ddca' or one of its dependencies. The system cannot find the file specified.







<asp:DropDownList ID="DropDownListDownloadCv0" runat="server">
<asp:ListItem>CV</asp:ListItem>
<asp:ListItem>PDF</asp:ListItem>
</asp:DropDownList>







 protected void DownloadCv_Click(object sender, ImageClickEventArgs e)
{
{
string sDirPath = Server.MapPath("~/PDF_WORD/Docs");
var ObjSearchDir = new DirectoryInfo(sDirPath);
if (!ObjSearchDir.Exists)
{
ObjSearchDir.Create();
}
string strFileName =
HttpContext.Current.Server.MapPath("~/PDF_WORD/Docs/Test." + DropDownListDownloadCv0.SelectedValue.ToString() +
"");
var objfileinfo = new FileInfo(strFileName);
// step 1: creation of a document-object
var document = new Document();


if (objfileinfo.Exists)
{
File.Delete(strFileName);
PdfWriter.GetInstance(document, new FileStream(strFileName, FileMode.Create));
}
else
PdfWriter.GetInstance(document, new FileStream(strFileName, FileMode.Create));
// step 2:
// we create a writer that listens to the document
//StringBuilder strB = new StringBuilder();
var sw = new StringWriter();

document.Open();
var hTextWriter = new HtmlTextWriter(sw);



lblphonenumber.RenderControl(hTextWriter);
String strHtml1 = sw.ToString();


var styles = new iTextSharp.text.html.simpleparser.StyleSheet();
var hw = new iTextSharp.text.html.simpleparser.HTMLWorker(document);
hw.Parse(new StringReader(strHtml1));

document.Close();

}



}
Chattkonversationen är avslutad

推荐答案

无法加载文件或程序集''itextsharp,Version = 5.4.1.0,Culture = neutral,PublicKeyToken = 8354ae6d2174ddca''或其依赖项之一。系统找不到指定的文件。

由于错误状态,请确保您的项目所在的系统上有 itextsharp.dll v5.4 看起来像是指。


这篇关于无法加载文件或程序集'itextsharp',但我添加了引用,所以的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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