We were creating PDF using ASP.NET Core 5 and when we upgrade the ASP.NET core to version 6, we are getting error. Can you pls advise if GroupDocs supports ASP.NET core 6?
Yes, API supports .NET Core 6.0. Could you please share a simple console application developed on top of .NET Core 6, using that issue could be reproduced at our end?
Here you go Atir.
using GroupDocs.Assembly;
using GroupDocs.Assembly.Data;
namespace GroupDocsConversionSample
{
internal class Program
{
static void Main(string[] args)
{
try
{
string productJsonFilePath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "Product.json");
string productPdfpath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "ProductData.pdf");
string productTemplete = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "Product.html");
string groupDocslicensePath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "GroupDocs.Conversion.NET.lic");
// Reading the groupDocs license key
using (FileStream groupDocsfileStream = System.IO.File.Open(groupDocslicensePath, FileMode.Open, FileAccess.Read))
{
GroupDocs.Conversion.License groupDocslicense = new GroupDocs.Conversion.License();
groupDocslicense.SetLicense(groupDocsfileStream);
}
// Instantiate JSON data source
JsonDataSource productJsonDataSource = new JsonDataSource(productJsonFilePath);
// Generate Product PDF File
DocumentAssembler assembler = new DocumentAssembler(); //Here here UseReflectionOptimization is not set due to version issue
assembler.AssembleDocument(productTemplete,
productPdfpath,
new DataSourceInfo(productJsonDataSource, "ProductData"));
}
catch (Exception exception)
{
Console.WriteLine(exception.ToString());
}
}
}
}
Hi Team
We are creating PDF using ASP.Net Core 6. Its throwing runtime error. Any clues?
I have written a sample as below:
==
using GroupDocs.Assembly;
using GroupDocs.Assembly.Data;
namespace GroupDocsConversionSample
{
internal class Program
{
static void Main(string[] args)
{
try
{
string productJsonFilePath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "Product.json");
string productPdfpath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "ProductData.pdf");
string productTemplete = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "Product.html");
string groupDocslicensePath = Path.Combine(Path.GetFullPath(@"../../../GroupDocsPackageLicense"), "GroupDocs.Conversion.NET.lic");
// Reading the groupDocs license key
using (FileStream groupDocsfileStream = System.IO.File.Open(groupDocslicensePath, FileMode.Open, FileAccess.Read))
{
GroupDocs.Conversion.License groupDocslicense = new GroupDocs.Conversion.License();
groupDocslicense.SetLicense(groupDocsfileStream);
}
// Instantiate JSON data source
JsonDataSource productJsonDataSource = new JsonDataSource(productJsonFilePath);
// Generate Product PDF File
DocumentAssembler assembler = new DocumentAssembler(); //Here here UseReflectionOptimization is not set due to version issue
assembler.AssembleDocument(productTemplete,
productPdfpath,
new DataSourceInfo(productJsonDataSource, "ProductData"));
}
catch (Exception exception)
{
Console.WriteLine(exception.ToString());
}
}
}
}
Regards
Krishna
Thanks you. I look forward for your confirmation. Somehow dropbox link got truncated. Here is the link
There’s an issue in your code. You are applying Conversion API license but then processing Assembly API. For GroupDocs.Assembly API implementation, you will need a GroupDocs.Assembly license or GroupDocs.Total license (if you want to utilize both Conversion and Assembly APIs).
Hello Atir Tahir, I don’t think there is any issue related code, This is the exact same code with .net 5 version running properly here is the link for the same :
We are investigating this scenario. Your investigation ticket ID is ASSEMBLYNET-218. We’ll notify you in case of any update.
Please take a look at this thread.
After including NuGet packages, which GroupDocs.Assembly internally contains, to your project, the error does not occur, and the program works as expected:
<PackageReference Include="Aspose.BarCode" Version="20.4.0" />
<PackageReference Include="Aspose.Cells" Version="20.7.0" />
<PackageReference Include="Aspose.Email" Version="20.7.0" />
<PackageReference Include="Aspose.Slides.NET" Version="20.2.0" />
<PackageReference Include="Aspose.Words" Version="21.8.0" />
This can be used as a temporary solution.
Let us know if issue persists.
The thread referred to above is not public
The issues you have found earlier (filed as ASSEMBLYNET-218) have been fixed in this update. This message was posted using Bugs notification tool by ivan.lyagin