XInputDotNet icon indicating copy to clipboard operation
XInputDotNet copied to clipboard

Release XInput.NET v2017.04-1 is broken for Unity5.5.0f3 Personal edition

Open maakep opened this issue 9 years ago • 23 comments

I've been using the previous release until I had some issues with build, which you took care of and created a new release. I removed the previous release Plugin and imported the new release as I did before which gave me broken references which I couldn't seem to fix.

The latests release has a different folder structure and different filenames on the dlls. The instructions saying

Special instructions for Free version of Unity

Import the .unityPackage as described above
Copy [Project Folder]\Assets\Plugins\x86\XInputInterface.dll to [Project Folder]\XInputInterface.dll
Making a Build does NOT require to copy XInputInterface.dll in the same folder the your game .exe file

cannot be applied to latest release since

  1. The folder structure is now Assets\XInputDotNet\Plugins\etc...
  2. The filenames are XInputInterfaceX86.dll and X64 for 64.

I tried many things, such as resetting the structure to previous, but couldn't get the references to work. I downloaded the previous release and imported it, which is working like before. (I've never done the Special instructions for Free version of Unity though)

maakep avatar Apr 09 '17 10:04 maakep

You do not need to do those instructions anymore with Unity 5. Just delete everything you had that is related XInput.NET in your project (delete outside of Unity), then import the package again.

I updated README.md and the instructions on the release page.

speps avatar Apr 09 '17 10:04 speps

Also note that because you're using an earlier version of Unity than 5.6.0f3, you might need to update the plugin settings to the ones described on the README page.

speps avatar Apr 09 '17 10:04 speps

I see. Well I did those things, and it seemingly didn't work. I can try to upgrade Unity to your version and try again.

These are the steps I followed:

  1. Download the .unitypackage
  2. Delete every previous trace of the XInputDotNet plugin
  3. Assets -> Import package -> Custom package -> Select newly downloaded .unitypackage (These files are now under path Assets/XInputDotNet/Plugins/...)
  4. Make sure every dll has correct Platform settings

Result: Could not resolve this reference. Could not locate the assembly.

This is solved in the 3rd step when importing the old release, even if you can't build because the Platform settings are wrong you can still use the assembly, which I cannot with the new release. It seems to not be registered as an assembly for some reason.

maakep avatar Apr 09 '17 11:04 maakep

There's definitely something strange going on. I'm investigating.

speps avatar Apr 09 '17 11:04 speps

Could you try this please? https://github.com/speps/XInputDotNet/releases/tag/v2017.04-2

That shouldn't error, I did create a new project and imported the package and could build both x86 and x86_64.

speps avatar Apr 09 '17 12:04 speps

Like before; Assets/scripts/ControllerHelper.cs(7,7): error CS0246: The type or namespace name `XInputDotNetPure' could not be found. Are you missing an assembly reference?

line 7 is using XInputDotNetPure;

Manually adding XInputDotNetPure.dll in Visual studio removed the build errors from Visual Studio but Unity doesn't allow me to start. After restarting Unity the manually added assembly is removed in the visual studio build.

Perhaps noteworthy is that I'm running Visual Studio Professional 2013, which seems to have some issues with Unity. Could it be that Visual studio is not fully integrated with Unity (I am, for instance, not automatically gettign the "Attach to Unity" debugger functionality, and when I add a script I need to restart visual studio) and therefore is having issues with building it?

maakep avatar Apr 09 '17 13:04 maakep

Wait, where are you getting this error? If it's in VS, it should add the DLL correctly to the references of the created project. Unity has done that correctly for years, it worked on VS2010...

Make sure the structure like so :

  • XInputDotNet/Plugins/XInputDotNetPure.dll
  • XInputDotNet/Plugins/x86/XInputInterface.dll
  • XInputDotNet/Plugins/x86_64/XInputInterface.dll

That's the bare minimum required to run.

speps avatar Apr 09 '17 13:04 speps

By the way, Visual Studio 2015 is free so you might as well you use that. The Visual Studio Tools for Unity are free too since last year.

speps avatar Apr 09 '17 13:04 speps

Also, I reorganised the files again so make sure to delete the old ones again.

speps avatar Apr 09 '17 13:04 speps

That is the structure, I'm getting the errors in both Unity and VS. Keep in mind, it works flawlessly with the release 2 releases ago.

Yeah, I'm upgrading to Unity 5.6 now and adding the community 2017 VS from the install wizard.

maakep avatar Apr 09 '17 13:04 maakep

Yeah, I clean the old files before every import.

maakep avatar Apr 09 '17 13:04 maakep

Give me a few minutes, I'm going to try to uninstall vs2013 and install the newer.

maakep avatar Apr 09 '17 13:04 maakep

You don't need to uninstall any old version of VS, it's not like Unity. 2 releases ago didn't work either, it was giving a different error.

speps avatar Apr 09 '17 13:04 speps

Huh? I'm uninstalling to keep my PC somewhat clean, or are you telling me if I run the Visual Studio 2017 Community wizard it will actually upgrade my previous installation? Because that'd be magical.

maakep avatar Apr 09 '17 13:04 maakep

No I mean, uninstalling VS can take some time, and it doesn't hurt to keep old versions around. I've had all versions since 2010 once, it all worked fine. It doesn't upgrade it, it just installs the new version.

speps avatar Apr 09 '17 13:04 speps

Haha, the uninstall failed anyway - didn't expect any less. :heart: Guess I'm keeping it.

maakep avatar Apr 09 '17 13:04 maakep

Also, are you using the 32 bits or 64 bits version of the Unity editor?

speps avatar Apr 09 '17 13:04 speps

64

maakep avatar Apr 09 '17 13:04 maakep

Okay, I just tried again with the same package and I see no issues with a new project. Can you try that? Create a new project, import the package, open the XInputTest.unity scene and run it.

speps avatar Apr 09 '17 13:04 speps

Seems to have been an issue with the unity version. After upgrading it works nicely.

maakep avatar Apr 09 '17 13:04 maakep