Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Setting up a C# project within Unity's generated solution to be used as an assembly

Discussion in '2017.2 Beta' started by TFlippy, Jul 6, 2017.

  1. TFlippy


    Nov 12, 2014
    I'm trying to set up a new C# project (Class Library Portable), but after referencing the other project I still get errors whenever I try to use attributes or similiar objects replaced by Mono.

    Code (CSharp):
    1. The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
    Adding a reference to mscorlib.dll inside Unity 2017.2.0b2\Editor\Data\MonoBleedingEdge\lib\mono\4.6.2-api\ ends up killing the project completely, as now there are missing references to pretty much everything.

    Is there any way how to properly set up a project for the new AssemblyBuilder?
  2. rastlin


    Jun 5, 2017
    Don't use Portable Class Library project type, it's not meant to be used with Unity.

    Use just regular Class Library project type.