VB.NET application using EXTRACOM requires dozens of Reflection files in its folder to run

  • 7022965
  • 16-May-2018
  • 21-Jun-2019

Environment

Reflection Desktop (including Pro, for IBM, or for UNIX and OpenVMS) 16.0 or higher
Reflection 2014
Reflection Pro 2014
Reflection for IBM 2014
Reflection for UNIX and OpenVMS 2014
Reflection for IBM 2011
Reflection for UNIX and OpenVMS 2011
Reflection Standard Suite 2011
Microsoft Windows 10
Microsoft Windows 7

Situation

When using EXTRACOM for an early-bound Visual Basic .NET (VB.NET) application, approximately 100 files from Reflection get copied to the build output directory in Visual Studio for distribution and use with the application.

The "CopyLocal" property for the reference to EXTRACOM in Visual Studio is automatically set to "True" which means that all dependent files required get copied from the Reflection Program Files directory to the project output location when the project is built.  If this CopyLocal property is set to false, and the VB.NET application is not in a directory with all these Reflection files, the reference does not work (e.g. the VB.NET project will not run).

Ideally, a project would not need to have 100 files copied from Reflection to its own directory in order to run.  Building the application appears to create a dependency for the application on a specific version of Reflection, thus any time a Reflection release or service pack is applied, this VB.NET application will also need to be rebuilt and redistributed.

Resolution

Fixed in Reflection Desktop 16.2 and above.  With the new reference to EXTRACOM, the Copy Local property in Visual Studio must be set to False and the application recompiled.

Workaround if using Reflection Desktop 16.1 or earlier:

1. Set “Copy Local = False” for the EXTRACOM reference in the VB.NET application.

2. Clear out the build folder of the VB.NET application.

3. From the C:\Program Files (x86)\Micro Focus\Reflection folder (assuming Visual Studio 2015 is installed on the PC)
    run the following commands at an elevated Command Prompt to add the following 5 assemblies to the Windows General
    Assembly Cache (GAC):

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" -I EXTRACOM.DLL
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" -I Attachmate.ComSubsystem.DLL
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" -I Attachmate.Services.API.Objects.Emulation.OpenSystems.dll
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" -I Attachmate.TerminalServices.dll
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\gacutil.exe" -I Attachmate.Services.API.Objects.Emulation.IBMHosts.dll

The “gacutil.exe” application from Visual Studio will add the assemblies to the Windows GAC and thus additional Reflection files will not need to be distributed with the VB.NET application.