Jump to content

Version issues with interface dll


Recommended Posts

Hello everyone,

I am making a plugin that is supposed to work as an API for other modders. The plugin is separated in two different assemblies:

  • the core assembly contains the actual code that needs to run (it is a ScenarioModule)
  • an interface assembly that contains the relevant interfaces and a manager class to interact with the core

The idea is that a mod that wishes to use this can put a dependency on the interface assembly and it can redistribute it safely: this way the dependency can always be satisfied even when the core is not installed, and we don't have the problem of multiple copies of the core.

However, I noticed a problem. The core assembly also depends on the interface (since it must implement those interfaces); if I use the same version of the interface both in the core installation and in the client mod, everything works fine; but if the client mod uses an older version of the interface than the core was built against, then everything falls apart and every attempt to retrieve instances of the types instantiated by the core results in an InvalidCastException.

Does anybody know what I'm doing wrong (also, I hope that was understandable)?

Link to comment
Share on other sites

After sleeping it off, I realized it was a lot simpler than I thought (conversely, I am much dumber than I thought).

For some reason I cannot really understand, old me decided it was a good idea to have VS use the automatic version number for both the core and the interface, even though the interface didn't change at all between builds.

Guess what? Just switching to manual version numbers has solved the issue. Well, kind of, since it would still happen should the interface change, but that's going to happen a lot more rarely and that gives me a lot of time to understand how KAE solves it :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...