Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroMQ.Proxy.dll not a valid Win32 application #3

Open
BrandonPotter opened this issue Nov 25, 2011 · 6 comments
Open

ZeroMQ.Proxy.dll not a valid Win32 application #3

BrandonPotter opened this issue Nov 25, 2011 · 6 comments

Comments

@BrandonPotter
Copy link

Added NetZMQ via NuGet to an Any CPU project. On run, I get an exception on this line:

_publishContext = ZeroMQ.Sockets.ZmqContext.Create(1);

Could not load file or assembly 'ZeroMQ.Proxy.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

Looks like an awesome library so far, so trying to get this working.. :)

@jgoz
Copy link
Owner

jgoz commented Nov 25, 2011

Hmm, interesting.

Do you have the Visual C++ 2010 Redistributable Package installed? I haven't tested this on a machine without the C runtime yet, so that may be an issue.

Also, are you running 32 or 64-bit Windows?

Thanks for testing it out!

@BrandonPotter
Copy link
Author

I am running 64-bit Windows 7 with the following installed (Dev workstation):

Visual C++ 2005 Redistributable
Visual C++ 2008 Redistributable - x86 9.0.30729.4974
Visual C++ 2010 x64 Designtime - 10.0.30319
Visual C++ 2010 x64 Runtime - 10.0.30319
Visual C++ 2010 x86 Runtime - 10.0.30319

Exception occurred when running straight from Visual Studio 2010 in debug mode - haven't tested it any other way.

Let me know if you want additional info...

@jgoz
Copy link
Owner

jgoz commented Nov 27, 2011

Another question for you: do you have any other libzmq.dll files floating around, especially in your project Output dir or on the system path?

If there are other libzmq.dlls in the search path, netzmq will use those instead of its bundled versions. This was done for flexibility, but it might end up biting a lot of people. So in your case, if you have a 32-bit libzmq somewhere, netzmq might be trying to use that even though it is running in 64-bit mode, which would cause a BadImageFormatException.

Are there any inner exceptions bundled in the exception you're seeing?

@BrandonPotter
Copy link
Author

I did remove all of the libzmq references, however it's entirely possible that I missed one. I'll double check this and give it a try as well as check for InnerExceptions.

Thanks!

@jgoz
Copy link
Owner

jgoz commented Dec 19, 2011

Brandon, were you able to get this working?

@stemarie
Copy link

On Windows 8 64 Bit, using VS2012
using 32bit clrzmq, tried 64bit and got the same problem

{"A procedure imported by 'ZeroMQ.Proxy.dll' could not be loaded.":"ZeroMQ.Proxy.dll"}

InnerException: null

A procedure imported by 'ZeroMQ.Proxy.dll' could not be loaded.

at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at ZeroMQ.Proxy.ProxyAssemblyLoader.ExtractAndLoadFromPath(String dir) in c:\Users\Johnny\Documents\Projects\netzmq\src\proj\ZeroMQ\Proxy\ProxyAssemblyLoader.cs:line 62
at ZeroMQ.Proxy.ProxyAssemblyLoader.LoadFromExecutingPath() in c:\Users\Johnny\Documents\Projects\netzmq\src\proj\ZeroMQ\Proxy\ProxyAssemblyLoader.cs:line 35
at ZeroMQ.Proxy.ProxyAssemblyLoader.Load() in c:\Users\Johnny\Documents\Projects\netzmq\src\proj\ZeroMQ\Proxy\ProxyAssemblyLoader.cs:line 18
at ZeroMQ.Proxy.ProxyFactory.Create() in c:\Users\Johnny\Documents\Projects\netzmq\src\proj\ZeroMQ\Proxy\ProxyFactory.cs:line 27
at System.Lazy`1.CreateValue()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants