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:

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 and ICommandExecutor no longer allow null queries/commands and will throw a ArgumentNullException 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 of Map 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 with Sanitize(string? source).
  • IHtmlSanitizer.StripHtml(string? source) will now return null if input string is null. This makes behavior consistent with StripHtml(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 implementation GetValueOrDefault(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

  • #519 Concurrency issue in HtmlSanitizer
  • #542 Not able to see pagination on asset picker pop up

Docs

  • #316 Image Save Location
  • #539 Null exception when calling app.UseCofoundry();

Links

For a complete list of bug fixes and features, check out the full release notes on GitHub using the link below.