Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Unity and MSBuild projects

Discussion in 'Package Manager' started by RyanTremblay, Jan 30, 2019.

  1. RyanTremblay


    Aug 31, 2018
    Today, Unity builds C# scripts by directly running the compiler on those source files. Unity generates MSBuild project files as well (e.g. Assembly-CSharp.csproj), but these are basically just for editing the code and verifying that the code builds - Unity does not actually use the dlls produced by these projects.

    Has there been any consideration in switching things up to have the MSBuild project(s) be the only way that the code is built, and ingesting the output assemblies into the Unity project? I feel like this should be the intended direction to take things at this point because:
    1. C# is basically the only language supported in Unity at this point.
    2. MSBuild is now cross platform.
    3. The C# compiler is now cross platform.
    4. NuGet is now cross platform.
    5. Visual Studio is cross platform (via Visual Studio for Mac).
    There are a bunch of obvious advantages to having my Unity scripts managed completely by an MSBuild project:
    1. It becomes trivial to consume OSS via NuGet (it's just an MSBuild PackageReference), where 99.9% of the .NET ecosystem lives, which is very relevant these days with the move to the modern scripting runtime.
    2. It becomes trivial to share private source between my Unity app and my non-Unity app (it's just an MSBuild ProjectReference).
    3. It becomes trivial to take advantage of the entire developer platform built around .NET and C#.
    So - where are things headed in relation to this?
    pacoms and dwenegar like this.