Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Does Unity support dotnetcore?

Discussion in 'Scripting' started by akshays, Sep 11, 2020.

  1. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    Does Unity support dotnetcore?

    If it supports dotnetcore which is the latest version of dotnetcore that is supported.

    I understand the UI stuff will not be supported possibly as that makes no sense to support.

    For example would System.Data.SqlClient work? If so would EntityFrameworkCore work? Non UI stuff?

    If Unity does not support dotnetcore and still only supports mono are there any plans to move to dotnetcore?

    If there are plans to support dotnetcore what would be the expected timeline?

    Reason I am asking is I want to know when and if to jump into Unity for my main development environment for everything I do. Unity is a GUI like any other system but it is the ultimate GUI system and if it can support dotnetcore then it can replace all GUI for even business applications is what I thought in 2009 when I bought a licence for the iPhone dev version.
     
  2. Cyber-Dog

    Cyber-Dog

    Joined:
    Sep 12, 2018
    Posts:
    352
    Unity uses the .net framework and mono to compile across platforms.
    System.Data.SqlClient is supported both in core and framework. Same as EF. EF has a core version for .net core. But also has a version for .net framework.
    So... Apart from a very few amount of functions, the .net framework will do all that core can do.

    It sounds like your an app developer rather than a game developor. But just a heads up, while Unity has a great UI system. It does not behave like say a WinForms application. As a whole Unity utilizes the Update method and for an application, than can be allot more expensive comparably.

    It is possible though. I have done it. https://harley-torrisi.itch.io/assetcat
     
    akshays likes this.
  3. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    Thanks Harley John Torrisi.
     
    Cyber-Dog likes this.
  4. SlimeProphet

    SlimeProphet

    Joined:
    Sep 30, 2019
    Posts:
    50
    That's really cool! Did you make that primarily using UGUI?
     
    Cyber-Dog likes this.
  5. Cyber-Dog

    Cyber-Dog

    Joined:
    Sep 12, 2018
    Posts:
    352
    Hey, made entirely of the unity UI system. For the affects I used unity’s animation system to create transition/fade effects
     
    SlimeProphet likes this.
  6. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    My version of Unity is 2020.1.6f1.

    I tried a bunch of stuff and it all failed. I have set in Build Settings > Player Settings > Player > Other Settings > Configuration > { Scripting Backend is set to Mono; Api Compatibility Level is set to .NET Standard 2.0 }

    I have downloaded the 4.7.0 Nuget Package for System.Data.SqlClient and put the .dll in the Assets folder. Got the following error:

    PlatformNotSupportedException: System.Data.SqlClient is not supported on this platform.
    System.Data.SqlClient.SqlConnection..ctor (System.String connectionString) (at <29d91afc22d845f581544c433b4118d7>:0)
    (wrapper remoting-invoke-with-check) System.Data.SqlClient.SqlConnection..ctor(string)
    test.OnRuntimeMethodLoad () (at Assets/Scripts/test.cs:23)


    I have tried with all the versions of it. Also tried to put Api Compatibility Level to .NET 4.x and nothing works.

    Can you give me any detailed instructions or point me to some link that gives me the details on how to make it work.
     
    Last edited: Sep 29, 2020
  7. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    I got it working with the dll's from Nuget Package Microsoft.Data.SqlClient. I also set my Unity Api Compatibility Level to .NET 4.x. Now it works fine.
     
  8. akshays

    akshays

    Joined:
    Aug 14, 2016
    Posts:
    14
    Learned from the first experience of getting it to work with .Net 4.x of getting Unity to talk to SQL Server 2019.

    It is a versioning nightmare as I thought from the start. Need to pick the right DLL's from the Nuget package directory.

    I picked the correct DLL's this time and NetStandard 2.0 is also, in a separate Unity project, is working too.

    Took many hours of trying many different combinations.

    This issue is now resolved.
     
    Cyber-Dog likes this.
  9. mandm

    mandm

    Joined:
    Jul 19, 2015
    Posts:
    1
    Hello akshays, could you please tell me which release version of Microsoft.Data.SqlClient package from Nuget worked for you? I've been trying different versions for 5 hours now without a luck. Would really really appreciate it if you could let me know. Thank you!!
     
  10. Cyber-Dog

    Cyber-Dog

    Joined:
    Sep 12, 2018
    Posts:
    352
    What are you current settings of you project, both the target framework and build pipeline?