Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Assembly Definition referencing to currently used UnityEngine.dll?

Discussion in '2017.2 Beta' started by pahe, Jul 12, 2017.

  1. pahe

    pahe

    Joined:
    May 10, 2011
    Posts:
    421
    Hey.

    I've taken a look into the Assembly Definition feature and it looks interesting. Finally, refencing specific code classes, which are only available in the Unity project (like NGUI for example) could now be referenced by custom dlls (as reference in .csproj files).

    Still I haven't figured out how to solve the problem, when referencing Unitys own dlls, which is especially difficult when developing for the Assetstore and not knowing which Unity version will be used later.

    My use case is:
    1. Have a custom .csproj which references UnityEngine.dll (from Version 5.6.x) to include the MonoBehaviour class.
    2. myCustom.dll is build and added to the Plugins folder to be included.
    3. Upgrade the project to 2017.1f3. Now the myCustom.dll can't be loaded anymore (as it was built with a former version of the UnityEngine.dll), which leads to compiler errors (and worse from what I experienced).

    That means, I couldn't upload a .dll into an Assetstore package which referenced the UnityEngine.dll, as the user may use a different version of the UnityEngine.dll in his project. Including the used UnityEngine.dll is of course not a valid solution to that problem.

    Edit: with the seperation of the engine modules, the problem will be smaller, but it will still be present.

    I wonder if the assembly definition files will actually help with that, so if anyone has already done it, pls let me know how to achieve that.

    Thanks,
    Patrick
     
    Last edited: Jul 12, 2017