-
Notifications
You must be signed in to change notification settings - Fork 112
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
Cannot find a way to build dependency dlls (libsodium and libzmq) into ZeroMQ.dll manifest #13
Comments
I don't get your question... ZeroMQ does actually load the files from What do you mean by manifest? |
Hi Uli, Yeah, my question is about the loading of the resource. Please ignore the previous message for now. So far, what I have done is that I changed the "Build Action" property of the libzmq.dll and libsodium.dll to "Embedded Resource". In method ExtractManifestResource, the resourceName variable contains a string like "libzmq.amd64.dll". But, shouldn't it be "ZeroMQ.amd64.libzmq.dll"? The following is the existing code extract from file lib\Platform.Win32.cs: string resourceName = string.Format(string.Format("{0}.{1}{2}", libraryName, arch, LibraryFileExtension)); libraryName = libzmq I changed it to: string resourceName = string.Format(string.Format("ZeroMQ.{0}.{1}{2}", arch, libraryName, LibraryFileExtension)); And, now it works like a charm. As far as I understand, the resource is built into the assembly based on the folder structure used. So, ZeroMQ\amd64\libzmq.dll gets converted to ZeroMQ.amd64.libzmq.dll. Please correct me if I'm wrong. P.S. My goal is to deploy ZeroMQ.dll and its dependencies as a single dll. I do not want to place libzmq.dll and libsodium.dll separately. |
Hey littlesnake! I like very much, that you're using the embedded resource at compilation; that's how I did it back then. However I don't like to say twice |
The embedded resources which are part of the assembly are accessed based on their location in the assembly. so, if I want to access and extract libzmq.dll which is in folder amd64, which in turn is in assembly "ZeroMQ", we should form the absolute string - "ZeroMQ.amd64.libzmq.dll". That is how they are referenced in the assembly. Current implementation forms the string - "libzmq.amd64.dll". Here's a snapshot of the resources present in the assembly. You can see what they are named as. I'm not using the term ZeroMQ, it is automatically used by the build to identify the resource correctly within the assembly. |
hehe, you are really good in VC#... Now you want to do a |
Yes, I will do that. I can check for Win32, however checking for Posix would be difficult. Meanwhile, a few more questions:
|
|
|
How to change the There are some cool examples in the zguide, HWClient and HWServer, but also the Espresso... Did you try them? Updating... Please update your git repository, using I need an update for the I am testing this on
|
I'm new to this. So, even I don't know how the page should be updated. |
Well, let's wait on Pieter's opinion on the licensing issue... I'm also glad to update the Please download clrzmq4 using |
Uli, one more question. The currrent repository contains libzmq version 4.1. I would prefer to work with a stable release instead of an RC. |
Just replace the files in The
Now there is I do not recommend switching back, looking on |
For licensing I'd suggest using MPL v2 as we're doing in newer projects.
|
I would like to say "Alle Angaben ohne Gewähr.", however Americans like to say "Alle Angaben ohne irgendeine Gewähr, explizit und inklusive ... " I am using LGPL now. |
Beware the v4.0.4 is the file in miru's archives, they are originally from 2014-03-15! Current version of zeromq4-x is v4.0.5 (v4.0.6 the next one). We need to update the Installers for Windows section on zeromq.org... Shouldn't we prefer |
Using a code like this would allow to add the libraries to any assembly of the Project. So a recompile of clrzmq4 would not be necessary. if (resourceStream == null)
{
// Locate the resource in any of the current loaded assemblies
var resourceAssembly = AppDomain.CurrentDomain
.GetAssemblies()
.FirstOrDefault(ass => ass.GetManifestResourceNames().Contains(resourceName));
if (resourceAssembly != null)
resourceStream = resourceAssembly.GetManifestResourceStream(resourceName);
} Also the name of a embedded resource can be defined for Visual Studio. It's not possible with the UI, but by editing the <ItemGroup>
<EmbeddedResource Include="amd64\libsodium.dll">
<LogicalName>ZeroMQ.libsodium.amd64.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="amd64\libsodium.so">
<LogicalName>ZeroMQ.libsodium.amd64.so</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="amd64\libzmq.dll">
<LogicalName>ZeroMQ.libzmq.amd64.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="amd64\libzmq.so">
<LogicalName>ZeroMQ.libzmq.amd64.so</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="i386\libsodium.dll">
<LogicalName>ZeroMQ.libsodium.i386.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="i386\libsodium.so">
<LogicalName>ZeroMQ.libsodium.i386.so</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="i386\libzmq.dll">
<LogicalName>ZeroMQ.libzmq.i386.dll</LogicalName>
</EmbeddedResource>
<EmbeddedResource Include="i386\libzmq.so">
<LogicalName>ZeroMQ.libzmq.i386.so</LogicalName>
</EmbeddedResource>
</ItemGroup> |
Yes, that looks correctly... I decided not to have it as resource, because it will add some weight to the binary. You need to (re)compile ZeroMQ/clrzmq4 with your EmbeddedResources. I find it very interesting, that you ask |
|
Might be correct, but is it less secure than have them in subfolders of the application... |
Hm... It's difficult to weight out flexibility and security... Don't you mean "more" secure? :) I think there should be some configuration directive where you can tell, if you first want the |
Sounds cool to me. Should not be to hard to achieve as long as the configuration is done before the first call into platform... |
This is so awesome...! :) I need to copy over my HTTPDealerDevice... STREAM sockets do split the message by 8192 bytes; my HTTPDealerDevice actually does read the |
Hi, I'm having some trouble using this in an ASP.NET environment where it seems to try to locate the asseblies from my user/AppData/Temp directory. After having read this thread, I'm actually not really sure what the conclusion is... Is it possible to get the asseblies from embedded ressources in the current library (as it is on nuget)? |
OH, I didn't test this in an ASP.NET environment... You need to add the libraries as an embedded resource and recompile ZeroMQ/clrzmq4, instead of just adding them using "copy if newer". |
Ok, thank you for the quick response (and sorry for my late one). That'll work :) |
Yes, I plan to do so... I need new binaries, because I compiled zeromq4-1 a year ago. (I need a Windows binary using VC2010 (?), a Linux binary using GCC 4.8.4 (?) and maybe also MacOSX and Android binaries.) |
Fantastic! Now I don't know how this works exactly, but isn't it the same binaries as those deployed on the ZeroMQ website via the Windows installer? Or else I might be able to do the Windows build unless it's seriously complicated :) |
Well it is a bit complicated... :-) And NO, the binary deployed in the "Windows installer" on the website is seriously outdated, it dates back to 2014. |
Ok. I'll stand by then. Let me know if there's anything I should do! :) |
Hi again, I see there's a new release, cool! Does this mean there's a chance of a nuget-package with embedded binaries? :) |
Hi there. Sorry I am very interested by the discussion but I am not getting you well. I am facing the same problem when trying to let my frontend asp.net core communicate with the backend and get the following error details |
Closing this issue. It's too old |
I need to deploy libzmq.dll and libsodium.dll as part of ZeroMQ.dll's manifest. There's code in the Platform.Win32.cs source file that extracts these dependencies to AppData's temporary folder. However, I need to know if there is already a mechanism that is used to create a manifest for ZeroMQ.dll that would contain these dlls as part of the manifest. Right now, in code, I do not see any such thing.
In summary, my goal is to be able to deploy the ZeroMQ.dll, with manifest that contains the unmanaged dependencies which can be extracted at runtime. Do you have some ready made configuration that I could use?
@metadings Can you please help me here?
Thanks!
The text was updated successfully, but these errors were encountered: