Wednesday, February 02, 2022

TournamentCompare v0.006 - The resurrection

 Now that I have some time to blow the dust off parked projects, TournamentCompare is back in active development. Since almost 7 years have passed, there has a been a pretty steep relearn and upgrade path to get back into the swing of things. 

Visual Studio 2022
Previously development had been exclusively on the laptop with a full install of VS2012, whereas with the community edition generally available I wanted to move it all over to my main PC. Most of the code came across, but the project had issues reconnecting the local files to the new version of SQLExpress. Rather than tackle the upgrade I assumed the laptop would make an easier upgrade path and, as I was taking it to Andrew's, would be required anyway. Over the course of the resurrection I bounced several times between old-but-working versions and the draw of a shinier interface with more integration. 

NuGet Package Management
On the laptop I was able to easily get the original project cloned and compiled under VS2022, but when I went to test a database field update, the scaffolding options for generating the controller and view failed due to requiring EF 6.4.4. After an hour struggling to upgrade 6.1.1 to 6.4.4 using the NuGet package manager (continually downloaded a 0kb package) I gave up and went back to the old code and VS2012 to at least confirm everything was actually working. As package management would definitely be needed eventually I returned after calming down and it was likely an artifact of storing the data on Google Drive. I didn't have much confidence in the cloned package so I looked to regenerate the project again from scratch. 

.NET Framework
When building a brand new project, the package management issues disappeared, but generating the EDMX and controllers from the SQL database seemed to be completely missing. It turns out that a new MVC project using default settings builds only on .NET Core and all the solutions I found for scaffolding out the model-controller & view were definitely NOT what I'd call helpful. To get a new project with .NET Framework elements needed additional components installed into VS 2022, but once up and running it quickly generated the model, controllers and views as expected. 

I had re-read some of the initial blog posts and recalled the struggles with enumerated types. Instead of repeating the coding upgrades to maintain data-first capability, I revisited the initial clone of the code on my main PC and resolved most of the database upgrade and connection issues. NuGet was also working to deliver Entity Framework 6.4.4, but failed to clean up the old version properly (restart VS needed). Feeling confident I upgraded all other components and promptly broke the compile with bootstrap giving unexpected object errors. Looking into it, Bootstrap 3.x to bootstrap 5.x is just too big a jump, so chose just to downgrade. 

So after a couple of days it feels like I have revisited and relearned most of the foibles with Entity Framework and MVC to set off and actually make progress


 - Get Github integrated so I can develop on PC or laptop
 - Confirm everything is able to be published to Azure SQL & Azure apps
 - Build a few more tournament templates
 - Generate sample tournaments rather than record every single tournament instance when calculating bias. 
 - Generate bias using running methods for averages, std deviations and other aggregators.