Upgrading from .NET 6 to .NET 8
The first step will be to upgrade your ASP.NET project to .NET 8. This is best done by following the official Microsoft documentation:
- Use the Migrate from ASP.NET Core in .NET 7 to .NET 8 article to get your project upgraded to .NET 8
- Check the Migrate from ASP.NET Core 6.0 to 7.0 article to make sure there was no additional work required in the .NET 7 upgrade
- Run through the list of breaking changes for .NET 7, .NET 8, EF 7 and EF 8
Note that there is a severe breaking change in Microsoft.Data.SqlClient that affects Entity Framework 7 onwards whereby the "Encrypt" parameter defaults to true for SQL Server connections. Application startup will throw an exception if you have not configured your database or connection string correctly. Read more about this in the EF 7 breaking changes documentation.
Upgrading to Cofoundry 0.12
Aside from updating the Cofoundry NuGet packages to latest you may also wish to opt-in to static analysis for nullable reference types by configuring the nullable context in your .NET project.
There are a number of breaking changes that have been made in the process of upgrading Cofoundry to use nullable reference types and making improvements around immutability of collection types. Many of these will simply be changes in collections types which the compiler will pick up as errors e.g. replacing ICollection
with IReadOnlyCollection
, but there are also some behavioral changes to be aware of:
IQueryExecutor
andICommandExecutor
no longer allow null queries/commands and will throw aArgumentNullException
if passed null.IDomainRepositoryQueryMutatorExtensions
has been changed to more clearly support nullability. Collections no longer handle null mappings, as values aren’t expected to be null.MapWhenNotNull
replaces the behavior ofMap
to allow differentiation between null and non-nullable mappings.IHtmlSanitizer.Sanitize(IHtmlContent? source)
now returns null if the input is null. This makes behavior consistent withSanitize(string? source)
.IHtmlSanitizer.StripHtml(string? source)
will now return null if input string is null. This makes behavior consistent withStripHtml(HtmlString? content)
Additional breaking changes of note:
IDictionary<TKey,TValue>.GetOrDefault(TKey)
has been removed, which can now be replaced with the new native .NET implementationGetValueOrDefault(TKey)
.- Many members marked obsolete in previous versions have now been removed such as the old data repositories which should be replaced with references to the content repository.
All documentation and samples have been updated, so if you run into problems please check out the docs for up-to-date examples.
Other Updates
Support for webp and SVG image assets
Image assets now support webp and SVG image types. Note that SVGs do not need to support resizing and bypass your installed image resizer plugin completely.
ImageSharp Plugin: ImageSharp v3 License Change
If you're using the Cofoundry ImageSharp plugin, you should be aware that the latest version has been updated to depend on version 3 of ImageSharp which incorporates a change of license to the Six Labors Split License, Version 1.0. Read more about the change of license on the Six Labors blog.
Features
- #537 DomainRepository: Patch: Better handling of nulls
Bug fixes
Docs
Links
For a complete list of bug fixes and features, check out the full release notes on GitHub using the link below.
- Packages on NuGet
- Full 0.12.0 release notes on GitHub