There was a task in Unity to interact with the instagram API, it was decided not to reinvent the wheel and use ready-made solutions. I found 2 libraries one https://github.com/vespassassina/ .NET-Instagram-API-Wrapper https://github.com/InstaSharp/InstaSharp The second one was cut off due to the need to support .net versions higher than 2.0 (In Unity, unfortunately while only it, support 4.6 seems to be promised in a release in November). I chose the first library but unfortunately did not understand how to properly import it into the Unity project.

I tried to do this: I downloaded the repository and put it in the folder assets in unity, then in visual studio I added 2 existing projects of this library (which creates unity) to the current solution, and from the main project I added links by clicking RMB on the project => add link => and indicated 2 projects of this library, in visual studio everything looks fine, connect using apibase and using instagram.api; enter image description here but at the same time when switching in Unity errors hang

enter image description here

Actually the question is how to add the library to the project?

UPDATE When you turn off the visual studio, it looks like the links to the 2 added projects fall off like Unity modifies the solution.

Either I'm doing it all wrong.

    1 answer 1

    Since Unity uses its compiler, the studio is only used as a text editor and debugging tool, no more.

    If you connect a dll , then you just need to put it in the Plugins folder (not necessarily, just more convenient). If you connect the library from source, then just put the code in a folder of your choice and use.

    You can also build a dynamic link library ( dll ) from the sources yourself, using, for example, Visual Studio.

    As for the first library, is it probably outdated? She is 5 years old ...

    • I hope that is not out of date :) If the other answers do not go I will mark yours as correct. I understand correctly that I can compile the first lib in a DLL and put it in the plugins folder and use it? - justyx
    • By the way, it is not necessary to put the Plugins in the folder, just more clearly. And also: if the license allows, you can simply rewrite the places that are not compiled for the old .net. This is one of the minuses of your compiler in unity, you understand that it is very difficult to maintain c # compilation under so many platforms) - selya
    • Please add to the answer that, if necessary, you can build a DLL library from the source code and use it. I think for many newbies this will be useful, as it turned out to be useful to me :) and I will already mark the answer as true. But how to build a library, I think people will figure it out))) - justyx
    • thanks for the help. - justyx
    • Another small question if I can, as I understand it, for the same reason that the studio is simply used as an editor, then you can make friends with unity and nuget and not dream? - justyx