This forum has been archived. Please start a new discussion on GitHub.

C# IceStorm Demo


I'm working on a project that requires an event channel. We were looking at TAO, but our attempts to get it up and running were unsuccessful.

Now I'm looking at IceStorm, and I'm having a problem getting the C# clock demo to work. Here's the error message when I run either the Publisher or Subscriber:
subscriber.exe: unknown exception: System.TypeInitializationException: The type
initializer for 'IceInternal.BasicStream' threw an exception. ---> System.BadIma
geFormatException: An attempt was made to load a program with an incorrect forma
t. (Exception from HRESULT: 0x8007000B)
   at IceInternal.BasicStream.BZ2_bzlibVersion()
   at IceInternal.BasicStream..cctor() in f:\src\vc80\stage\debug\IceCS-3.2.1\sr
c\Ice\BasicStream.cs:line 36
   --- End of inner exception stack trace ---
   at IceInternal.BasicStream.compressible()
   at IceInternal.DefaultsAndOverrides..ctor(Properties properties) in f:\src\vc
80\stage\debug\IceCS-3.2.1\src\Ice\DefaultsAndOverrides.cs:line 70
   at IceInternal.Instance..ctor(Communicator communicator, InitializationData i
nitData) in f:\src\vc80\stage\debug\IceCS-3.2.1\src\Ice\Instance.cs:line 388
   at Ice.CommunicatorI..ctor(InitializationData initData) in f:\src\vc80\stage\
debug\IceCS-3.2.1\src\Ice\CommunicatorI.cs:line 151
   at Ice.Util.initialize(String[]& args, InitializationData initData) in f:\src
\vc80\stage\debug\IceCS-3.2.1\src\Ice\Util.cs:line 78
   at Ice.Application.main(String[] args, InitializationData initData) in f:\src
\vc80\stage\debug\IceCS-3.2.1\src\Ice\Application.cs:line 115
Ice::Communicator::destroy() has not been called

It was built and is running on a Quad Xeon Windows 2K3 x64 machine. What's funny is the C++ version of this demo runs fine.

I'm running Ice 3.2.1 via the installer w/ VS8.

Any ideas?



  • matthew
    matthew NL, Canada
    For maximum speed the C# version of Ice uses a native code bzip2 DLL. When BasicStream is constructed it tries to find out whether the bzip compression library is available, otherwise protocol compression is disable. The System.BadImageFormatException tells me that the bzip library (libbz2.dll) was indeed found, however, it was the wrong format. Almost certainly the 32 bit library was found, when a 64 bit library is needed.

    What exactly did you install? Chances are what is occurring is that the C# version is finding the 32 bit install libbz2.dll, while it needs to find the dll from the 64 bit install. If you don't require protocol compression you can remove the 32 bit DLL from the C# demos PATH altogether.
  • I installed Ice 3.2.1 using the installer:


    I'm very new to middleware (sophomore undergrad student), so I'm just using C# to get the hang of Ice. Our application will be written in C++; therefore, I don't think protocol compression really matters in this case.

    How would I go about removing that dll from the C# demo?

    Another thing that I noticed in the output is that the program is referring to some partition mounted at F:. I have no F: on this system. I don't know if that has something to do with it or not.

  • matthew
    matthew NL, Canada
    The simplest method would be to move/remove libbz2.dll from the installation bin directory, or remove this directory from your PATH. Alternatively, you can install the 64 bit version of the Ice msi, and ensure that this is first in your PATH.
  • Thanks Matthew,

    Removing the dll resolved the issue. I didn't notice the x64 installer when I first installed Ice. I did, however, try installing it after reading your response.

    The 64-bit version had no democs directory. Additionally, the C++ demos failed with linker errors using that version. Something about target platform being x86 not x64, so I switched back to the 32-bit version of Ice and removed that dll.

    Ice is working very nicely right now. We've gotten so far in a week with Ice compared to months of messing around with TAO.

    Are there any other problems I may encounter due to the removal of the dll?

  • As long as you don't use protocol compression or IcePatch, you don't need this DLL. For more info on protocol compression, see the article "Protocol Compression: Friend or Foe" in issue 7 of our newsletter Connections.