Search Issue Tracker

By Design

Votes

2

Found in

2018.4

2019.4

2020.3

2020.3.2f1

2021.1

2021.2

Issue ID

1329712

Regression

No

Using a compiled C# DLL in a Unity project throws a build error

Scripting

-

How to reproduce:
1. Open the attached "Repro.zip" project
2. Build "test" scene to Standalone

Expected result: Build succeeds when using a compiled C# DLL in a Unity project
Actual result: Build fails when using a compiled C# DLL in a Unity project

Full error:
ArgumentException: The Assembly UnityEditor.CoreModule is referenced by Magnetic3DUnityCamera ('Assets/Magnetic3D/Magnetic3DUnityCamera.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 <d6a6a4b561b9431dbfe2c61f7bf0d405>:0)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at <d6a6a4b561b9431dbfe2c61f7bf0d405>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Reproducible in: 2018.4.35f1, 2019.4.27f1, 2020.3.10f1, 2021.1.8f1, 2021.2.0a18

  1. Resolution Note:

    The assembly Magnetic3DUnityCamera.dll references UnityEditor. You are not allowed to include this in a Standalone build as you will not have access to the editor from your player. You can exclude this assembly from your build in the assembly inspector. Click on the assembly in Unity and unselect Any Platform and only include Editor

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.