Unity 2017.1 .NET 4.6 Plugin - System.Runtime assembly not allowed to be included?

I am using a plugin compiled for .NET 4.6, which depends on System.ValueTuple. I’m using version 4.3.0 of this package. Everything works ok in the editor, but when I attempt to build for Windows or Mac OS X I get the following error. Could anybody shed some light on what the issue is here?

ArgumentException: The Assembly System.Runtime is referenced by System.ValueTuple ('Assets/Plugins/System.ValueTuple.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:142)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:148)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:148)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:179)
UnityEditor.HostView:OnGUI()

Additional details: I’m experimenting with running a tensorflow neural network from within Unity. I’m using the rather nice TensorFlowSharp wrapper to do it. However, the wrapper targets 4.6.1 so I have retargeted for 4.6 (fork available here). If I can’t get this to work, I’ll have to write my own native calls which will be a pain.

Recently had a the same problem with a .NET 4.6 library that references System.ValueTuple. Copying the following .dlls from Unity’s Mono folder (C:\Program Files\Unity\Editor\Data\MonoBleedingEdge\lib\mono\4.5\Facades) into your project’s assets folder should do the trick.


  • System.Collections
  • System.Resources.ResourceManager
  • System.Runtime

Trying @davidaver 's suggestion did not cause the error to stop occurring for me. Also tried changing “4.5” to “4.6.2-api”, to no effect. — On Linux, Ubuntu 16.04

I am bumping into this same issue. Putting the assemblies into my project has not done any good (though it allows me to build vs getting the exceptions). When I put the assemblies in it seems to build but is not working properly.

I built a library outside of unity in .NET Standard 4.6 and am trying to import it into unity (using Unity Editor 2017.3.0f3). I am able to play my game in editor perfectly fine, but when I try and build it is telling me that System.Runtime.dll could not be loaded in and fails my build

I would love some help getting this resolved :(. I feel like I should be able to make third party libraries and have them imported.

I would like to note that my library depends on a NuGet package that also has dependencies on System.Threading.Tasks.Extensions.dll and System.ValueTuple.dll. Since this was built outside of unity it is NOT using the mono specific versions in the %editor_install_path%\Unity\Editor\Data\MonoBleedingEdge\lib\mono\ directories. I suspect there is some confusion when unity is trying to resolve to it’s own special flavors of these assemblies.

I will make sure and post if I find anything in particular. Going to try and see if this happens in the latest editor version in the meantime