Coder Social home page Coder Social logo

Comments (14)

tuldok89 avatar tuldok89 commented on June 5, 2024

Even a minimal test case like the one below is throwing the same error.

using System;
using ZeroMQ;

namespace TestCase
{
    class Program
    {
        static void Main(string[] args)
        {
            using (var context = new ZContext())
            {

            }
        }
    }
}

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

Please set the files in i386 and amd64 to "copy if newer" (.dll for Windows and .so for Linux).

from clrzmq4.

tuldok89 avatar tuldok89 commented on June 5, 2024

Thanks, it solved the issue.

I didn't expect that :) I guess I'm used to some NuGet packages that automatically copies the native DLLs to the build folder.

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

Yeah, sadly isn't that for native dlls... I'll have to make them embedded resources, however that will give some weight to the binary...

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

The examples are cool right? I like Espresso...:

01410000000000000000
01420000000000000000
B 29804bd50000000000
B 69abb4530000000000
A e13169fe0000000000
B 48fe8c100000000000
B 8d64be370000000000
I: subscriber counted 5
00410000000000000000
00420000000000000000

from clrzmq4.

tuldok89 avatar tuldok89 commented on June 5, 2024

Yeah, the examples are nice 👍 I've just started learning ZeroMQ, and I prefer this lib, over the pure CLR one, since it's much closer to the C API.

Anyway... IIRC the approach used by the SQL Server compact NuGet package is that, it executes a powershell script to automatically copy the native binaries to the build folder. They're not embedded resources, I think.

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

Thanks 👍

I'll have to look into the SQL Server compact package!

from clrzmq4.

floradu88 avatar floradu88 commented on June 5, 2024

Thanks, this issue is solved by the above answer: "Please set the files in i386 and amd64 to "copy if newer" (.dll for Windows and .so for Linux)."

from clrzmq4.

super999 avatar super999 commented on June 5, 2024

Thanks, this issue is solved by the above answer: "Please set the files in i386 and amd64 to "copy if newer" (.dll for Windows and .so for Linux)." +1

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

🍏 💚 🆒 ♻️ 👍

from clrzmq4.

jugalpanchal avatar jugalpanchal commented on June 5, 2024

This is a very silly problem. The answer is perfect. It solved my problem.
Thank you so much! 👍

from clrzmq4.

oriolorra avatar oriolorra commented on June 5, 2024

I have the same problem..... What do you mean with "Please set the files in i386 and amd64 to "copy if newer" (.dll for Windows and .so for Linux)."? I do not know how to proceed.

Thanks,

from clrzmq4.

metadings avatar metadings commented on June 5, 2024

I'm sorry, I don't know how to say this otherwise, you should try harder.

"Please copy the folders i386 and amd64 into the project's output directory."

You should end up using a directory structure like this one:

\MyProject
	\bin
		\Debug
			\amd64
				\libzmq.dll
				\libzmq.so
			\i386
				\libzmq.dll
				\libzmq.so
			\MyProject.exe
			\ZeroMQ.dll
	\amd64
		\libzmq.dll
		\libzmq.so
	\i386
		\libzmq.dll
		\libzmq.so
	\AssemblyInfo.cs
	\Program.cs

from clrzmq4.

Glaemyr avatar Glaemyr commented on June 5, 2024

So, I know that this is an old question, but what could be the cause and possibly fix when the inner exception is not "UnmanagedLibrary" but a NullReferenceException?
I'm trying to create a ZContext in the OnStart() method of a windows service and get the TypeInitializationException when trying to call new ZContext().

I aldready copy the amd64 and i386 folders to the output folder and I have ZeroMQ installed using NuGet.
If I create the context in a test and pass it to the class that needs to use it, it works without any complications.

Again sorry for reopening the issue, but I really am at my wits end.

from clrzmq4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.