Search Unity

Operation is not supported on this Platform

Discussion in 'Scripting' started by Lukaz0, Oct 23, 2021.

  1. Lukaz0

    Lukaz0

    Joined:
    Jul 1, 2021
    Posts:
    3
    Hello,

    I am using Unity 2020.3.8f1, Windows, and NetStandard 2.0. I am attempting to integrate https://www.nuget.org/packages/MySql.Data/ into my project to store user data. However, whenever I attempt to establish a Connection to the database, I am hit with an error. The error is attached below.

    System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MySql.Data.MySqlClient.MySqlConfiguration' threw an exception. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.PlatformNotSupportedException: Operation is not supported on this platform.


    According to the Website, MySQL.Data's Nuget package support's NetStandard 2.0.
    I also attempted to switch the target to 4.x, but to no avail.

    Any help would be appreciated!
     
    Last edited: Oct 23, 2021
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,686
    I would recommend sticking with one of the Asset Store packaged-up SQL implementations if you're trying to get it working under Unity. You might be able to wrestle the package above into submission but I have no idea where you'd even begin, because Unity is kind of a "special" .NET 2.0 implementation.
     
  3. Lukaz0

    Lukaz0

    Joined:
    Jul 1, 2021
    Posts:
    3
    AFAIK no Unity Package Support's MariaDB. How Special is Unity's 2.0?
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,686
    I'm not a big C# expert, but from my observations of our in-house platform team complaining ceaselessly about it for years and years, I would guess that on a scale of 0 to 255 is is probably in the 200s...

    OTOH, no engine provides as much flexible instantaneous cross-platform value as Unity does, and that's all I care about. :)
     
  5. VolodymyrBS

    VolodymyrBS

    Joined:
    May 15, 2019
    Posts:
    150
  6. VolodymyrBS

    VolodymyrBS

    Joined:
    May 15, 2019
    Posts:
    150
    Just realize that ConfigurationManager is not part of .NET Standard 2.0. Did you download it from Nuget too?
    If not try to download it and add to the project.
    I guess there are some chanse that it will replace loaded by unity dll (but I not sure ;))
     
    Lukaz0 likes this.
  7. Lukaz0

    Lukaz0

    Joined:
    Jul 1, 2021
    Posts:
    3
    Thank you! Looks like Configuration Manager was outdated, a simple update fixed my issue!