1
Use Document Ultimate in SharePoint On Premise
Problem reported by Stephan KW - 3/15/2018 at 8:23 AM
Resolved
I just tried to integrate DocumentUltimate in SharePoint 2013 and use the document converter from a custom webservice hosted in SharePoint.
During the call I receive the following error message:
+ InnerException {"Could not load file or assembly 'GleamTech.AssemblyResolver, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a05198837413a6d8' or one of its dependencies. The system cannot find the file specified.":"GleamTech.AssemblyResolver, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a05198837413a6d8"} System.Exception {System.IO.FileNotFoundException}
 
Seems like the assembly doesn't get/have enough rights to load the included dlls in the core and documentultimate dlls. Is it possible to extract them and include them in the deployment step which puts them into GAC?

2 Replies

Reply to Thread
0
Cem Alacayir Replied
Employee Post
Yes, this is because when the assembly is installed to GAC, the AssemblyResolve event is not fired by .NET Framework.
 
I am not familiar with Sharepoint on Premise but do you really need to install the assemblies to GAC?
If just leave them in bin folder as they are already strongly named, they should be loaded by Sharepoint.
0
Cem Alacayir Replied
Employee Post
Hi Stephan,
FYI, this is now possible with Version 4.5.6 - January 29, 2019:

  • Improved: Support for adding GleamTech assemblies to GAC (Global Assembly Cache), for example using with SharePoint On Premise will be possible. In previous versions, the integrated AssemblyResolver failed with "Could not load file or assembly 'GleamTech.AssemblyResolver, Version=2.0.0.0, Culture=neutral, PublicKeyToken=a05198837413a6d8'" error. This is because AppDomain.AssemblyResolve event is not fired by .NET Framework (fusion) when the requesting assembly is installed to GAC. Now with a workaround, the integrated AssemblyResolver will be successfully loaded and it will resolve other assemblies.

Notes for ASP.NET WebForms
If you get these errors after you add the assemblies to GAC:

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'GleamTech.Core' or one of its dependencies. The system cannot find the file specified.
or

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'GleamTech.DocumentUltimate' or one of its dependencies. The system cannot find the file specified.
It’s because of assembly being referenced in markup with partial name (not full name with version and public key), for example:

<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.Examples" Assembly="GleamTech.Core" %>
or

<%@ Register TagPrefix="GleamTech" Namespace="GleamTech.DocumentUltimate.AspNet.WebForms" Assembly="GleamTech.DocumentUltimate" %>
You just need to specify full name of the assemblies once in your Web.config so that they can be found even with partial name later in markup (instead of updating every Assembly attribute in the markup):

<configuration>
  <system.web>
    <compilation targetFramework="4.0" >
      <assemblies>
        <add assembly="GleamTech.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=a05198837413a6d8" />
        <add assembly="GleamTech.DocumentUltimate, Version=4.5.5.0, Culture=neutral, PublicKeyToken=a05198837413a6d8" />
      </assemblies>
    </compilation>
</configuration>


Reply to Thread