Downloads .NET 3.x vs 4.x Build

Noble Valerian 1 week ago • updated by Lazlo Bonin (Lead Developer) 1 week ago 1

I'm trying to understand the .NET build versions.  The Download page shows .NET 3.x build as recommended, but I have no idea why.  Unity seems to be set to 4.x equivalent in the project settings, but I don't fully understand all that, either.  My typical approach is that if I don't know enough to know, than just get whatever is recommended, but how do I know if that's actually the right choice?

Bolt Version:
Unity Version:
2018.3.0f2 Personal
.NET Version:
Still not sure what this means.

Quick and Concise.  Thank you.

Satisfaction mark by Noble Valerian 1 week ago

Hi Noble Valerian,

The reason the the .NET 3.x recommendation is that until 2018.3, the default scripting runtime was .NET 3.x. Importing the .NET 4.x version of Bolt in a 3.x project would cause errors, but the other way around works. Once the version usage statistics shift towards 2018.x more than 2017.x, we will start recommending the .NET 4.x version. 

The code in both versions is identical aside from one thing. In the .NET 3.x version we package System.Threading.dll, and in the .NET 4.x version it isn't there, because it's part of the built-in framework. If you have code that relies on the System.Threading namespace in a .NET 4.x project, importing the .NET 3.x version will introduce an assembly resolution error while building, because there would be two different System.Threading libraries in the project.

tl;dr version:

  • Use .NET 4.x if you use 2018.3+ with default project settings
  • Use .NET 3.x if you use 2017.x-2018.2 with default project settings