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