EasyHook version error

Feb 4, 2013 at 12:08 AM
Edited Feb 4, 2013 at 12:16 AM
Hello,

I use the latest version like you said to me last time. so 2.7.4761.0 not 2.7.4499.0.
I checked everywhere I knew and there is no version of the 2.7.4499.0 dll of easyhook used in my project. I also removed from registry all entries regarding easyhook.

I dont know why it wants this version. I eaven set to true Specific Version (2.7.4761.0) for references in all my 3 projects.

Now my question is why does it look for the older version ??????

This is the error I get:

{System.IO.FileNotFoundException: Could not load file or assembly 'EasyHook, Version=2.7.4499.0, Culture=neutral, PublicKeyToken=4b580fca19d0b0c5' or one of its dependencies. The system cannot find the file specified.
File name: 'EasyHook, Version=2.7.4499.0, Culture=neutral, PublicKeyToken=4b580fca19d0b0c5'
at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes)
at System.Reflection.RuntimeAssembly.GetExportedTypes()
at EasyHook.InjectionLoader.FindEntryPoint(String userAssemblyStrongName, String userAssemblyFileName)
at EasyHook.InjectionLoader.LoadUserLibrary(String userLibraryStrongName, String userLibraryFileName, Object[] paramArray, HelperServiceInterface helperServiceInterface)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
}




Error is trown here in HelperServiceInterface.cs inside Easyhook:

public static void WaitForInjection(Int32 InTargetPID)
    {
        InjectionWait WaitInfo;

        lock (InjectionList)
        {
            WaitInfo = InjectionList[InTargetPID];
        }

        if (!WaitInfo.Completion.WaitOne(20000, false))
            throw new TimeoutException("Unable to wait for injection completion.");

        if (WaitInfo.Error != null) // HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            throw WaitInfo.Error;
    }
Feb 4, 2013 at 12:11 AM
EasyHook
Assembly Version: 2.7.4761.0
Win32 Version: 2.7.4761.0
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/EasyHook/v4.0_2.7.4761.0__4b580fca19d0b0c5/EasyHook.dll  -- this is the correct 2.7.4761.0 version

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)

CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll

Sandbox
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/ovivm732/Documents/Visual%20Studio%202010/Projects/Sandbox/Sandbox/bin/Debug/Sandbox.exe

System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1001 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Sandbox.Core
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0

CodeBase: file:///C:/Users/ovivm732/Documents/Visual%20Studio%202010/Projects/Sandbox/Sandbox/bin/Debug/Sandbox.Core.DLL

System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.233 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

EasyHook
Assembly Version: 2.7.4761.0
Win32 Version: 2.7.4761.0

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/EasyHook/v4.0_2.7.4761.0__4b580fca19d0b0c5/EasyHook.dll

System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.1 (RTMRel.030319-0100)

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll

System.Web
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.272 built by: RTMGDR

CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll

Feb 4, 2013 at 6:45 AM
In Visual Studio, right-click your project, select "Unload" and then choose to edit the project file.

Do a search for the EasyHook assembly and just make sure it isn't pointing to a specific version at all (I have a vague recollection of something like this happening to me before - although not with EasyHook).

Actually on re-reading what you wrote it looks like the error is not happening in your app but within the injection (so the assembly that you are injecting maybe?). Is it possible the assembly you are injecting is registered in the GAC and has not been replaced with a later version? Maybe try incrementing the version number and reinstall to GAC.

Personally I find it easier to debug and develop without using the GAC so issues with older assemblies lying around doesn't happen.

Let us know how you go.