Reputation: 11
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
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.
Added a folder named Resources
under the Solution
> Project
> Properties
folder.
Edited the .proj
file to add below code:
<!-- Aspose Licence embedded resource include -->
<ItemGroup>
<EmbeddedResource Include="Properties\Resources\Aspose.Total.NET.lic" />
</ItemGroup>
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
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