Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deployment Error

Discussion in 'Windows' started by SpindizzyGames, Aug 12, 2017.

  1. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    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
     
  2. DrunkReaperMatt

    DrunkReaperMatt

    Joined:
    Feb 11, 2013
    Posts:
    38
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    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).
     
  4. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    Sure, here is my log file (had to rename it to .txt because gmail doesn't allow .log extension)
     

    Attached Files:

  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    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?
     

    Attached Files:

  6. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    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)
     
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    Which Windows build are you on? You can figure that out by typing "winver" in command prompt.
     
  8. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    Windows 10 Pro

    Version 1703 (OS Build 15063.540)
     
  9. SpindizzyGames

    SpindizzyGames

    Joined:
    Jun 29, 2017
    Posts:
    108
    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
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,646
    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.