(I use a translator because I can't speak English).
What I'm currently trying to do is to add the following DLLs to the lower version of Nuget, put them in the Plugins folder, and build them.
System.Memory.dll
System.Runtime.CompilerServices.Unsafe.dll
System.Text.Encoding.CodePages.dll
A total of three of these were received from Nuget in 4.5.0 versions, and DLL files were imported from the netstandard 2.0 folder to the Plugins folder of Unity Asset, such as Packages\System.Text.Encoding.CodePages.4.5.0\lib\netstandard2.0.
I brought the DLL files and the results I wanted from the editor came out well. So I tried to build based on this, and the following error appeared.
ArgumentException: The Assembly System.Buffers is referenced by System.Memory ('Assets/Plugins/System.Memory.dll'). But the dll is not allowed to be included or could not be found.
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at <f9102adc00864e0a9c861fc3dd597bda>:0)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at <f9102adc00864e0a9c861fc3dd597bda>:0)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
I think it's an error that can't be brought up when building an external dll file, but I'm not sure what to do.
(FYI, the Unity version is 2019.4.36f1, and the method I tried was to adjust the API Compatibility Level to .Net 4.x or .Net Standard 2.0.)
CodePudding user response:
Your exception message says The assembly "System.Buffers" is missing.
You may need to copy of System.Buffers.dll
Please refer to the link below, https://www.nuget.org/packages/System.Buffers/