OK, so I've managed to convince the lead developer to provide for different versions.
This code block below loops through all the files in the program's folder and changes the name of the version of my plugin that matches the version of the underlying program. There are quite a few other dlls in that folder, but I'm getting the following exception with only one - TurboActivate.dll (AutomaticUpdater.dll is in the same folder and does just fine):
"Could not load file or assembly 'C:\\Users\\wjs\\Desktop\\ODVersions\\opendental7.2b\\opendental7.2\\OpenDental\\bin\\Release\\TurboActivate.dll' or one of its dependencies. The module was expected to contain an assembly manifest."
Here's the code:
//for external plugins that need multiple versions in the OD folderstring[] fileEntries = Directory.GetFiles(Application.StartupPath);foreach (string fileName in fileEntries) { string pluginName = Path.GetFileNameWithoutExtension(fileName); string pluginFileName = pluginName; string isDll = Path.GetExtension(fileName); if (isDll == ".dll")//because this only works with .dlls, and there will be other extensions in this folder { AssemblyName assemblyName = AssemblyName.GetAssemblyName(Path.GetFileName(fileName));string aName = assemblyName.Name.ToString() + ".dll"; Version MainAppVersion = new Version(System.Windows.Forms.Application.ProductVersion);//eg. 6.8.0.0 Version MainAppMajMin = new Version(MainAppVersion.Major, MainAppVersion.Minor);//eg. 6.a string version = MainAppMajMin.ToString(); Regex regex = new Regex(version); if (regex.IsMatch(pluginFileName)) { File.Replace(pluginFileName + ".dll", aName, aName + POut.String(".old")); } } }
Google hasn't been much help. I found a few items on prebinding. Ay ideas?