On a fresh Windows 10 Pro install, I installed Visual Studio 2017 first before installing Unity 5.6.3f1 with Windows Store addons, as I had discovered once upon a time that installing Unity first before installing VS results in a bunch of targeting issues. Enabled developer mode on both my PC & Lumia 640 running Windows 10, rebooted both. Went in Task Manager and restartedIPOverUSBSvc to make sure it works. From Unity, I installed the Simple Place Holder example from the Asset Store to test my installation. Set the build settings to build it as IL2CPP. Clicked 'Build and Run'. Build went fine with no warning or errors and created the Visual Studio solution & project. However, when it attempts to deploy the app to my Lumia 640 and run it I get this error: Exception: Deployment failed. Output: [13:58:46.513] Windows Phone Player Runner started. [13:58:46.524] An error occurred while running: The type initializer for 'WindowsPhonePlayerRunner.Program' threw an exception. at WindowsPhonePlayerRunner.Program.Main(String[] args) [13:58:46.524] Exiting Windows Phone Player Runner. If I open Visual Studio and build+deploy the project, it works perfectly. I've gotten this same error across three complete re-installs over the past couple of months, and had surrendered to using Visual Studio to deploy. Though it would be nice to deploy without having to open Visual Studio. Any idea how I can get Unity to deploy and run my build to my Lumia 640 without having to rely on Visual Studio? This is my Visual Studio 2017 setup Workloads: Universal Windows Platform development Game development with Unity Mobile development with C++ Game Development with C++ Individual components: .NET Framework 3.5 development tools .NET Frameworl 4.5 targeting pack .NET Framework 4.6.1 SDK .NET Framework 4.6.1 targeting pack .NET Native .NET Portable Library targeting pack Cloud, database, and server: CLR data types for SQL Server Data sources and service refrences Code tools: ClickOnce Publishing Developer Analytics tools NuGet package manager Static analysis tools Compilers, build tools, and runtimes: C# and Visual Basic Roslyn compilers C++/CLI support VC++ 2015.3 v140 toolset(x86, x64) VC++ 2017 v141 toolset(x86, x64) Visual C++ compilers and libraries for ARM Visual C++ runtime for UWP Visual C++ tools for CMake Windows Universal CRT SDK Debugging and testing: C++ profiling tools JavaScript diagnostics Profiling tools Development activities: C# and Visual Basic Javascript and TypeScript language support Visual Studio C++ core features Games and Graphics: Graphics debugger and GPU profiler for DirectX Image and 3D model editors Visual Studio Tools for Unity SDKs, libraries and frameworks: Apache Ant(1.9.3) Graphics Tools Windows 8.1 SDK Typescript 2.2 SDK Windows 10 SDK (10.0.15063.0) for Desktop C++ x86 and x64 Windows 10 SDK (10.0.15063.0) for UWP: C#, VB, JS Windows 10 SDK (10.0.15063.0) for UWP: C++ Windows 8.1 SDK Windows Universal C Runtime Language packs: English
Sadly, all UWP builds rely on VS. You can develop using Mono, but the deployment has to be thru VS. https://stackoverflow.com/questions/32813149/can-mono-run-windows-universal-apps
Hey can you post your full editor log (or PM it to me if you don't wish to post it publicly)? This should definitely not be happening - Build & Run should be a valid way to deploy without going through VS (although it uses VS under the hoods to build the project).
Hmm, something is going terribly wrong when initializing connection to the device. Unfortunately the log isn't verbose enough to diagnose this issue. Could you build & run this VS project and see if you get an exception?
System.TypeInitializationException occurred HResult=0x80131534 Message=The type initializer for 'Microsoft.SmartDevice.MultiTargeting.Connectivity.MultiTargetingConnectivity' threw an exception. Source=Microsoft.SmartDevice.MultiTargeting.Connectivity StackTrace: at Microsoft.SmartDevice.MultiTargeting.Connectivity.MultiTargetingConnectivity.AdjustNoLegacyDevicesFlag(Boolean noLegacyDevices) at Microsoft.SmartDevice.MultiTargeting.Connectivity.MultiTargetingConnectivity..ctor(Int32 localeId, Boolean noLegacyDevices) at Microsoft.SmartDevice.MultiTargeting.Connectivity.MultiTargetingConnectivity..ctor(Int32 localeId) at DeployTest.Program.Main(String[] args) in C:\Users\axo\Downloads\DeployTest\DeployTest\Program.cs:line 11 Inner Exception 1: FileLoadException: Could not load file or assembly 'Microsoft.SmartDevice.Connectivity, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
researched it a bit this morning. should it have an entry in gacutil? gacutil shows Version=12.0.0.0 only for anything related to Microsoft.SmartDevice.Connectivity and the error demands version 11 Microsoft.SmartDevice.Connectivity, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL Microsoft.SmartDevice.Connectivity.Interface, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL Microsoft.SmartDevice.ConnectivityWrapper.11, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL Microsoft.SmartDevice.ConnectivityWrapper.12, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL Microsoft.SmartDevice.MultiTargeting.Connectivity, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL
Yes, sorry for delayed response. Looks like we took an explicit dependency on "Microsoft.SmartDevice.Connectivity, Version=11.0.0.0", which gets installed with VS2012, VS2013 and VS2015. VS2017 doesn't install it, so our tool fails. I'll file a bug internally about this. One workaround would be to install VS2015 on your machine.