Thanks for your request. These files are keys to use for encryption and decryption of forms authentication cookie data and view state data, and for verification of out-of-process session state identification. I think that Aspose.Words doesn’t generate these files but your application generates these keys.
Every time Aspose.word is invoked, two sets of new keys are generated in the “machinekey” folder.
Shoudn’t Aspose be using just one pair of keys as other .net programs use? Why is it necessary to generate two pair of new keys everytime?
It is causing this folder and inturn the disk drive to fill-up over time.
Please refer to the following link that mentions the key pair being generated by .Net in the “machineKey” folder when aspose tries to verify the license file. Can this mechanism of Apspose be looked into, so the Aspose uses its own public/private keys to circumvent the crypto providers key generation?
Aspose.Word tries to verify a digital signature on a license file and instantiates a .NET crypto provider. There is a behaviour (maybe a bug) in .NET in that the crypto provider always generates a key pair in its constructor. This is very inefficient behavior from .NET because Aspose.Word does not need a new key since it has a public key that it will use to verify the license, but nothing can be done to avoid the crypto provider generating a key every time.
The key pair created by the crypto provider is normally stored in a user profile, but an ASP.NET application usually runs under the ASPNET user account and this account does not have a user profile loaded. Therefore Aspose.Word instructs the crypto provider to store the key in the machine-wide key storage (recommended by Microsoft in this situation for any ASP.NET application).
For the .NET crypto provider to be able to store the key in the machine-wide, the above mentioned folder MachineKeys folder must exist and the ASPNET account must have permissions to write to it.
Please note this requirement is not specified to Aspose.Word, it is general for any ASP.NET application trying to use encryption algorithms provided by .NET that employ public/private key pairs.
Thanks for additional information. I think that you should call SetLicense from the Global.asax.cs (Global.asax.vb) file, in the Application_Start protected method. I hope this will solve your problem. See the following link for more information.