Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

UWP Build Problem: "Unable to start program: GameAssembly.dll"

Discussion in 'Windows' started by slembcke2, Aug 16, 2019.

  1. slembcke2


    Jun 26, 2013
    Hi, we have a client project that is working well on a handful of platforms including consoles, but we're working on a UWP version. Unity seems to create a valid Visual Studio project, which then successfully compiles after a few minutes. The only output seems to be the GameAssembly.dll, (and associated PDBs), which Visual Studio then tries to launch. Unsurprisingly, it doesn't work and results in this error:

    From the docs, I expected this to build an executable file, like an .appx or .appxbundle. But that didn't seem to occur. What might be going wrong? This same error occurred for two of our team members now, so it's pretty consistent.

    We're using Unity 2018.4.6f1. I have Visual Studio 2017.
    The UWP build is created with these settings:
    The Unity build completes with no errors.

    The Visual Studio build log is here:

    As you can see, that build completes successfully, but it only generates the GameAssembly.dll and doesn't put together anything that I can run. (it clearly doesn't include game assets, for example).

    I am new to UWP and Windows development, so any suggestions would be very helpful!
  2. timke


    Unity Technologies

    Nov 30, 2017
    So first off, there's a warning in the Build Settings dialogue stating your Visual Studio installation is missing required components. Your build is failing probably because of this, and you first need to run the Visual Studio 2017 installer and add the missing module/workflows.

    1. Launch Visual Studio 2017 Installer
    2. Click "Modify"
    3. From the "Workloads" Page, make sure the following are checked:
    - "Universal Windows Platform Development"
    - "Desktop development with C++"
    - "Game development with Unity" (down towards the bottom)
    4. Select "Individual Components"
    5. Check "Windows 10 SDK" versions (towards the bottom) you intend to use; in your case 10.0.14393

    Install these changes and you should have all the required dependencies.

    That's not how UWP builds work, which means the docs are either incorrect or unclear; please provide some documentation feedback so we can fix this misunderstanding.

    Unity doesn't (typically) create an executable for UWP* nor builds an .appx package/bundle but instead generates a Visual Studio Solution from which you can build the .appx manually. You should still be able to build/run directly from VS (F5) provided the Solution was generated correctly. However, to get the actual .appx you'll need to build that yourself: Project->Store->Create appx

    *In 2019+ releases there's an "Executable Only" option under "Build Type" which does create/deploy an executable for rapid iteration of your Unity Project, but this isn't intended for building your actual .appx.

    Finally, your Visual Studio Solution should include 3 projects:
    - IL2CppOutputProject (Windows Store 10.0); contains all the generated C++ code from your project's scripts
    - <Your Project Name> (Universal Windows); builds the actual UWP executable containing your App and Main code files
    - Unity Data; references the GameAssembly.dll built from the Editor

    From your build log, I'm guessing your Solution only has the IL2Cpp and Unity Data projects but is missing the project, which produces the actual executable. I'm a little surprised the Unity build didn't give any errors (were there warnings?). Regardless, installing the missing VS components should resolve the problem.
    slembcke2 likes this.
  3. slembcke2


    Jun 26, 2013
    Hi Timke,
    Thanks for the help!

    To clarify the first point, I knew that the Unity UWP build wouldn't make an executable, but I expected the visual studio build to make one. It seems like your guess was correct- I only got a single solution with just the IL2CppOutputProject part.

    I modified my VS 2017 install. (It was installed alongside the xbox dev tools months ago so I didn't realize I was missing things there). That fixed the warning I missed on the build settings page.

    It turns out have the Windows 10 SDK 16299, so I switched to that version.

    Now it shows three projects in my solution:

    When I build the solution, it only runs the IL2CppOutputProject. But I can run the Project for my game manually. I can't seem to get the Unity Data project to compile. As a result, the product of my build looks like this:

    This is a pretty good start since we have an exe and a GameAssembly.exe, but no game data.

    As a potential clue, the Unity Data project doesn't show up as a build configuration.

    Here's my Build Settings in Unity now:

    Now the Visual Studio Build log lists that two projects ran and succeeded:

    Any suggestions for getting the third and final project to run?
  4. slembcke2


    Jun 26, 2013
    Of course I got it figured out right after posting after working on it all day.

    I did another build in Unity with these settings, and it worked:

    I guess the problem was either a mismatched build configuration or the wrong Target SDK version. (it wasn't able to detect what I had installed?)

    This time, for whatever reason, the visual studio build reported:

    ========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
    ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

    And it succeeded. Now I'll work on bundling it and sending it off to Partner Center!
  5. Tautvydas-Zilys


    Unity Technologies

    Jul 25, 2013
    That was the issue. Usually "Hyper Dot" would be setup as "Startup project", but since you had missing VS components, the project failed to load and Visual Studio promoted "Il2CppOutputProject" as the startup project. Since you can't start a DLL, you'd get an error. Since you rebuilt it from Unity, Unity reset the startup project to "Hyper Dot" and things started working.

    Unity Data isn't actually a real project, it's just a thing "Hyper Dot" references. It doesn't produce any output.
    slembcke2 likes this.