Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormatterServices is obsoleted in .NET 8.0 #55

Open
emako opened this issue Apr 18, 2024 · 1 comment
Open

FormatterServices is obsoleted in .NET 8.0 #55

emako opened this issue Apr 18, 2024 · 1 comment

Comments

@emako
Copy link

emako commented Apr 18, 2024

WARN:

SYSLIB0050	“FormatterServices” obsoleted :“Formatter-based serialization is obsolete and should not be used.”	JSONParser.cs

SRC:

[Obsolete("Formatter-based serialization is obsolete and should not be used.", DiagnosticId = "SYSLIB0050", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static class FormatterServices
{
    ///
}
@topeterk
Copy link

topeterk commented May 5, 2024

Maybe someone can confirm that this change is okay or even provide a better solution?
topeterk/SystemTrayMenu@173cf0e#diff-77183a5d671cbfb04ff571978b4597b80825b764581bebbf29b2da038e8d236c
So for now, I am ending up with...

        private static object? ParseObject(Type type, string json)
        {
            object? instance = Activator.CreateInstance(type);
            if (instance is null)
            {
                return null;
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants