help needed regarding NoGAC and no Admin rights

Feb 3, 2013 at 5:58 PM
Can you please tell me what I need to do so that the app doesnt use GAC and also so that I dont need Administrator rights ?

Your help will be appreciated.
Feb 3, 2013 at 10:08 PM
I try to use CreateAndInject and I think there is no possibility right now for noGAC with CreateAndInject, only with Inject method.

Please give me an example with noGAC for CreateAndInject.
Feb 4, 2013 at 6:52 AM
Edited Feb 4, 2013 at 6:53 AM
I haven't tried this with CreateAndInject, however to get noGAC working:
RemoteHooking.Inject(
    pId,
    InjectionOptions.DoNotRequireStrongName, // not using GAC allow no strong name
    typeof(SomeTypeInYourAssemblyToInject).Assembly.Location, // 32-bit
    typeof(SomeTypeInYourAssemblyToInject).Assembly.Location, // 64-bit
    // the optional parameter list...
    ChannelName);
Feb 4, 2013 at 6:55 AM
Ah I see the problem.

Line 921 of RemoteHook.cs:
    true, // TODO: allow requiring a Strong Name to be an option
I'll log an issue for it - however you can recompile with that set to false to test it out (use the clean.bat and then build.bat).
Feb 4, 2013 at 6:57 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 4, 2013 at 8:30 AM
spazzarama wrote:
Ah I see the problem.

Line 921 of RemoteHook.cs:
    true, // TODO: allow requiring a Strong Name to be an option
I'll log an issue for it - however you can recompile with that set to false to test it out (use the clean.bat and then build.bat).
The above only prevents unsigned assemblies being used. As long as you use the full path to the signed assembly you can still use without GAC as is right now, e.g.:
RemoteHook.CreateAndInject(
    exePath,
    commandLine,
    0,
    typeof(SomeTypeInYourAssemblyToInject).Assembly.Location, // 32-bit
    typeof(SomeTypeInYourAssemblyToInject).Assembly.Location, // 64-bit
    out remoteProcessId,
    // the optional parameter list...
    ChannelName);