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. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Embedded JetBrains.Annotations in (v5) UnityEngine.dll

Discussion in 'Unity 5 Pre-order Beta' started by Michael-Ryan, Feb 28, 2015.

  1. Michael-Ryan

    Michael-Ryan

    Joined:
    Apr 10, 2009
    Posts:
    184
    We use ReSharper with our project, and have previously included a copy of JetBrains.Annotations. See http://answers.unity3d.com/questions/625936/vs-2013-w-resharper-start-update-ongui-is-never-us.html for more info.

    After upgrading the project to Unity 5, I discovered that UnityEngine.dll has its own copy of the JetBrains.Annotations namespace embedded inside it. Does anyone know if this is intentional and will it be included in all future versions of Unity?

    If so, I'll remove our copy from the project.
     
    Last edited: Mar 1, 2015
  2. scobi

    scobi

    Unity Technologies

    Joined:
    May 14, 2014
    Posts:
    32
    This is intentional, yes, and you can rely on the attributes being included in all future versions of Unity. I embedded them directly for a few reasons:
    • Save users the trouble of adding references to the DLL and copying files around.
    • Remove non-applicable or obsolete attributes to reduce Intellisense noise.
    • Enable easy use for Unity engineers on internal code. (Some of these might eventually show up attached to public API's if it makes sense.)
    I used the "Copy default implementation to clipboard" to get the source, and removed Asp*, Html*, and Razor* (not needed in the land of Unity), plus some redundant and obsolete attributes. Then I added missing attributes found in the JetBrains.Annotations.xml in the ReSharper install folder. I'm not sure why JetBrains has different attributes in their default implementation vs embedded in their DLL.

    As new versions of R# come out I'll keep these up to date. Ping me if I mess anything up for you. :)
     
    ph3rin, FIFTYTWO, Ludiq and 5 others like this.
  3. Michael-Ryan

    Michael-Ryan

    Joined:
    Apr 10, 2009
    Posts:
    184
    This is extremely informative. Thanks very much for the update and for including these annotations in Unity!