1

I am installing a C# windows service that uses Geode onto a UAT Windows 2012 server. The referenced dll (like log4net, newtonsoft.json and QuickFix) are working except for Pivotal.Gemfire.dll

When I start the service I get System.IO.FileNotFoundException: Could not load file or assembly 'Pivotal.Gemfire.dll' or one of its dependencies. The specified module could not be found. File name: 'Pivotal.Gemfire.dll'

Now Gacutil doesn't come with Win Server 2012. I've tried installing Windows SDK and .Net SDK and not found a Gacutil executable. So I've tried to get in the dll into the GAC using powershell like this:

[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("D:\Pivotal.Gemfire.dll")

I've tried regsvr32 Pivotal.Gemfire.dll in various flavours

I've tried compiling and running the GacInstall executable at https://github.com/apache/geode-native/tree/develop/executables/GacInstall. It says Installation completed successfully. but when I try to run the service, or try powershell:

([system.reflection.assembly]::loadfile("D:\Pivotal.Gemfire.dll")).FullName

I get the same error.

I've tried a private assembly using runtime assembly binding

<runtime>
<assemblyBinding
   xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Apache.Geode" publicKeyToken="null" culture="neutral" />
    <codeBase version="9.1.1-build.2" href="file://Pivotal.Gemfire.dll"/>
  </dependentAssembly>
</assemblyBinding>
</runtime>

and various flavours of name Pivotal.Gemfire, Apache.Geode.Client according to Implementing Shared Assembly but always the same error.

Any ideas? Thanks...

UPDATE: Make sure you have x86 and x64 bit C++ packages back to 2013 (for older versions of Geode Net client)

enter image description here

rupweb
  • 3,052
  • 1
  • 30
  • 57

5 Answers5

1

I downloaded the previous version of Geode, 9.0.7, called Gemstone.Gemfire.Cache.dll and got the same error, but that version included a Gemstone.Gemfire.Cache.xml in the same directory. If I took the xml file to my bin directory the error stopped and the service started properly.

So like this the problem is a redundant accompanying xml file to the dll. I fixed the issue by creating a new dummy xml file Pivotal.Gemfire.xml

<?xml version="1.0"?>
<doc>
</doc>
rupweb
  • 3,052
  • 1
  • 30
  • 57
1

For me the marked answer did not work.

I had to download DependencyWalker which showed me why the Pivotal.Gemfire.dll was not working. One of missing DLLs was from:

Visual C++ Redistributable Packages for Visual Studio 2013

After installing 64x bit, application started to work.

Edgaras
  • 449
  • 3
  • 14
  • 1
    This happened again and the 64 bit 2013 package is required even alongside the 2015-2022 package – rupweb Dec 22 '21 at 16:38
0

This problem happened again with another install. The answer above using the xml file did not resolve it, it was resolved by downloading version 9.0.7 of the Native Client, Gemstone.Gemfire.Cache.dll and then running

.\gacutil /if C:\Gemstone.Gemfire.Cache.dll

which returned Assembly successfully added to the cache then removing the earlier version of the dll, but retaining the later version Pivotal.Gemfire.dll that I could not get into the GAC because of a strong name issue. This bizarre workaround of getting the earlier version of the dll into the GAC allows the GAC to find - and use - the later version...

rupweb
  • 3,052
  • 1
  • 30
  • 57
0

This happened to me again with a Geode Native built locally, when it is run on a new Windows 10 install the dependency walker shows missing MSVCP140D.DLL VCRUNTIME140D.DLL and UCRTBASED.DLL as here

enter image description here

The D is related to having built the client in debug mode. The problem is related to How can I install a Visual Studio C++ redistributable if it is missing? and the answer is either to get a release build of your dll, or to go to Visual Studio Installer, Modify, navigate to Individual components -> compilers, build tools, and runtimes, and check the MSVC v 140 VS 2015 C++ build tools

enter image description here

rupweb
  • 3,052
  • 1
  • 30
  • 57
0

Yet another time this happened to me and I had to remove references and files to Apache Geode dll built as native client, then reference them all again.

rupweb
  • 3,052
  • 1
  • 30
  • 57