Exception: NullReferenceException on calling SetLicense method in .NET Core

Hello,

i try to use Aspose.Email (and Aspose.Cells in another) .net Core Project. The License is an embedded resource (but i also tried to let it copy to the build-folder) and when i want to set the license i get this error:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at ?.(Type )
at ?.(Object[] )
at ?.(Object[] , Type[] , Type[] , Object[])
at Aspose.Email.License.SetLicense(String licenseName)
at RamomDeMailGrabber.Program.LicensingAspose()
at RamomDeMailGrabber.Program.RegisterEverythingNeeded()
at RamomDeMailGrabber.Program.Main(String[] args)

I’m using Aspose.Email 19.10.0.

Best Regards,
Jörg

@ramomJr,

Can you please share source file along with sample code so that we may further investigate to help you out.

ForAsposeForum.zip (1.8 KB)

Hello Adnan,

here is the source file.

As additional information: The exeption only occurs when i try to execute the deployed exe.

@ramomJr,

Can you please check and make sure your license is valid. Also please share which version of Aspose.Email you are using on your end.

Hello Adnan,

i use the license every day in different projects, so i’m total sure that it is valid.

I’m using Aspose.Email Version 19.10.0

@ramomJr,

Can you please share complete project reproducing issue so that we may further investigate to help you out.

-deleted-

Here is the Link to the project.

@ramomJr,

I regret to share that we tried to download the project and it got disconnected in middle of download. Now, the link is expired and we are unable to download the link. Can you please share the file again.

Here it is: -deleted-

@ramomJr,

Thank you for sharing the information with us. I had .NET Core 2.1 availble on my end and have tested your solution using that. I have not observed any exception while loading the license. However, I obtained the exception when accessing the exchange owing to credentials. Can you please try the same on your end.

Hello,

i think there is a problem when i try to execute the file without installed .net Core Framework and the deployment was self-contained and trimmed.

When i install the .net core framework on the machine where i want to run the file, it works without exception.

@ramomJr,

Its good to know that your issue has been resolved.