We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

“Cannot find license ‘Aspose.Words.Lic’” using .NET

Hi,

I have bought Aspose.Words for .Net product and I have developed a DLL which uses it.
When I use my DLL with NET code, I put the .lic file in the binary folder and it works ok. But now, I’m trying to use my DLL with VB6 code, and wherever I put the .lic file, when I use my DLL I have this trouble: “Cannot find license ‘Aspose.Words.Lic’”.

Can you help me?

Thank you,
Mariola


Hi Mariola,

Thanks for your query. Please make sure that your license file path is correct before using your DLL with VB6. Please read following documentation link for your kind reference. If this does not helps you then please share your code for investigation purposes.
https://docs.aspose.com/words/net/licensing/

Thanks for your reply,

I have tried to embeed the license and I have ensured about the file extension, and it’s ok. However, the problem continues.

I write you both codes:
My DocxDLL (Aspose.Words.dll referenced)


public string ExtraerMarcadores(){

 Document doc = new Document(@“c:\test\in.docx”);
 DocumentBuilder builder = new DocumentBuilder(doc);

 Aspose.Words.License license = new Aspose.Words.License();
 license.SetLicense(“Aspose.Words.lic”);

 Bookmark bm = doc.Range.Bookmarks[“testBookmark”];
 bm.Text = “this is a replacement text”;

 builder.MoveToDocumentEnd();
 builder.InsertField(“REF testBookmark \h”);

 doc.UpdateFields();
 doc.Save(@“c:\test\out.docx”);
}

The VB6 Code (MyDll.dll referenced and Aspose.Words.lic in the binary folder)


Dim objNET
Set objNET = CreateObject(“DocxDLL”)

Dim marcadores
marcadores = objNET.ExtraerMarcadores() ///////Here It’s the exception

Hi Mariola,

Thanks for your inquiry.

Please change your code sequence like this:

Aspose.Words.License license = new Aspose.Words.License();
license.SetLicense("Aspose.Words.lic");

Document doc = new Document(@"c:\test\in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);

Bookmark bm = doc.Range.Bookmarks["testBookmark"];
bm.Text = "this is a replacement text";

builder.MoveToDocumentEnd();
builder.InsertField("REF testBookmark \\h");

doc.UpdateFields();
doc.Save(@"c:\test\out.docx");

Hope this will help you.

In case of any ambiguity, please let me know.

Hi,

Sorry, It has been a ‘copy-paste’ mistake. My code is written as you say, and it doesn’t work.

Thanks,
Mariola

Hi Mariola,

Please put license file at the location of VB6 code files and test your VB6 code. If this does not help you then please share, what is the location of license file and your DLL file?