I made a Windows wpf project in Net7.0 and 8.0 installed Npoi project from nuget, I tried calling something from Npoi everything works. In the rhino multitarget plugin project, however, I just can’t load the DLL. First of all, to make it work I had to remove the nuget reference because it was the rhinocommon only of the netframework, and I inserted a reference to the rhinocommon of the netcore. The plugin works in general but if I use the Npoi Dll it doesn’t see it. In NetFramewrok however everything works. This is the simple code i used to try Npoi :
try
{
NPOI.SS.UserModel.IWorkbook workbook = new NPOI.XSSF.UserModel.XSSFWorkbook();
// Aggiungi un foglio al workbook
NPOI.SS.UserModel.ISheet sheet = workbook.CreateSheet("Example Sheet");
// Crea una riga nel foglio a indice 0 (prima riga)
NPOI.SS.UserModel.IRow row = sheet.CreateRow(0);
// Crea una cella nella riga a indice 0 (prima cella)
NPOI.SS.UserModel.ICell cell = row.CreateCell(0);
// Imposta il valore della cella
cell.SetCellValue("Hello NPOI!");
// Salvare il file
using (var stream = new FileStream("example.xlsx", FileMode.Create, FileAccess.Write))
{
workbook.Write(stream);
}
System.Windows.MessageBox.Show("Done");
}
catch (Exception ecc)
{
System.Windows.MessageBox.Show(ecc.Message);
}