Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Re: LeadTools fails to load in context of a browser hosted .NET object
Started by mikesoft at 03-16-2008 16:29. Topic has 10 replies.

Print Search « Previous Thread Next Thread »
  03-16-2008, 16:29
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
We're trying to create an Internet Explorer hosted .NET object that utilizes LeadTools to interact with JPEG 2000 images. We do all of our interaction with LeadTools using its in-memory methods and intentionally don't attempt to access the file system, since we have no access to it in this context. Unfortunately, LeadTools is requiring file system access just to load (see below error). Is there a known fix/workaround for this?

Thanks!

mike

System.IO.FileLoadException: Could not load file or assembly 'Leadtools, Version=15.0.0.0, Culture=neutral, PublicKeyToken=9cf889f53ea9b907' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)
File name: 'Leadtools, Version=15.0.0.0, Culture=neutral, PublicKeyToken=9cf889f53ea9b907' ---> System.Security.Policy.PolicyException: Required permissions cannot be acquired.
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)

   Report 
  03-17-2008, 5:55
Yasir Alani is not online. Last active: 6/9/2008 6:49:05 AM Yasir Alani



Top 25 Posts
Joined on 02-05-2007
Posts 141
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote

Mike,

 

There are multiple .NET assemblies and dependency DLLs in LEADTOOLS 15. Try to remove all LEADTOOLS code from your project and only keep Leadtools.DLL, and add this code:

Leadtools.RasterImage img =

  new Leadtools.RasterImage(

  Leadtools.RasterMemoryFlags.Conventional,

  800, 600, 24, Leadtools.RasterByteOrder.Bgr,

  Leadtools.RasterViewPerspective.TopLeft,

  null, IntPtr.Zero, 0);

int w = img.Width, h = img.Height;

 

This creates a blank LEAD image in memory that is 24 bits per pixel with size 800 x 600 pixels. This does not require any other LEADTOOLS assemblies.

If this code works, but other features fail, it could be because other assemblies are needed. For example, to load or save JPEG2000 images (from file or memory), you will need Leadtools.Codecs.dll and Leadtools.Codecs.J2k.dll.


   Report 
  03-19-2008, 22:18
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
Re: LeadTools fails to load in context of a browser hosted .NET object

Attachment: LeadTest.zip
Reply Quote
Yasir,

Thanks for responding. I tried what you requested, and I still encounter the error. It would appears that it's Leadtools.dll itself that is requesting file access permissions for some reason. I have attached the project files if you wanted to test it out yourself. Do you know if there is a workaround or fix for this issue?

Thanks,

mie
   Report 
  03-24-2008, 13:08
Yasir Alani is not online. Last active: 6/9/2008 6:49:05 AM Yasir Alani



Top 25 Posts
Joined on 02-05-2007
Posts 141
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
I'm not sure if I tested the same way you did. I built the user control and web projects and created a virtual directory for the ASP.NET project. I tried to access the ASPX web form from the same PC and from another PC, and in both cases it worked. How exactly are you configuring your setup to restrict local disk access?


   Report 
  03-24-2008, 22:40
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
Yasir,

Thanks again for the reply. I should have been more descriptive. Do you see a blank white page or do you get a little icon in the upper left corner? You should see a little bitmap-style icon, meaning the control failed to load. You need to enable IE Host Debugging (http://support.microsoft.com/kb/313892), exit IE, and try again. You'll also need to make sure that you have the control DLL (LeadTest.dll) and LeadTools.dll in the root of the Web site, in addition to the bin directory. Under this scenario, you should see the error that I mentioned in the IE Host log file.
   Report 
  03-25-2008, 8:02
Yasir Alani is not online. Last active: 6/9/2008 6:49:05 AM Yasir Alani



Top 25 Posts
Joined on 02-05-2007
Posts 141
Re: LeadTools fails to load in context of a browser hosted .NET object

Attachment: screenshot.jpg
Reply Quote

I did not get the error icon. It seems to have loaded successfully, as shown in the attached screenshot. I got the same result in 3 different ways:

1. Using IIS from the same PC

2. Using IIS from another PC on the network (shown image)

3. Using the Visual Studio ASP.NET development server on the same PC.

 

Since no LEADTOOLS files are loaded on the client PC, the problem could be related to permissions on the server side. You mentioned before that you cannot give disk access to the control. Is there a way to restrict such access on my server to simulate the same issue here?



   Report 
  03-27-2008, 22:27
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
Yasir,

The user control that I wrote does actually download to IE, along with its LeadTools.dll dependency and run on the client machine. I can see by your screenshots that you're running an earlier version of IE. I'm running on a system with IE7 installed, all released versions of the .NET Framework, and all the latest updates. Do you have the .NET Framework 2.0 installed on your client machine? You must if you're running the ASP.NET application on the same machine. I wouldn't have expected a security difference in the old versions of IE, nor do I have access to any of them. If you have access to IE7, you might try it to see if you don't encounter the error. I'd also try the IEHost log approach, just to ensure that IE isn't logging an error there, even though it appears to load the control properly.

Thanks very much for continuing to look into this,

mike
   Report 
  03-30-2008, 8:03
Yasir Alani is not online. Last active: 6/9/2008 6:49:05 AM Yasir Alani



Top 25 Posts
Joined on 02-05-2007
Posts 141
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote

I tested the project on IE7 and again I was not able to reproduce the error. The display I got was similar to the screenshot I sent you for IE6.

 

I then used a freshly installed Windows XP SP2 with .NET framework 2 (no LEAD products were installed). And again it worked correctly, and no debug log file was produced.

 

Was I testing correctly? How can I check if the control was downloaded to this fresh machine or not?


   Report 
  04-10-2008, 23:42
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
Yasir,

Again, thank you for your continued support on this issue. Might it be that you're running a more recent build of 15.x than I that has had the issue corrected? The file version on my LeadTools.dll is 15.0.0.2.

Thanks,

mike
   Report 
  04-13-2008, 11:00
Yasir Alani is not online. Last active: 6/9/2008 6:49:05 AM Yasir Alani



Top 25 Posts
Joined on 02-05-2007
Posts 141
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote

You are using old DLLs.

 

Please send your serial number to support@leadtools.com and mention this forum post so I can send you download instructions to the latest build.

 

Do NOT post your serial number here.
   Report 
  04-20-2008, 11:23
mikesoft is not online. Last active: 4/20/2008 4:20:59 PM mikesoft

Not Ranked
Joined on 03-16-2008
Posts 6
Re: LeadTools fails to load in context of a browser hosted .NET object
Reply Quote
Yasir,

Looks like we've identified the problem.

Thanks for all the help!

mike
   Report 
Post
LEAD Support Fo... » Developer » Internet » Re: LeadTools fails to load in context of a browser hosted .NET object

Powered by Community Server, by Telligent Systems