IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact

How to Create Kofax TotalAgility (KTA) SDK API in ASP.NET

Overview

Kofax TotalAgility (KTA) is a Smart Process Application (SPA) platform that transforms and simplifies business interactions. Many people thinks Kofax TotalAgility as merely a document capture software but it actually does more than just an OCR software. KTA is an enterprise solution for document management and business process automation platform with OCR is just part of the whole suite.

As in any enterprise-level application, KTA can be easily customized with the provided SDK. This tutorial will show you how to setup a Visual Studio project to create a KTA Web Service in ASP.NET.

Caveat

At this time, you cannot use ASP.NET Core to call KTA SDK. Hopefully this will be addressed in future version.

Requirements

  1. Visual Studio (2019 is used for this example)
  2. Kofax TotalAgility version 7.7 or later
  3. .NET Framework 4.8 (minimum version 4.7)

Steps to Create Visual Studio Project

  1. Launch Visual Studio and create a new Project.

    Visual Studio New Project

  2. On the Create a new project window, select the following settings: C#, Windows, Web. Click Next.

    Visual Studio Project Web Application .NET Framework selection

  3. On the Configure your project screen, type in your Project Name and the Location for your project. Under Framework select .NET Framwework 4.8. Click Create button.

    Visual Studio configure a project for KTA

  4. Select Web API on the Create a new ASP.NET Web Application and click Create button once again.

    Visual Studio Create a new ASP.NET Web Application

  5. Open File Explorer to the project’s bin folder and add the following KTA DLLs. You can copy them from
    C:\Program Files\Kofax\TotalAgility\Agility.Server.Web\bin folder in your KTA installation.

    1. Agility.Sdk.Model.dll
    2. Agility.Server.Common.dll
    3. Agility.Server.Core.dll
    4. Agility.Server.Core.Model.dll
    5. Agility.Server.Integration.Common.dll
    6. TotalAgility.Sdk.dll

    Depending on the need of your application, you may need to copy other DLLs, but I found that this is the minimum you need in order to make it work.

    Copy KTA DLLs to bin folder

  6. Next, we want to right-click on References on the right window and click Add Reference… to all the above DLLs. From time to time, you will encounter an error such as ReferenceManagerPackage package did not load correctly. Make sure you take care of that issue first by following these steps.

    Visual Studio Add Reference

  7. Select Browse on the left and click on Browse button.

    Visual Studio Add Reference Browse Window

  8. Select all the DLLs you just copied from KTA installation by pressing SHIFT-key while clicking on each of them. Click on Add button when done.

    Visual Studio Add Reference KTA DLLs

  9. Press OK button. Make sure all the DLLs are added under the References.

    Visual Studio Add Reference KTA DLLs OK button
    KTA DLLs Check in Visual Studio

Now you are ready to code KTA Web Service in ASP.NET. Happy coding!

Reference

Kofax Knowledgebase

March 22, 2021 Filed Under: How To Tagged With: ASP.NET, Kofax TotalAgility, Visual Studio

How to Resolve ReferenceManagerPackage Error in Visual Studio 2019

If you encounter this error (see below) when you try to Add Reference in Visual Studio:

Visual Studio ReferenceManagerPackage Error

The 'ReferenceManagerPackage' package did not load correctly.

The problem may have been caused by a configuration change or by the installation of another extension. You can get more information by examining the file 'C:\Users\[UserID]\AppData\Roaming\Microsoft\VisualStudio\16.0_#####\ActivityLog.xml'

Restarting Visual Studio could help resolve this issue.

Continue to show this error message?

You can take a look at the ActivityLog.xml file, but most of the time it’s not necessary. Just for the sake of this example, let’s open it up:

  <entry>
    <record>2479</record>
    <time>2021/03/12 01:21:02.715</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>CreateInstance failed for package [ReferenceManagerPackage]Source: &apos;mscorlib&apos; Description: Could not load type &apos;Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2&apos; from assembly &apos;Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;System.TypeLoadException: Could not load type &apos;Microsoft.VisualStudio.Shell.Interop.IVsReferenceManager2&apos; from assembly &apos;Microsoft.VisualStudio.Shell.Interop.11.0, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&apos;.&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)&#x000D;&#x000A;   at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)&#x000D;&#x000A;   at System.Activator.CreateInstanceFromInternal(String assemblyFile, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo)&#x000D;&#x000A;   at System.AppDomain.CreateInstanceFrom(String assemblyFile, String typeName)</description>
    <guid>{48D4A2C2-01AD-4F13-9123-610711CACB5B}</guid>
    <hr>80004005 - E_FAIL</hr>
    <errorinfo></errorinfo>
  </entry>
</activity>

Or you can view it with IE or XML viewer:

VisualStudio ActivityLog.xml viewed with Internet Explorer

For this particular case, Visual Studio cannot load Microsoft.VisualStudio.Shell.Interop.11.0.

There are several things you can try to solve this.

1. Delete ComponentModelCache Folder

  1. Exit all instances of Visual Studio.
  2. Open File Explorer and go to %LocalAppData%\Microsoft\VisualStudio\16.0_##### folder and delete ComponentModelCache sub-folder.

    Visual Studio LocalAppData ComponentModelCache folder

  3. Restart Visual Studio with Admin privileges.
  4. Try to open your project and Add References.

If it works at this point, congratulations, but in my case, I got a slightly different error:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Visual Studio Add References HRESULT E_FAIL error

2. Repair Visual Studio

This was suggested by many and it was the easiest to do, so it’s worth to try. Just launch your Visual Studio Intaller and select Repair from the More drop-down for the Visual Studio instance you want to fix.

Visual Studio Installer Repair

I did not have any luck with this either. So I had to do the second step by reinstalling Microsoft.VisualStudio.Shell.Interop.11.0.dll using Global Assembly Cache Tool.

3. Reinstall DLL with Gacutil.exe (Global Assembly Cache Tool)

  1. Open Developer Command Prompt for VS 2019 as administrator.

    Launch Developer Command Prompt for VS 2019 as administrator

    Make sure you see the word Administrator on the top of the command prompt window.

    Administrator Developer Command Prompt for VS 2019 window

  2. Go to the latest .NET Framework version folder you’re using (in this case it’s .NET Framework 4.8) to access the gacutil.exe file.

    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64>
    
  3. Check where your DLL is located (your active Visual Studio instance). In this case, it is C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PublicAssemblies folder.

  4. Type in the following:

    C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64>gacutil.exe /i "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\PublicAssemblies\
    Microsoft.VisualStudio.Shell.Interop.11.0.dll"
    
  5. If it’s successful, you should see a message confirming that the assembly successfully added to the cache.

    GacUtil adds DLL successfully

Check if any of the fix (or the combination of them), launch Visual Studio again, open your project and try to Add References again.

If successful, you should see Reference Manager window opened up.

Visual Studio Reference Manager window

References

“ReferenceManagerPackage” package did not load correctly VS 2019 community
How can I fix the Microsoft Visual Studio error: “package did not load correctly”?
Error HRESULT E_FAIL has been returned from a call to a COM component on Add Reference
Add a reference raise error: Error HRESULT E_FAIL has been returned from a call to a COM component
Gacutil.exe (Global Assembly Cache tool)

March 11, 2021 Filed Under: How To Tagged With: Microsoft, Visual Studio

How to Fix Obsolete ConfigurationSettings.GetConfig API

When you’re upgrading code from .NET Framework 1.1 to 2.0, you will get a few warnings if you use an obsolete API such as ConfigurationSettings.GetConfig, you may see something similar to this:

This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection

To which you have to replace it with ConfigurationManager.GetSection(). Or the same way with ConfigurationSettings.AppSettings.Get() to ConfigurationManager.AppSettings.Get(). The problem is after you made the change, you will encounter another error during compilation such as this:

'ConfigurationManager' is not a member of 'Configuration'.

The solution, while it’s not intuitive is actually very simple. You need to add a reference to System.Configuration.dll to the assembly.

  1. If you’re using a default view, on the right pane of your Visual Studio under your project you can right click on the References and select Add Reference….

    Add reference in Visual Studio's solution explorer

  2. Under Assemblies, look for System.Configuration and make sure it’s checked, then click OK.

    Add System.Configuration.dll reference in Visual Studio

That’s all there is to it.

Further Reading

ConfigurationSettings.GetConfig Method

April 27, 2015 Filed Under: .NET Tagged With: ASP.NET, Microsoft, Visual Studio

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure