JonathonReinhart
12-23-2009, 10:22 PM
Hello - Is anyone out there maintaining plugins for both 2.1 and 2.5? How are you doing it?
On my latest plugin, I marked my main class as "partial" so it can be split across multiple files (just like most Forms are, with the Form.cs and Form.Designer.cs files). Then I put everything in the one file except for the Startup() function. In 2.1 it returns List<Form> but in 2.5 it is void. Then I have my own private startup() function in the main class file.
From here, I duplicate the *.csproj file, and name one _21 and one _25. In one I reference Vixen.exe 2.1.x.x, and the other I reference Vixen.exe 2.5.x.x So the two projects are identical as far as source files go. At this point, they won't compile because they're missing the Startup() functions. So in each project, I add a Startup_2x.cs and implement the correct signature of Startup() and just call my private startup() function. (I never have any MDI windows anyway). Then change each project's output file name, and when I build the whole solution, I get a nice _21 and _25 .dll file in the bin directory.
Clear as mud? :-D Hope this helps anyone trying to keep plugins working for both versions without having to change code in two totally separate projects. If there's an easier way, let me know!
On my latest plugin, I marked my main class as "partial" so it can be split across multiple files (just like most Forms are, with the Form.cs and Form.Designer.cs files). Then I put everything in the one file except for the Startup() function. In 2.1 it returns List<Form> but in 2.5 it is void. Then I have my own private startup() function in the main class file.
From here, I duplicate the *.csproj file, and name one _21 and one _25. In one I reference Vixen.exe 2.1.x.x, and the other I reference Vixen.exe 2.5.x.x So the two projects are identical as far as source files go. At this point, they won't compile because they're missing the Startup() functions. So in each project, I add a Startup_2x.cs and implement the correct signature of Startup() and just call my private startup() function. (I never have any MDI windows anyway). Then change each project's output file name, and when I build the whole solution, I get a nice _21 and _25 .dll file in the bin directory.
Clear as mud? :-D Hope this helps anyone trying to keep plugins working for both versions without having to change code in two totally separate projects. If there's an easier way, let me know!