TypeInitializationException using Zoom.Net.YazSharp.Connection object

I have done work with the YazSharp.dll, which allows you, through .NET, to connect to servers using the Z39.50 protocol. While debugging, I was seeing an exception when I initialized my Zoom Connection object:

Dim conn As New Zoom.Net.YazSharp.Connection(server, port)

 This error was throwing a TypeInitializationException:

 System.TypeInitializationException: The type initializer for ‘Zoom.Net.YazSharp.Connection’ threw an exception. —> System.DllNotFoundException: Unable to load DLL ‘yaz’: The specified module could not be found

 The solution to this is not only add references to the Zoom.Net.dll and Zoom.Net.YazSharp.dll files, but to add all the other relevant files from the Release folder into the bin directory of your project. In my case, I had forgotten to put the Zoom.Net.Factory.config file in the folder. Once I had put that file in along with all the *.dll files, it works. Jai himself mentions that in the comment of his blog post, but I thought I would reinforce that this will solve the issue.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: