0

This is a standard Windows Forms application deployed with click-once.

I have an application that opens files generated for the application that have data inside them to be viewed by the application. Due to data schema changes between releases the files are tied to a release of the application for compatibility.

In theory what I'd like to do is check when the file is opened and determine what version of the application is required to read the file. Once that has been determined load the appropriate DLLs for the version needed. The basic principle is that the user can install one version of the application and open files from several versions back as the schema differences accounted for in the code base are maintained in the version-specific DLLs.

Has anyone written or seen anything similar to this goal?

dunderwood
  • 579
  • 5
  • 5
  • check out http://stackoverflow.com/a/18362459/5103770 and/or http://stackoverflow.com/a/465509/5103770 and/or https://msdn.microsoft.com/en-us/library/k3a58006%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396 – Stadem Feb 01 '16 at 21:16

1 Answers1

0

It is unclear the complexity of your data structures, but first I would check Version Tolerant Serialization. That means to try to support different data versions using the same code, as supporting different assemblies may lead to a lot of maintenance effort (fixing a bug in an older version will require merging changes in all the subsequent versions).

If your data structure changes (usually, by adding fields), they will be marked as optional and deserialization should not fail.

For major changes that also required a special processing, you can include a version field that might trigger some other functionality in your code.

Alexei - check Codidact
  • 22,016
  • 16
  • 145
  • 164