[WP8] UnityPlayer.winmd and Unity 5

Hi there,

I’m upgrading a WP8 project from Unity 4.6 to Unity 5, and am getting some errors with a native plugin that I’ve written. I have changed the import settings on the two dll files to the correct platform setup and changed the placeholder path on the real dll, but am getting:

ArgumentException: The Assembly UnityPlayer is referenced by MyPlugin (‘Assets/Plugins/WP8/MyPlugin.dll’). But the dll is not allowed to be included or could not be found.

Anyone got any ideas? I need to use UnityPlayer.UnityApp.BeginInvoke so can’t just remove that section of code.

Cheers!

How are you plugin files placed in directory tree and what are the settings for them?
Possibly you have something set up incorrectly, but I can’t tell without these details.

Hi there, thanks for your reply, my setup looks like this:

Assets/Plugins/MyPlugin.pdb
Assets/Plugins/MyPlugin.dll (platforms: all except WP8Player, CPU: Any CPU, OS: Any OS)

Assets/Plugins/WP8/MyPlugin.pdb
Assets/Plugins/WP8/MyPlugin.dll (platforms: WP8Player only, CPU: Any CPU, Don’t process: Unchecked, Placeholder: Assets/Plugins/MyPlugin.dll)

OK, now I’m a bit confused. You said it’s native plugin in your first message, but your setup looks like it’s managed dll. Is it .NET dll?
Also, where does the error come from? Can paste full error from Editor?

http://docs.unity3d.com/Manual/wp8-plugins-guide-csharp.html

created using that method and it all worked great on Unity 4.6. Full error log is:

ArgumentException: The Assembly UnityPlayer is referenced by MyPlugin (‘Assets/Plugins/WP8/MyPlugin.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 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:160)
UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List1 alreadyFoundAssemblies, System.String[ ] allAssemblyPaths, System.String[ ] foldersToSearch, System.Collections.Generic.Dictionary2 cache, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:166)
UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[ ] paths, System.String[ ] foldersToSearch, BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:198)
UnityEditor.HostView:OnGUI()

I think the error is still incomplete, there should be something in beginning…

One thing you can do is to redesign your plugin to not referaence UnityPlayer, but rather to declare delegates and set them from main application, where you have access to UnityPlayer.

When I try to build I get that previously mentioned error, and another one that simply says:

Error building Player: Extracting referenced dlls failed.

And that is everything! No other warnings or errors anywhere. Strangely enough if I drop UnityPlayer.winmd into my Assets/Plugins folder, it gets much further into the build but then comes up with a Duplicate Library error. So it’s like there’s something going wrong in the compilation order.

I can go the delegate route but was just hoping there was a simple explanation without having to recode everything.

Thanks for your help :slight_smile: