Switching to .NET Core 8 Causes Error Where Non-Nullable String Properties Reported as Optional

I have a data access library written in C# using .NET Core 6. Works wonderfully.

My mobile team wants to use the same library for a new app they are building. To support that I created a .NET Maui library project using .NET Core 8 because the Android tools for 6 are no longer supported.

I copied my code file for file over to the Maui project and and it builds w/o error.

I switch my testing application to use the Maui library and when running it I now receive an exception saying that a handful of string properties were modified to be optional and that’s not allowed unless I’m in development mode.

The code did not change, only the version of the .NET framework. If I switch back to using the .NET Core 6 library, it works fine. The code did not change. The property declaration (name changed to protect the innocent) looks like

public string WhoDunnit { get; set; } = "Little Bobby Tables";

What is it about .NET Core 8 that causes this to happen? What can I do about it? Is there an attribute on the property I can set to make Realm-Atlas understand this is not a nullable string?



My bad…

I missed that the .NET Maui Library Project did NOT enable in the .csproj file.

This is NOT an issue.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.