Create a Universal DLL (plugin) for Unity 5.2, still need a "proxy"?

Hello,

I’m trying to make a simple Universal DLL for a Universal Windows 10 app. But adding the DLL to the Unity project will not work since I will not be able to reference the namespace. Do I still need to create a DLL proxy with empty stub for the methods (uhhh)? Or am I simply creating the wrong kind of DLL?

Thanks!

That’s strange. This article here says that Unity 5.2 is supposed to support .NET Core 5.0 in our game projects for Windows 10:

However, looking at the API compatibility level on Unity 5.2.0f1, the only options are still just .NET 2.0 and .NET 2.0 Subset. Maybe it has to do with the import settings of the plugin? What did you set it to? Also do you meet the minimum software requirements for Windows 10 development?

  • Unity 5.2 or later
  • A Windows 10 machine
  • Visual Studio 2015 RTM, (the minimum version is 14.0.23107.0). Please note that earlier versions, for example Visual Studio RC, are not supported in Unity 5.2.
  • You’ll also need to install the Windows 10 SDK.

Also, another thing to consider is if your plugin references another library that isn’t part of the .NET framework. If so, you may need to add that library to your plugins folder as well. For example, I made a Universal 8.1 plugin for Unity 4.x for AdDuplex ads that referenced the AdDuplex SDK. When I tried to use the plugin in Unity 5.x, I needed to also add the AdDuplex library to the Unity project because it isn’t part of .NET and Unity was failing to build the project without it even WITH a “proxy DLL”. This is something I normally didn’t have to do in Unity 4.x as long as I remembered to manually add the AdDuplex library to the Visual Studio solution after the project built.

The options for .NET 2.0 and .NET 2.0 Subset is a UI bug (which is fixed internally already).

Built game for Windows 10 Universal will indeed use .NET Core 5.0, but our editor does not. That means that you cannot reference types from .NET Core 5.0 in your plugins that you want to work in the editor. If you need to reference that stuff, you’ll still have to build a stub library so it works in the editor.

1 Like

Thanks for the confirmation @Tautvydas-Zilys . Just wanna make sure, is this an expected error, see below:

The following assembly referenced from ..\New Unity Project\Assets\Win10-Ads-Plugin.dll could not be loaded:
     Assembly:   System.Runtime    (assemblyref_index=0)
     Version:    4.0.20.0
     Public Key: b03f5f7f11d50a3a
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (..\New Unity Project\Assets\).

Could not load file or assembly 'System.Runtime, Version=4.0.20.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.

Because this is what I get when I place my Plugin.dll inside the Unity project. It looks awfully similar to the error which one receives when the C# project has been built (and they (all of the errors) will disappear when you actually press “Build to local machine”).

Thanks!

This error makes sense - it tells you that it tried to load the DLL in the editor. Make sure you specify correct settings in plugin inspector (that is, make the DLL only available for WIndows Store) and select proper stub DLL in the placeholder field of plugin inspector.