Hi,

I have created a Abbyy flexy capture 11 project, defined a document with fields and some autocorection .NET script. If I perform the recognition from the Abbyy project all goes fine, but if I perform the recognition from an external application I get the following document rule error:

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
   at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
   at System.Security.CodeAccessPermission.Demand()
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence securityEvidence)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)
   at System.Activator.CreateInstanceFrom(String assemblyFile, String typeName, Object[] activationAttributes)
   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)
   at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
   at System.AppDomain.CreateInstanceFromAndUnwrap(String assemblyName, String typeName)
   at DotNetScriptingSupport.CManagedObjectStorage.CreateDomain(String domainName)
   at DotNetScriptingSupport.CDomain.{ctor}(CDomain* , CUnicodeString* name, Int32 )
   at DotNetScriptingSupport.CDotNetSupport.CreateDomain(CDotNetSupport* , CPtr<DotNetScriptingSupport::IDomain>* , CUnicodeString* name)
The action that failed was:
Demand
The type of the first permission that failed was:
System.Security.Permissions.FileIOPermission
The first permission that failed was:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\program files (x86)\abbyy sdk\11\flexicapture engine\bin\dotnetscriptingsupport.dll"
PathDiscovery="C:\program files (x86)\abbyy sdk\11\flexicapture engine\bin\dotnetscriptingsupport.dll"/>

The demand was for:
<IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="C:\program files (x86)\abbyy sdk\11\flexicapture engine\bin\dotnetscriptingsupport.dll"
PathDiscovery="C:\program files (x86)\abbyy sdk\11\flexicapture engine\bin\dotnetscriptingsupport.dll"/>

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission class="System.Security.Permissions.FileDialogPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Access="Open"/>
<IPermission class="System.Security.Permissions.IsolatedStorageFilePermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Allowed="ApplicationIsolationByUser"
UserQuota="512000"/>
<IPermission class="System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Execution"/>
<IPermission class="System.Security.Permissions.UIPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Window="SafeTopLevelWindows"
Clipboard="OwnClipboard"/>
<IPermission class="System.Security.Permissions.SiteIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Site="tempuri.org"/>
<IPermission class="System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
PublicKeyBlob="0000000000000000"
Name="SIFVoteApplicationParser.application"
AssemblyVersion="1.0.0.1"/>
<IPermission class="System.Security.Permissions.UrlIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Url="http://tempuri.org/SIFVoteApplicationParser.application"/>
<IPermission class="System.Security.Permissions.ZoneIdentityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="Internet"/>
<IPermission class="System.Drawing.Printing.PrintingPermission, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="SafePrinting"/>
<IPermission class="System.Security.Permissions.MediaPermission, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
version="1"
Audio="SafeAudio"
Video="SafeVideo"
Image="SafeImage"/>
<IPermission class="System.Security.Permissions.WebBrowserPermission, WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
version="1"
Level="Safe"/>
<IPermission class="System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1">
<ConnectAccess>
<URI uri="(http|https)://tempuri\.org/.*"/>
</ConnectAccess>
</IPermission>
</PermissionSet>

The assembly or AppDomain that failed was:
mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

The engine, batch is created using the following code

EngineLoader = new FCEngine.InprocLoader(); Engine = EngineLoader.Load(AppUtils.AbbyySerial(), "");

        // Open sample project
        Project = Engine.OpenProject(AppUtils.GetProjectPath());

        if (Project.Batches.Count == 0)
        {
            Project.Batches.AddNew("Main batch");
        }

        Batch = Project.Batches[0];

the recognition process is done like this

 IIntsCollection ids = Engine.CreateIntsCollection();
            foreach (IDocument doc in this.Batch.Documents)
            {
                ids.Add(doc.ID);
            }

            Batch.Recognize(ids, RecognitionModeEnum.RM_ReRecognizeAll, null);

The external application is a .NET win forms application with NET 3.5 as target framework

Does anyone experienced something similar? Regards

asked 19 Jan '16, 17:40

Octavian's gravatar image

Octavian
113

Hi, In order we can investigate this situation please send to the SDK_Support@abbyy.com the following additional information: 1) Please send us a simple sample of the full project with templates using which we could reproduce this issue. 2) Also please send us FREngine log file which can be obtained with the help of IEngine::StartLogging method. 3) The AInfo report:Go to FlexiCapture Engine installation folder, \Bin\Support.Run the AInfo.exe and wait until the utility gathers all the necessary information.Send the generated archive to us. Thank you in advance!

(20 Jan '16, 18:13) Beliakova Sv... ♦♦
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4

Asked: 19 Jan '16, 17:40

Seen: 662 times

Last updated: 20 Jan '16, 18:13

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal