Adding a reference to 3rd party package doesn't work.

So i am using a networking library from the asset store (support kinda stopped)

And I need to add a reference in that project, because I need to modify some code there and it needs to know about another 3rd party project also.

I add the reference, in visual studio no errors but unity tells me it can’t find the namespace, after restarting VS 2022 or regenerating csproj files the reference is always gone.

How do i solve this?

EDIT:

To clarify, i need one 3rd party library to be able to access another 3rd party library, both are separate projects in the solution.

Absolutely nothing you configure or fiddle with in Visual Studio or Rider matters.

This includes anything from NuGet or any other referencing system.

Any plugin or external package you desire to use within Unity MUST be placed in Assets/ or referenced in Packages/

Also, there can be a special “Plugins” folder inside your “Assets” folder. Code inside a Plugins folder will compile first, so if you have code inside a “Plugins” folder that references classes outside of the “Plugins” folder then the compiler won’t be able to resolve these dependencies.

Both these libraries are in the assets folder, but i cant figure out how to make them be able to “see” eachother, understand?

Also, both come up as separate projects in visual studio, so i need to link them somehow

Refer to the answer above, im on mobile sorry for the double post :confused:

@Milionario probably each package has an assembly definition (A file with a blue jigsaw piece icon). Just click in this file and find Assembly Definition References like in the picture below:


Now you click in the plus button and choose the desired Assembly definition:
9426686--1321409--upload_2023-10-23_20-44-51.png
Now the project can use classes and objects defined in the project whose assembly definition you have just added.

9426686--1321403--upload_2023-10-23_20-42-25.png

Thanks my friend, that was exactly the solution!