Access Denied Aspose.Excel - Annoying Message

Hi,

We just installed the latest version of Aspose.Excel (3.0.1.0) onto our production environment and also made changes to use the new license file using the following code.

License license = new License();
license.SetLicense(“Aspose.Excel.lic.xml”);

It blows up with Aspose.Excel access denied. Tried restarting IIS, also restarted the machine. We NO LONGER can upload files in our production environment.

Help, We are stuck …

FYI - I think its LAME that you have to modify the code to make use of the license file.

Thanks
Pramod

Hi Pramod,

Please install the latest hotfix v 3.0.1.1 at

It contains an important fix.

After your download the hotfix, please:

1. Find and remove all old Aspose.Excel.dll in your server
2. Rebuild your application with the new dll in your development machine. (Aspose.Excel.dll is a strong named assembly.)
3. Re-deploy the whole application to your server.

If you still find some errors, please post the whole error message here. Thank you.

Tried that and this is what I get now.

Cryptographic service provider (CSP) could not be found for this algorithm. at System.Security.Cryptography.RSACryptoServiceProvider.HasEnhancedProvider() at System.Security.Cryptography.RSACryptoServiceProvider…ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize) at Aspose.Excel.License.?(XmlNode ?, XmlNode ?) at Aspose.Excel.License.?(XmlDocument ?) at Aspose.Excel.License.SetLicense(Stream stream) at Aspose.Excel.License.SetLicense(String licenseName)

Also looked at - http://support.microsoft.com/default.aspx?scid=kb;en-us;322371 and that would require a significant code change in our production environment. This error only happens when I try to use Aspose.Excel.

Also read few articles in this forum - tried giving full permissions to everyone to the folder “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys” didnt work.

Other options?

This error is different from the one described in the above mentioned MS KBase article related to the MachineKeys folder and user profiles.

It probably has to do with a particular configuration on your computer, we are investigating possible solutions.

This thread suggests reinstalling .NET 1.1 that fixes this problem: http://p2p.wrox.com/topic.asp?TOPIC_ID=4665

Please try that, it does not look like there is anything we need to fix.

We did try reinstalling .NET Framework. No luck either.

Our server is Windows 2003 with .NET 1.1. It does work on my development server which is also Win 2003 server. It does not work on all other 4 servers - .

It was perfectly fine until we started using the new license call. Are there any other configuration changes we need to make?

This is extremely critical and we need to get this resolved ASAP or revert back to the orginial.

-thanks

In one scenario a customer was able to workaround the problem by making two calls to SetLicense. First call wrapped into try/catch handler and ignoring any exception and second call to SetLicense succeeds.

try
{
//This throws.
License.SetLicense(myFile);
}
catch (Exception)
{
//Ignore exceptions.
}
//This one succeeds.
License.SetLicense(myFile);

---------

By the way, if you have a license in the old format (pre 22 Jan 2005) you still can use it. You do not have to switch to licenses in new format although there are some benefits (if we can solve the exception however).

Our problem is not yet resolved. When we call the SetLicense method the following exception is received



Cryptographic service provider (CSP) could not be found for this algorithm.

Stack Trace : at System.Security.Cryptography.RSACryptoServiceProvider.HasEnhancedProvider()

at System.Security.Cryptography.RSACryptoServiceProvider…ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)

at Aspose.Excel.License.?(XmlNode ?, XmlNode ?)

at Aspose.Excel.License.?(XmlDocument ?)

at Aspose.Excel.License.SetLicense(Stream stream)

at Aspose.Excel.License.SetLicense(String licenseName)



When we try to catch the exception and pass it we get the evaluation msg in our saved file



Is it something to do with XML encoding? Pls respond the issue is critical







We tested but didn’t find any problem on win2003 and .NET1.1.
Is your application a web application or a winform applicatoin? If your application is a web app, could you please write a simple console app to test if the set license code works fine?

Its a web application. I already tried in a console app it worked and fyi the same web app works fine in our development environment.



Then we can be sure that’s a configuration problem. How do you install Aspose.Excel in this problem machine? Could you please deploy Aspose.Excle in GAC? And please assign rights same as your development environment.

Aspose was installed in the machine using your installer and Aspose.Excel.dll was copied to GAC. There is no problem with rights either :frowning:

Please check http://www.derkeiler.com/Newsgroups/microsoft.public.platformsdk.security/2004-09/0162.html for reference.

It must have something to do with user permissions. Please compare setting in your server with development environment to check the differences.


With issues like that I stronly recommend using Filemon or Regmon from Sysinternals.

It helped my quite often to track down issues like file permissions and stuff like that.

Try it, even if you think this is not a permission issue!

Was there ever a resolution to this? I’m using 3.4 and am getting the same error on one of my Win2K3 Servers. I don’t get the error on another Win2K3 server.

Please let me know.
Thanks,
jamie

By doing the following, I was able to get it to work:

Also read few articles in this forum - tried giving full permissions to everyone to the folder “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys” didnt work.


Do you mean after giving full permissions to everyone to the folder “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys”, this error is solved?

That’s correct. After setting the permissions to full on “C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys”, I was able to Set the License in the code without throwing an exception.