Ready to Run is a feature in .NET Core 3.0 and later where assemblies are precompiled for faster loading (see https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run). However, when we compile with Ready to Run, the SetLicense method for both Aspose.Words and Aspose.Slides fails:
Cannot load type '♣ , Aspose.Words, Version=220.127.116.11, Culture=neutral, PublicKeyToken=716fcc553a201e56'. at ☻ .♣ (Int32 ☻, ♣ ♥, Boolean& ♣, Boolean) at ☻ . (Int32 ☻, Boolean ♥) at ☻ .♣ (Int32 ☻, ♣ ♥) at ☻ .☻ (Int32 ☻) at ☻ . (☻ ☻, ♥) at ☻ .☻ () at ☻ . (Boolean ☻) at ☻ (Object ☻) at ☻ ? (Object ☻) at ☻ . () at ☻ .☻ (Object ☻, UInt32 ♥) at ☻ . (Boolean ☻) at ☻ . (Object ☻, Type ♥, Type ♣, Object) at Aspose.Words.License..ctor_2() at Aspose.Words.License..ctor()
We do get the same issue on Aspose.Cells – but the Aspose.Cells team has confirmed that a fix is released this week or the next. See related ticket (not created by me): .NET 6 Support with Linux or non-Windows systems?
Here’s the publish command we run (on Windows):
dotnet publish -r win-x64 -p:PublishReadyToRun=true -c Debug --no-self-contained .\Foobar.csproj
If we exclude these assemlies from ready to run in the project file:
<PublishReadyToRunExclude Include="Aspose.Cells.dll" /> <PublishReadyToRunExclude Include="Aspose.Words.dll" /> <PublishReadyToRunExclude Include="Aspose.Slides.dll" />
then it works great.
We use the latest version of the assemblies, on .NET6.
This is essential for us, especially with Aspose, to decrease the initial execution time of various functions. Up until now we have used .NET Framework, but are porting the code that uses Aspose to .NET 6. This is currently a blocker for us to continue the .NET 6 work.
Is this a known issue for Aspose.Words and Aspose.Slides? Is there an ETA for a fix if that is the case?
Thank you in advance.