Feedback
Did this article resolve your question/issue?

   

Article

How does the Progress client handle .NET assembly loading

« Go Back

Information

 
TitleHow does the Progress client handle .NET assembly loading
URL NameHow-does-the-Progress-client-handle-NET-assembly-loading
Article Number000183136
EnvironmentProduct: OpenEdge
Version: 10.2x, 11.x, 12.x
OS: Windows
Other: GUI for .NET
Question/Problem Description
How does the Progress client handle assembly loading?
How does Progress locate and load .NET assemblies?
Does the assemblies.xml file need to be present when executing compiled R-code?
Steps to Reproduce
Clarifying Information
Error MessageSystem.IO.FileLoadException: Could not load file or assembly.
'<assemblyName>, Version=<version>, Culture=neutral, PublicKeyToken=<value>' or one of its dependencies.
The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Invalid datatype specified: <type>. Specify a datatype such as 'character' or the name of a class. (5638)
** <program> Could not understand line <number>. (196)

System.IO.FileNotFoundException: Could not load file or assembly ', Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
Defect/Enhancement Number
Cause
Resolution
The Progress client will handle assembly loading differently depending on whether it is dealing with source code or compiled R-code:

1. The .NET framework relies on the assembly-qualified name of an assembly to resolve references.

The assembly-qualified name is the internal name of the assembly combined with the assembly version, culture, and public key and is used to create a unique value. Without having this full name, there is no way to run the code without explicitly loading the assemblies first; .NET will not be able to resolve the references.

Assemblies have both an Assembly Version and an Assembly File Version. The Assembly File Version is not part of the assembly-qualified name, and can change without affecting the assembly resolution (a technique commonly used for intermediate builds and drop-in replacement hotfixes)

2. Source code requires the presence of a valid assemblies.xml file that references the latest version of all assemblies required by the code.

3. Compiled R-code has the assembly-qualified name of the classes required by the code compiled into it.

Compiled R-code does not require an assemblies.xml file. For assemblies that are not installed in the GAC or in .NET's search locations (see below), .DLLs can be placed in any folder and the -assemblies startup parameter must be used to reference this folder. 

Multiple versions of the same assembly can be registered in the GAC at the same time; the .NET framework relies on the assembly-qualified name to locate and load the version the application expects.

When only a later version of the assembly has been installed on the machine then it is a requirement that the current copy of %DLC%\bin\<client>.exe.config (e.g. prowin32.exe.config) contains redirects to the later assembly versions. For example, code compiled in 11.5.0 referencing Infragistics 14.2.20142.2010 requires redirection to Infragistics 14.2.20142.2092 when executing in 11.5.1; the entry in <client>.exe.config is as follows:
 
<dependentAssembly>
      <assemblyIdentity name="Infragistics4.Win.UltraWinEditors.v14.2" 
                   publicKeyToken="7dd5c3163f2cd0cb" culture="neutral" />
      <publisherPolicy apply="no"/>
      <bindingRedirect oldVersion="14.2.20142.2010" 
                       newVersion="14.2.20142.2092"/>    
    </dependentAssembly>

The addition of redirects to <client>.exe.config is performed automatically for .NET controls shipped with OpenEdge (e.g. from Infragistics or Telerik) when a Service Pack is applied. 

If the name of the assembly changes then the code must be re-compiled. Assembly redirection works only when the assembly name stays the same and only the version number changes. For example the following looks like a version change but is qualified as an assembly name change:
Infragistics4.Win.UltraWinEditors.v13.1 
Infragistics4.Win.UltraWinEditors.v14.2

4.  Locating Assemblies

To locate assemblies, the .NET CLR loaded by the Progress client searches the following locations in order:
  • Global Assembly Cache (GAC)
  • %DLC%\bin
  • %DLC%\bin\Infragistics\winforms (**)
  • %DLC%\bin\dotnetmsgs (**)
  • -assemblies location handled by the Progress AVM itself
    • assemblies.config location
For more information about assemblies.config, see article Accessing assemblies from another project. and .NET assemblies in the documentation.

(**) The last 2 entries referencing %DLC% are configured in the probing privatePath setting of the <client>.exe.config file:
 
<probing privatePath="Infragistics\winforms;dotnetmsgs" />

The following results were generated using code compiled in 11.5.0 and tested against 11.5.1. Service Pack 1 for 11.5 upgrades the Infragistics versions shipped from 14.2.20142.2010 to 14.2.20142.2092. 
 
Code TypeAssemblies.xml
present?
Assemblies.xml
14.2.20142.2010
Assemblies.xml 
14.2.20142.2092
%DLC%\bin\<client>.exe.config
contains redirects to:
14.2.20142.2092
Result
R-code compiled with 11.5.0 and Infragistics 14.2.20142.2010NoN/AN/AYesSuccess
R-code compiled with 11.5.0 and Infragistics 14.2.20142.2010NoN/AN/ANoFails with System.IO.FileLoadException: Could not load file or assembly.
R-code compiled with 11.5.0 and Infragistics 14.2.20142.2010YesYesNoNoFails with System.IO.FileLoadException: Could not load file or assembly.
R-code compiled with 11.5.0 and Infragistics 14.2.20142.2010YesNoYesNoFails with System.IO.FileLoadException: Could not load file or assembly.
Source codeNoN/AN/AYesFails with error 5638.
Source codeYesYesNoYesSuccess
Source codeYesYesNoNoFails with error 5638.
Source codeYesNoYesYesSuccess
Source codeYesNoYesNoSuccess
Workaround
Notes
Last Modified Date1/4/2021 8:28 AM
Attachment 
Files
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.