error in WaitForInjection(Int32 InTargetPID)

Feb 5, 2013 at 12:10 AM
I solved the issues with the GAC with your help.
I also tested with the other option for InjectionOptions.DoNotRequireStrongName instead of
InjectionOptions.NoService in CreateAndInject call

This following error is with InjectionOptions.NoService

I get now following error: Return Argument has an invalid type ( Exception thrown by the target of invocation )

 public static void WaitForInjection(Int32 InTargetPID)
            InjectionWait WaitInfo;

            lock (InjectionList)
                WaitInfo = InjectionList[InTargetPID]; // __here I get the error__

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

            if (WaitInfo.Error != null)
                throw WaitInfo.Error;
please help
Feb 5, 2013 at 12:16 AM
I think is related to missing of file Sandbox.Inject.dll with PublicToken = null, that I changed and signed afterwards.
Somehow it wants the older one I think and it doesnt find it ...

But why ? is GAC still used ?
Feb 5, 2013 at 7:06 AM
If the assembly exists in the GAC it will probably still be used. You will need to uninstall from GAC or at least change the version information of the assembly. I'm not sure what is happening without seeing more of the detail of what's going on sorry.
Feb 5, 2013 at 7:07 AM
Btw - you can combine multiple flags together, e.g.
    InjectionOptions.NoService & InjectionOptions.DoNotRequireStrongName