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

Free Support Forum - aspose.com

Cannot find aspose words license file when deploying with ClickOnce

I am trying to deploy my application with ClickOnce but am getting an error after it installs on the user workstation. The error is “Unable to find file - Aspose.Words.Lic”. I have included this file in my required files so I am not sure what the problem is. (see attached file)
I am able to deploy my application fine using a MSI package.

Thanks for your request. I see that Aspose.Words.lic file is placed in Resources folder. You can try moving license file into Bin folder of your application (where Aspose.Words.dll is placed). Then you can use the following code to apply license.

Aspose.Words.License license = new Aspose.Words.License();

Please let me know if this helps.
Best regards.

Thank you for your inquiry.
To load properly license file should be accessible on the file system. In most cases we recommend deploying it to one disk folder with Aspose.Words.dll or in folder treated as current for the application. In particular, deploying a web service you can put it to the so named root application directory. Of course logon Windows account of the process must have enough permission to read the file from the underlying Windows folder.
Web service maps its application root to some disk folder. Mapping could be performed programmatically:

string realPath = Server.MapPath(Aspose.Words.dll'');

This path should be passed to LoadLicense. You can ensure that the file is present there first:

If (System.IO.File.Exists(realPath))
    // do something

Please check this and if you still experience difficulties post here in any schematic form the directory tree of your site and show where you are putting the DLL and the license file.

I see that your solution does not need to deploy the license file to the workstation, but rather uses the license file that is on the web server.
I am attempting to deploy the license file to the workstation with Visual Studio 2005 ClickOnce and after deployment, the exe cannot find the license file and fails on:

// Initialize Aspose license
Aspose.Words.License ThisLicense = new Aspose.Words.License();

I have attached a picture of my ClickOnce application files. I am able to deploy this application as an MSI package without any problems. Thank you

Please try putting the license file in one directrory with the DLL, not in bin/Debug.
If this doesn’t help you can determine what Windows folder is the current for your application with this property:
Then you will see what’s wrong with location of the license file.

I used a message box to get the Current Directory. Apparantly, ClickOnce deploys the license file into its own directory structure which is not in alignment with your requirements. See attached

Please note that license files are looked up on the file system by the same way if they were files of any kind. So it’s an environmental issue weakly related to Aspose.Words. Unfortunately, I don’t know how ClickOnce deploys files and what directory should be made current by default.
We don’t apply any particular requirements to directory structure. License file can be deployed to any accessible path. “Accessible” means that you know how to calculate it in the license setup code and the current process has enough permission to read the file.
At last you can embed the license file as a resource to any of your own assemblies. Please read this article for details:
Best regards,

ClickOnce is now working!
I followed your advice and moved the Aspose.Words.License file to the root directory and then added it to the BIN directory as a reference.
What was confusing to me was that the exe compiles and runs fine and the msi package runs fine, but ClickOnce failed. So I had to fool ClickOnce by moving the file to the root directory.
Thanks again for great support!