Skip to content

FrostCat/nefarious-octo-spork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nefarious-octo-spork

minimal-ish sample of how to use bindingRedirect

  1. Temporarily rename driver.exe.config.
  2. Use "sn -k keyfile.snk" to generate a key pair.
  3. Compile ext.cs with "csc /t:library ext.cs".
  4. Compile int.cs with "csc /t:library int.cs /r:ext.dll".
  5. Compile it with "csc driver.cs /r:int.dll"; observe that ext.dll wasn't mentioned on that command line.
  6. Run driver.exe; you should get output something like this: "Asked for version, got [External.ext.thing(): [ext, Version=1.0.0.1, Culture=neutral, PublicKeyToken=ebdf360c9c4270fe]]", although the public key token may differ.
  7. Update ext.cs, changing the version to 1.0.1.5, and recompile it.
  8. Run driver.ex, you'll get an error like this: "Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'ext, Version=1.0.0.1, Culture=neutral, PublicKeyToken=ebdf360c9c4270fe' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Intermediate.Int.GetExt() at driver.Main(String[] args)".
  9. Rename driver.exe.config from whatever you had changed the name to. Make sure the public key token matches the one from your version of ext.dll if it's different from above. Output is now "Asked for version, got [External.ext.thing(): [ext, Version=1.0.1.5, Culture=neutral, PublicKeyToken=ebdf360c9c4270fe]]".
  10. Profit!

About

minimal-ish sample of how to use bindingRedirect

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages