Word license problem after upgrading to latest version


#1

Hi,

I downloaded and installed latest version and hotfix for aspose.word

I uninstalled previous version via add/remove programs and then ran the msi installer.

Then I replaced the dll in all the .net project directories with the hotfix dll and xml.

Now I get following message:

* Error Message: Problem with License for Aspose.Word Component. Framework Message:The data at the root level is invalid. Line 1, position 1.

As you are generating this error message, you should be able to point out what is going wrong.

I found I also had to rewrite the code I used, because it gave warnings that the calls I was using were obsolete. Here the new version of my code:

===================================================================

public string CreateDocumentCS(string strJobID, string strCaseID,string strTemplateName, string strActivityID, CSCaseData theMergeData) //CSCaseData

{

currentTemplateName = strTemplateName; //pass value to class private var

userNameForSignature = theMergeData.CSCaseDataElement[0].OWNERLOGINNAME;

License license = new License();

try

{

license.SetLicense(ConfigurationSettings.AppSettings["Aspose.Word.LicenseFile"]);

}

catch (Exception e)

{

throw new JobDataException("Problem with License for Aspose.Word Component. Framework Message:" + e.Message);

}

Document mDoc;

string savedTemplateName;

try

{

log.Write("Open template",3,1);

mDoc = new Document(ConfigurationSettings.AppSettings["WordTemplatesDirectory"]+ @"\" + strTemplateName);

}

catch (Exception e)

{

log.Write("Problem with opening template: "+strTemplateName +" CaseID:" + strCaseID,3,1);

throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with opening template, template name:" + strTemplateName + " Framework message:" + e.Message);

}

//add event handler for inserting signature

mDoc.MailMerge.MergeImageField +=new MergeImageFieldEventHandler(MailMerge_MergeImageField);

//add event handler for bookmark mandatory checks

mDoc.MailMerge.MergeField +=new MergeFieldEventHandler(MailMerge_MergeField);

try

{

mDoc.MailMerge.Execute(theMergeData.CSCaseDataElement);

Console.WriteLine("LETTERER: Setting OWNER TO: " + userNameForSignature);

}

catch(Exception e)

{

log.Write("Problem with merging template: "+strTemplateName +" CaseID:" + strCaseID,3,1);

throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with template merge, template name:" + strTemplateName + " Framework message:" + e.Message);

}

try

{

savedTemplateName = strJobID + "_" + strCaseID + "_" + strActivityID + "_jca_cwfa.doc";

mDoc.Save(ConfigurationSettings.AppSettings["TemporaryDirectory"]+ @"\" + savedTemplateName);

}

catch(Exception e)

{

log.Write("Problem with saving merged template: "+strTemplateName +" CaseID:" + strCaseID,3,1);

throw new CAC.CWFA.CWFAExceptions.JobDataException("Problem with saving merged template merge, template name:" + strTemplateName + " Framework message:" + e.Message);

}

mDoc = null;

return savedTemplateName;

}

============================================================================

Please help,

Thanks,

Guus.


#2

Furhter to the above, (as the replacing dll’s in all .net project folders that make up the solution seemed a bit strange to me), I also removed the reference to Aspose.Word, and then recreated it. That should have the same effect, but I did it just in case. It didn’t change a thing.
Rgds,
Guus.


#3

On 22nd Jan 2005 Aspose switched to new licensing scheme and online purchase system. The new system features digitally signed licenses in plain text XML format.
In general, the new licenses impose less restrictions than before to make life much easier for the customers.

Static Word.SetLicense methods are marked obsolete and will give compiler warnings when used in new versions of the component. Although they are now obsolete, they will be supported for one year. These old SetLicense methods will only accept old encrypted licenses issued prior to 22nd Jan 2005.

The new License class with SetLicense methods was introduced to accept licenses in new format and also provide completely uniform licensing across all Aspose components. The new License class will only accept licenses in the new format, issued after 22nd Jan 2005.

If you purchased a license before 22nd Jan 2005, then the license will still be valid for one year because the obsolete methods are supported. You can either stick with the old license, but it will be better for you (because the new license is less restrictive) to upgrade your license to new format, this is available for free. Please contact sales@aspose.com and quote your order number and request an upgrade for the license. The newly issued license will come with a 1-year subscription entitling you to free upgrades and hotfixes. Of course you still can use the component after the subscription ends, but in order to receive more hotfixes and new version, you will need to renew the subscription unless you had an Unlimited license.

The error you have is caused by trying to feed a license in old format into the new License class.