Set License before Creating Document or any Aspose.Words Class Object | Get Temporary License to Avoid Evaluation Message | C# .NET

We are currently licensed with Aspose.Words for .NET version 13.2.0.0. We requested a temporary license to test some issues we had with mail merging: issues with unwanted font changes, white space and page breaks.

When we conduct our tests with the version 20.6.0.0 using the temporary license we can not verify the results accurately because the mail merged documents contain the following injected text in red font:

Created with an evaluation copy of Aspose.words. To discover the full versions of our APIs please visit: Professional On-Premise and Cloud-based solutions for working with Word document formats

This injected text is causing the actual text in the mail merged document to move, therefore, we are unable to confirm the layout of the mail merged document that we are expecting to be fixed with the latest version of Aspose.Words.

Is there anyway that we can get a temporary license so we can properly do our testing without the injected red text? Or am I doing something wrong?

Thank You!

@dwasabi,

If you want to test latest (20.7) version of Aspose.Words for .NET without the evaluation version limitations, then you can request a 30-day Temporary License. Please refer to How to get a Temporary License?. If you have already acquired a temporary license (.lic file) then please make sure that your are successfully making a call to License.SetLicense Method before instantiating a Document object. Also, please refer to the following article:

In case the problem still remains, then please post your temporary license file ‘via private message’. In order to send a private message with attachment, please click on my name and find “Message” button.

How to get a Temporary License

We will then investigate the issue with your temporary license file on our end and provide you more information.

@dwasabi,

It is to inform you that we had received your license file via private message and it worked fine on our end when using the latest (20.7) version of Aspose.Words for .NET. We had prepared a simple console application (ConsoleApp1.zip (4.3 KB)) to test this license on our end. Before running the application, please copy your license file in “~\ConsoleApp1\bin\Debug” folder.

@awais.hafeez,

I did receive the simple console app you sent. After a small change it ran fine without any error:

//license.SetLicense("Aspose.Words - Copy.lic");
license.SetLicense("Aspose.Words.lic"); 

In my test console application I’m generating 4 documents. 3 of the 4 documents have the red evaluation text. Here’s an overview what my test console application does:

  • executes a mail merge to a template and outputs the document - Document1
  • removes the cover from Document1 and outputs that document as Document2
  • create a cover letter using mail merge as Document3
  • appends Document3 to Document2 and outputs as Document4

I will private message you my console application. Please take a look and let me know what I’m doing wrong.

Thanks

@dwasabi,

Please remove all licensing related code from ‘AsposeCoverLetter.cs’ file. After that please use the following code in Program.cs:

using Aspose.Words;

namespace ConsoleAspose
{
    class Program
    {
        static void Main(string[] args)
        {
            License asposeWordsLicense = new License();
            asposeWordsLicense.SetLicense(@"C:\Path\Aspose.Words.lic");

            AsposeCoverLetter myAspose = new AsposeCoverLetter();
            myAspose.DoWork();
        }
    }
}

@awais.hafeez

This seems to have fixed the problem.

Can you provide an explanation as to why moving the call to SetLicense() fixes this?

Thanks!

@dwasabi,

This is to make sure that the License.SetLicense Method is called before instantiating any Document instance or using any other Aspose.Words classes.

P.S: The license only needs to be set once per application domain. So, it is better to apply it at the beginning of Main method.