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. Dismiss Notice

Assembly Definition - Define Constraints not working with Editor Only platform asmdef

Discussion in 'Scripting' started by Julian_Gamble, Apr 29, 2020.

  1. Julian_Gamble

    Julian_Gamble

    Joined:
    Feb 26, 2020
    Posts:
    7
    Hi there,

    I have an asmdef that is defined for only Editor platform, and I am building some components that are NET_4_6 only. When I add the define constraints, I can see it is not actually being applied as the csproj file is still being generated and included with the files.

    Unity: 2019.3.0f6
    Code (csharp):
    1. {
    2.     "name": "Test",
    3.     "references": [
    4.          "TestDependencyOne"
    5.     ],
    6.     "includePlatforms": [
    7.         "Editor"
    8.     ],
    9.     "excludePlatforms": [
    10.     ],
    11.     "allowUnsafeCode": false,
    12.     "overrideReferences": false,
    13.     "precompiledReferences": [],
    14.     "autoReferenced": true,
    15.     "defineConstraints": [
    16.         "NET_4_6"
    17.     ],
    18.     "versionDefines": [],
    19.     "noEngineReferences": false
    20. }
    If I add everything to excludePlatforms but Editor it seems to work. Is the editor only platform case doing something special when it comes to asmdef registration/parsing?

    Cheers!
    Julian
    Sr. Systems Engineer
    Kabam
     
    Last edited: Apr 29, 2020
  2. jowitt_msft

    jowitt_msft

    Joined:
    Feb 11, 2016
    Posts:
    16
    I'm still seeing this I believe. =(