I created a Dai_ExcelLab.dll
to output excel file as image:
I had add Dai_ExcelLab.dll
to my visual web part:
And using:
protected void btnExport_Click(object sender, EventArgs e)
{
try
{
//Export();
Dai_ExcelLab.ComExcel oExcel = new Dai_ExcelLab.ComExcel();
oExcel.OutputExcel("c:\\test.xlsx", null);
}
catch(Exception ex)
{
}
}
Build Deploy is ok, but click button Export , it occur error:
[FileLoadException: Could not load file or assembly 'Dai_ExcelLab, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)]
VisualWebPartProject2.VisualWebPart1.VisualWebPart1UserControl.btnExport_Click(Object sender, EventArgs e) +0
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +11762420
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +150 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5028
How can add a library into visual web part 2016?