0

This is a WPF application on the front end which is the migration tool.

I have a dll which i'm trying to reference both an older version and new version.

The purpose is to use it for migration and de-migration purposes between versions of the product.

example (versions numbers are an example)

I have a release 1.0.15 of the product (.exe file) and it refernces an assembly with some pocos (this assembly version is 2.0.1.0, dll file) which are serialised to json and stored in the database. I then modify the poco object in version 1.0.16 of the product (poco assembly version now is 2.0.2.0). Now when i try to desrealised the json object it longer works as json can't deserialise to the class (json is using strongly typed classes to serialise to interface).

One way i though of was to deserialise the json to the poco in version 2.0.1.0 and then remap to version 2.0.2.0 and save to database.

So i followed this Using two DLLs with same name and same namespace

this didnt work fully as it was complaining about that the name already exists in the project requesting i either sign my assemly or remove it.

i then signed my assemblies using (brutal developer signing) using unsigned assemblies in signed ones. Though when it's signed is says delayed signing for some reason

this let me build with no errors. however now when i run and get to the class which is about to run the migration it fails with Fiel Load Exception Could not load file or assembly ........... The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

So any ideas how i can solve this problem? i've been on a hunt the for 2 days looking through forums and posts

UndeadEmo
  • 433
  • 1
  • 6
  • 15
  • You should manually (Directly or via resolveassembly event) load assembly you want to separate app domain. There is really no other sane way to do that. – Alexei Levenkov Jul 31 '20 at 19:54
  • You will have to show what kind of JSON that application uses, and how come it has version dependent schemas. Usually only binary serialization suffers such issues, and JSON/XML based serialization doesn't. Sounds like you chose a wrong approach initially which led to bigger problems. – Lex Li Jul 31 '20 at 22:35

0 Answers0