Posts

Showing posts from May, 2019

Lessons Learnt: Migrating From Net Framework to Net Core - Changing SQLite Providers

Image
I mentioned back in the first post how we swapped SQLite providers during our port from .Net Framework to .Net Standard and .Net Core. Previously we used System.Data.SQLite and we now use Microsoft.Data.SQLite.  In order to support some older .Net 4.5 projects we use multi targetting and some #ifdefs to swap the providers without any real knowledge to the calling applications.

For the most part this worked without a hitch however today I want to highlight a difference between the providers which doesn't cause a build error and ended up being caught very late on in testing.

Rightly or wrongly a decision was made a long time ago to store a date time value in a sqlite db not as ticks but as a string, 2019-05-08T17:14:26.3441705+01:00 for example. It wrongly wasn't being stored as UTC but there was no visible side effect of this in its use case and this has been in the codebase for several years.

During recent final testing it was noted that it appeared just one table of data in o…

Lessons Learnt: Migrating From Net Framework to Net Core - Net Standard Libraries and Net Framework 4.6.1

Image
My second lesson that I wanted to share is related to .Net Standard 2.0 libraries and .Net Framework 4.6.1. You might remember from last time that ".Net Standard 2.0 requires .Net 4.6.1 as a minimum", I've added emphesis to the as a minimum. In the beginning we were using most of our .Net Standard libraries without a problem in 4.6.1 but a couple of times we started hitting random errors that I couldn't pinpoint.

One example I had was using our .Net Standard 2.0 library which uses the System.IO.Ports NuGet package. On Windows everything appeared fine however when we used this with Mono we kept having "Unable to find port" exceptions. We knew this worked fine when we targetted .Net 4.5 however since switching to Net Standard and then the System.IO.Ports Nuget we were hitting this issue. At one point we even considered if this was a real deal breaker and did we have to revert the changes but I remembered the 4.6.1 being a minimum and the little note next to i…