Coder Social home page Coder Social logo

Comments (7)

qmfrederik avatar qmfrederik commented on August 16, 2024

Can you provide a bit more of information on which error you got? We've been using imobiledevice-net on .NET 4.6.2 for quite a while without issues.

from imobiledevice-net.

stefanodriussi avatar stefanodriussi commented on August 16, 2024

Ok this really strange.
After reading your response i jumped back to my little project solution and tried to retarget first to 4.5 then 4.6 and surprisingly it worked.
Created three new projects from scratch 4.0 4.5 4.6 and added imobiledevice-net package from nuget to the three of them. Run them and got the runtime exception on all three

System.DllNotFoundException: 'Unable to load the DLL 'libimobiledevice': Unable to find specified module. (Exception from HRESULT: 0x8007007E).'

The code i'm using is this

NativeLibraries.Load();
deviceApi = new iDeviceApi(LibiMobileDevice.Instance);
deviceApi.idevice_event_subscribe((ref iDeviceEvent devEvent, IntPtr data) =>
{
    switch (devEvent.@event)
    {
       // switch code here ...
    }
}

the exception shows up as soon as i call idevice_event_subscribe method

from imobiledevice-net.

qmfrederik avatar qmfrederik commented on August 16, 2024

It looks like it's loading the 64-bit imobiledevice.dll on 32-bit .NET or the other way around.
Can you change your project to target x64 or x86 instead of Any CPU?

from imobiledevice-net.

stefanodriussi avatar stefanodriussi commented on August 16, 2024

After some tests, including changing the target to x64, what I discovered is that if I manually copy all the contents from the win7-x64\native folder directly inside my bin/Debug one , it works but for instance, if only copy that libimobiledevice.dll it keeps crashing when i launch it.

from imobiledevice-net.

qmfrederik avatar qmfrederik commented on August 16, 2024

@stefanodriussi Yes, you need all files from the win7-x64\native folder for it to work. libimobiledevice.dll depends on some other .dll files, so that's why you get that behavior.

Out of curiosity, which version of the NuGet package are you using?

from imobiledevice-net.

stefanodriussi avatar stefanodriussi commented on August 16, 2024

@qmfrederik sorry for the late response.
I'm using NuGet package version 1.2.0.112

from imobiledevice-net.

stefanodriussi avatar stefanodriussi commented on August 16, 2024

I've noticed a strange behavior:
if I copy all the assemblies (from the correct architecture folder) inside my application root folder, everything works but if i delete the original native folder it throws an exception
.
If I delete everything from that folder and leave it empty, apparently the previous check goes through and it loads the libraries.

from imobiledevice-net.

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.