Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Referencing another project in Visual Studio

Discussion in 'Editor & General Support' started by piottrus10, Nov 11, 2017.

  1. piottrus10

    piottrus10

    Joined:
    Nov 11, 2017
    Posts:
    2
    Hello everyone,

    My problem is I have many projects in Visual Studio and I added Unity project to the solution.
    In that Unity project I wanted to use another projects from the solution but I cannot add reference to them in normal 'Visual studio' way.

    I was looking for a long time for solution of that but I couldn't find anything reasonable (working for me).
    What I realised is that I should add my DLL files to the 'Assets' folder but what next ?

    Adding this DLL files to unity project doesn't make that visual studio or any other editor is detecting these DLLs and with every try to run program I got error about missing assembly reference.

    I am new to Unity but I have to say that looking for information about any technical problem is really terrible. If there are somhere any tutorials, they are usually out of date (like created 5 years ago).

    I am suprised because I guess that when you are developing a game you usually have more than one project in solution and why referencing other project is so problematic ?

    What is the simplest way to reference another project in the solution ?
     
    Last edited: Nov 11, 2017
    Dealzu-The-Wikid likes this.
  2. Chailotl

    Chailotl

    Joined:
    Apr 11, 2017
    Posts:
    44
    Is it really necessary to reference another project from your Unity project...?

    Sorry if I'm not getting what you're saying-
     
  3. piottrus10

    piottrus10

    Joined:
    Nov 11, 2017
    Posts:
    2
    My question is: What is the simplest way to reference another project in the solution ?
     
  4. jhays478

    jhays478

    Joined:
    Jan 13, 2019
    Posts:
    1
    3 years late but I am also having issues finding resources or documentation on how to properly reference other projects (perhaps my google skills are weak).

    Usecase: I am building an MMO and I have two main projects: Client (Unity) & Server (C# app). At some point both of these solutions need to reference the same entity classes and business logic - these would be in their own project. I could copy & paste (duplicate) the code but this is not a good solutions.

    Thoughts?

    Thanks!

    EDIT: It looks like one way to do it is by creating a sub git inside your assets folder:
    https://answers.unity.com/questions/16908/how-to-share-c-source-between-unity-projects.html
     
    Last edited: Aug 30, 2020
    Dealzu-The-Wikid likes this.