Skip to content

V6NetStandard2 0

Wade Baglin edited this page Apr 10, 2019 · 3 revisions

PetaPoco NetStandard 2.0

Moving forward, PetaPoco v6 is now a single package and can be used with Full Framework (4.0+) and any other framework supporting NetStandard 2.0+. Simply, the PetaPoco v6 package will work with the traditional .net framework(s) and the new .net core framework(s).

Any gotchas? Yes. When using the NetStandard 2.0 API you won't have access to anything which references the System.Configuration out of the box. It is not a big deal, as .net core has a very flexible configuration approach. If you look at how we do the connection strings for the integration tests, you'll see rolling your own configuration system is easy. If XML and the connection strings section is your thing, you can also include the system.configuration package to continue using the traditional .net configuration style in your .net standard solution. However, PetaPoco won't contain built-in support, such as, passing the connection string name, like it did before, so you'll still have to plumb a little to make it work.

With v6, we've stopped supporting the single file version and the T4 template.

The single file version of PetaPoco was around before nuget itself, or at least before nuget was popular. The common use case was for people to copy/paste the contents of the file from the repo into their own source code. v4 was developed, in a single file, and only split into the components, as you know them today, in v5. The nuget package for deploying the single file version has had it troubles over the years, and due to this, we've decided to not pursue the single file version anymore in v6.

As for t4 templates, well, simply, they're old, somewhat of a security risk and have been very problematic to support. With the different style of configuration systems that we now have to support, getting a connection string in the t4 template is simply not an easy task. If you embed the connection string, this would get blown away on any update. Also, there's been reports of t4 templates not working with the new versions of VS and .net core. Read more in this issue