While Publish (extended support), getting "Access to the path '<Path>/Aspose.Pdf.lic' is denied."

Hi, I’m getting following error while doing “publish (extended support)” from Visual Studio. I Tried giving the full rights on “Temp” folder, to “NETWORK SERVICE” and “IUSR”, but getting the same error again and again.

Error : - Access to the path ‘C:\Users<UserName>\AppData\Local\Temp\g3ec203s.nim\roles<AzureRoleName>\sitesroot\0\bin\Aspose.Pdf.lic’ is denied.

Any Idea ?

@devender.arya

We have not come across such error before. Please try using the license file as an embedded resource to see if issue is resolved.

@asad.ali
Tried with your suggestion, but getting same result. Error points to File “Microsoft.Windows.Azure.targets”

@devender.arya

Looks like there is an issue in your application configuration. It seems like it does not have sufficient permissions. Have you tried to write a sample .txt file into the same directory where license file is located. See if that works and your application is able to access it. OR maybe you can do something like below to set the license for the API:

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

string licString = "<your license file content here>";

// Convert string to byte array
byte[] byteArray = Encoding.UTF8.GetBytes(licString);

// Create MemoryStream from byte array
MemoryStream stream = new MemoryStream(byteArray);

// Set the license
license.SetLicense(stream);