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

version numbers of .net and native dlls #506

Closed
DanAvni opened this issue Aug 18, 2019 · 5 comments
Closed

version numbers of .net and native dlls #506

DanAvni opened this issue Aug 18, 2019 · 5 comments
Labels
Milestone

Comments

@DanAvni
Copy link

DanAvni commented Aug 18, 2019

Up until version 7.14 were the native dll was renamed and separated into a different project, the version number of both dlls (native & .net) was the same. I used this fact to make sure during build of my installation files that both dlls are of the same version (to prevent a case that happened every now and then that VS did not publish the native dll for some reason)

now on version 7.14 the versioning is different between the DLLs. could you please keep them in sync or have some other suggestion how to make sure the native dll is the same version the .net dll expects to find?

@dlemstra
Copy link
Owner

The code of the Native library has been moved to a new project because the code of that library could also be used in a WASM project. And this means that the library will have its own version numbering. And it now uses the version number of the ImageMagick library. I cannot restore the old behaviour because the Native library has no clue what the next version of the Magick.NET library will be. I don't really have any other ideas on how you could check the verson number. Your best option would probably be to figure out why your process sometimes doesn't copy the dll. I have never had this issue with the MagickViewer application that I created. Is your checking process automated? Maybe we could use the AssemblyInformationalVersionAttribute or ProductVersion for this? If you have an other ideas that would help you then feel free to suggest it here.

@DanAvni
Copy link
Author

DanAvni commented Aug 19, 2019

I remember something about the root cause of the native dll issue I have is switching between code branches using different versions of the dll but I haven't tried to study it too deeply.

What if the .NET assembly would contain an attribute specifying which native dll version is required for it to function? I could then extract that out of the .NET dll and work with that comparing it to the native dll version

The other option I was thinking about is adding a "Unit Test" that takes the native dll version and writes it to a text file which will be committed along with other source code into git. assuming all my other unit tests pass, when I would compile an installation, it will then compare the native dll version with the one stored on file known to be passing all tests. This way whenever I update the nuget package and run the tests (which I will do anyway after each nuget update) the file will be updated and it will all run "automatically" without me having to modify the installation script or anything else

dlemstra added a commit that referenced this issue Aug 19, 2019
@dlemstra
Copy link
Owner

Just pushed a patch that will set the TrademarkAttribute to ImageMagick x.x.x.x with the version of the Native library. Would that work for you?

@DanAvni
Copy link
Author

DanAvni commented Aug 20, 2019

I will make that work on my side. Many thanks!

@dlemstra dlemstra added this to the 7.14.2.1 milestone Aug 20, 2019
@dlemstra
Copy link
Owner

I just published a new release where the library contains a TrademarkAttribute that you could use to get the version.

@dlemstra dlemstra closed this as completed Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants