- Home /
How to connect unity to MySQL (MariaDB) API, Unity ver 2019.4?
Hi Everybody,
I've been working on connecting my database at MySQL (MariaDB) an ASP.NET web application (MVC) to Unity.
The server is on ASP.NET Web application (MVC) - lets call it the API, and I need to call a method on the API, from unity.
The reason for this approach, is I've been told there's a risk of DoS attack when connecting directly from Unity (Client side).
What I did so far:
Created a ASP.NET application (API) based on this tutorial: https://www.youtube.com/watch?v=KRnW3CedU58 and was able to read and write to the data base.
Create unity project.
Build the API project in Debug mode.
From the folder: /bin/Debug/net5.0/.dll picked up the MyProjectName.dll and dragged into unity project.
I followed this documentation about passing a reference to Unity, a reference of an external API (code) - https://docs.unity3d.com/Manual/UsingDLL.html
Like it says in the documentation linked above - to pass a reference to an external code - project, I need to compile a .dll file from the API project and then place it in the Assets folder, like any other asset.
After dragging the .dll into the Plugins folder, I got the error: Unable to resolve reference 'Microsoft.AspNetCore.Mvc.Core'. Is the assembly missing or incompatible with the current platform?
These are the import setting for the .dll:
Please consult how to solve or address this issue,
Thank you
Your answer
![](https://koobas.hobune.stream/wayback/20220613052043im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Database and Unity 0 Answers
MySQL Database Highscore 0 Answers
Unity as server side? 0 Answers
Advice on best way to have MMO server with MySQL 1 Answer
Unity Member subscription game More security? IDEAS? 0 Answers