coding angular
coding angular

Reputation: 11

aspose license path for azure function deployment

I am deploying my asp.net application which has aspose.words in azure cloud. The application starts with azure function. I am facing issue in placing the aspose license. I have kept the aspose license in bin folder which contains aspose.words.dll. But I get invoked member does not exist error:

Aspose.Words.License license=new Aspose.Words.License();
license.SetLicense("Aspose.Words.lic"); //Error invoked member does not exist

Can someone please help on this?

Upvotes: 1

Views: 1011

Answers (2)

foxfuzz
foxfuzz

Reputation: 105

Further to answer mentioned by @Alexey, this is how I worked it out to embed Aspose libraries as a resource in a .NET Core Web application.

  1. Added a folder named Resources under the Solution > Project > Properties folder. screenshot of Resources folder

  2. Edited the .proj file to add below code:

<!-- Aspose Licence embedded resource include -->
<ItemGroup>
    <EmbeddedResource Include="Properties\Resources\Aspose.Total.NET.lic" />
</ItemGroup>

  1. Added registering of the licence in the Program.cs file (that uses top-level statements)

var AsposeLicenceFileName = "Aspose.Total.NET.lic";
var asposeWordsLicence = new Aspose.Words.License();
asposeWordsLicence.SetLicense(AsposeLicenceFileName);

worked out well for the past many months. good luck.

Upvotes: 0

Alexey Noskov
Alexey Noskov

Reputation: 1960

I think in your case the best way is to include the license file as an embedded resource in your project. Please follow the link to learn how to do this. Hope this helps.

Disclosure: I work at Aspose.Words team.

Upvotes: 1

Related Questions