- Home /
Entity Framework with Unity 2018.3.12f1 - System.PlatformNotSupportedException: LocalDB is not supported on this platform.
I am currently trying to integrate Entity Framework (with embedded SQL Server) into Unity project. My steps are next:
In external solution I install EF 6 via NuGet, create simple DbContext and code configuration file. Target platform is 4.7.1, because Unity doesn't support 4.7.2.
I test it in a console application and everything works fine.
Then, I copy files from build folder to Plugins.
Trying to run the same code in Unity.
When I am trying the first time to get DbSet the exception is thrown:
System.PlatformNotSupportedException: LocalDB is not supported on this platform. at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.UInt32 waitForMultipleObjectsTimeout, System.Boolean allowCreate, System.Boolean onlyOneCheckConnection, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x00085] in :0
What am I doing wrong? Is it actually real to integrate EF 6 or EF Core with Unity now?
Answer by Danilan · Apr 15, 2019 at 09:20 PM
Well, thanks to everyone.
I ended up with building EF Core + SQLite project, downloading several dependencies into NetFramework project, copying it all to Plugins and got worked.
The problem with LocalDB was that it anyway needs SQL Server installed on computer. And SQLite is portable engine that can work in the same process.
Your answer
Follow this Question
Related Questions
SqlConnection Error con.Open() 0 Answers
Unity/C# - Is it possible to connect an Azure (cloud) database, to a Unity game, via EnityFramework? 1 Answer
save load exp on database 2 Answers
How can i access a database in the web from unity iphone? 1 Answer
how to fix the socket exception error in unity using sql server express 2014? 0 Answers