Confusing error in Visual Studio trying to build to WSA (phone)

Hi, tried to port my game over to WSA. Freshly built the project and opened the solution in Visual Studio, attempts to build to device result in this oddness:
warning

Error C1083
1>D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: “D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props” cannot be imported again. It was already imported at “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props (31,3)”. This is most likely a build authoring error. This subsequent import will be ignored. [D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\Il2CppOutputProject.vcxproj]

This leads to more errors including
Error C1083 Cannot open include file: ‘Shlobj.h’: No such file or directory

error

Error MSB3073 The command ““D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\IL2CPP\build\il2cpp.exe” --libil2cpp-static --compile-cpp -architecture=ARMv7 -configuration=Release -platform=winrt -outputpath=“D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\build\bin\ARM\Release\GameAssembly.dll” --data-folder=“D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\build\bin\ARM\Release\” -cachedirectory=“D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\build\obj\il2cppOutputProject\ARM\Release\” -generatedcppdir=“D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\Source” --additional-defines=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=Unity -verbose --map-file-parser=“D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\IL2CPP\MapFileParser\MapFileParser.exe”” exited with code -532462766.

Any ideas anyone? How do I fix this build authoring error? Am I missing some first step to setting up VS? Thx.

This error suggests that Windows 10 SDK in not fully installed. You should be able to fix it by installing it again: Windows SDK - Windows app development | Microsoft Developer

Thanks so much for pointing me in the right direction. Some parts of the Win 10 SDK were indeed not installed. I can now successfully build and deploy to a test device, but when I try to Create App Package to upload I get these two errors in regards to the WSATestCertificate.pfx that was generated in Unity:

Error APPX0105 Cannot import the key file ‘WSATestCertificate.pfx’. The key file may be password protected. To correct this, try to import the certificate manually into the current user’s personal certificate store. Polygon Gladiator D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 2705

Error APPX0107 The certificate specified is not valid for signing. For more information about valid certificates, see Signing an app package (Windows Store apps) | Microsoft Learn. Polygon Gladiator D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets 2705

I’ve generated a new one, both with and without passwords… not sure how to go about importing it into the personal certificate store.

Edit…
followed some instructions here:

made a new cert… looks like it’s working so far :slight_smile:

Ok… not sure what is going on or why it’s happening but instead of being able to build to the device (with the green ‘play’ icon in the toolbar) it now only shows debugging options such as “remote windows debugging.” Any ideas on why this would be? I havn’t really changed any of the Unity build settings…

Do you have ARM architecture selected in VS by any chance? You can only run x86 and x64 apps on local machine. To deploy to phone, you need to use ARM and for that you can use either “Remote machine” or “Device” deploy option in VS.

If I misunderstood your question, please post a screenshot of what you’re seeing.

Yes it is set to ARM still. It’s very bizarre. I cannot get it to show “remote machine” or “device” any more even if I try targeting x86 or x64, I’ve tried uninstalling parts of VS then reinstalling, deleting the solution and rebuilding from unity… I’m not sure why I can’t build and deploy any more. I can build from the build menu but not deploy

Can you show a screenshot of what you’re seeing?

!(Dropbox - File Deleted - Simplify your life 2017-09-26 07.55.51.png?raw=1)

I still get this warning as well…

1>D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.props(31,3): warning MSB4011: “D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Makefile.props” cannot be imported again. It was already imported at “C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.cpp.props (31,3)”. This is most likely a build authoring error. This subsequent import will be ignored. [D:\chris\Documents\Unity\PolygonGladiator\WSAPhoneBuild\Il2CppOutputProject\Il2CppOutputProject.vcxproj]

You can ignore that warning, it’s harmless.

If you click on this little arrow:

You should get a drop down menu with choices where to deploy the application.

right, that’s how it always worked before, but all it shows is different debugger options…

What do you mean? So if you click that, and then select “Device”, deploying to phone doesn’t work through it?

What I’ve been saying is that the “Device” and “local machine” options simply aren’t there to pick. I can’t see them. They aren’t grayed out, they aren’t disabled, they simply aren’t there but I have a plethora of remote debugging options… five of them. Sorry, I should have had a screen shot showing the dropdown menu to clarify. Either way I’m in the process of un/reinstalling Visual Studios 2017 as I type as I simply couldn’t figure it out…

I really appreciate your help though! Hopefully reinstalling and rebuilding the project afresh from Unity will be the ticket to get it back to normal…

Here’s a screenshot of the dropdown menu after compete reinstallation of VS and fresh build of project… Still not cooperating…

Ugh, I see what’s wrong. For some reason, the wrong startup project is selected. I don’t know how you got into that state, but to get out of it, right click on “Polygon Gladiator” and click “Set this as startup project”. The reason it’s showing you this is that it thinks you’re trying to run Il2CppOutputProject, which actually outputs a .dll (and which obviously you cannot run).

Wow. Just wow. 1 second fix. Amazing lol. Thanks a while lot.