Native plugin in package causing copy/delete errors

I’m getting errors for my native DLL in my custom package (from git GitHub - StrangeLoopGames/RuntimeGraphicsInfo)

Could not delete file ‘Library/ScriptAssemblies/RuntimeGraphicsInfo.dll.bak’

UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:371)

and

Copying assembly from ‘Temp/RuntimeGraphicsInfo.dll’ to ‘Library/ScriptAssemblies/RuntimeGraphicsInfo.dll’ failed

Is there something I can do to stop this from happening? I suspect it has something to do with the native plugin being loaded in the editor…

Hi @SLGSimon ,

Unfortunately I don’t think this is an issue with Package Manager but rather an issue with the Script Compilation Pipeline. You might have better luck asking in Unity Engine - Unity Discussions

Or perhaps this thread might help? It seems related:

Let me ask a package manager specific question then: what is expected to happen when you have a native dll in a package and the package updates? As native plugins are never unloaded it would always cause an error correct?

It looks like the problem was caused by an error on my part, I renamed the native dlls to something else, and it was instead trying to load the managed dll into itself.

Now that is working correctly, I can’t update the package while unity is running - as I expected - as the native plugin is loaded from there.