Unity5 project not build for PC Standalone, on Windows with external version of Visual Studio (2017)

While this is only remotely related to programming, here it goes:

Since last week I have been playing with Unity (5.6.0f3 Community x64) on Win 10 (x64) - using Visual Studio (2017 Community ) as the attached editor as Unity requires - and started with [Unity]: Tutorials (first from them). For several days everything went fine, but then, the PC build of Standalone target stopped working. Searching and checking the forums failed to find information about this behavior:

PC Standalone build

As you can see from the Build Options dialog box (shifted to the right), there are no combo boxes (Target Platform or Architecture) to allow you to specify build options. Errors on the left side.

Notes (about current behavior):

  • At first the tutorial project was supposed to have messed up somehow, so I created a new one from scratch (empty / simple, containing one sphere to which a Rigidbody is attached and a C # script that applies forces based on user input), but it behaves like the same (this is the build output of the project in the image above)
  • The WebGL assembly works fine (loads in the browser); this is a workaround currently used but takes years to complete
  • The game (obviously) also works (it goes without saying that everything is fine in VStudio, no complaints from csc) !!! but !!! after trying (and unsuccessful) build, the game no longer works (restarting the project is the only way to fix this)

To rule out any possible doubts, here's a screenshot of DownloadAssistant:

Download Assistant

Everything is checked, there are 2 items (not very local for this case) that are not displayed (because the window is not sized), but they are checked (and installed ).

Background information :

  • When installing Unity for the first time, there was no VStudio 2017 on the machine, so it (Community Edition) was installed as part of the Unity installation process (I remember (at least) one combo box related to VStudio in Assistant)
  • Then the VStudio patch was available; While preparing to install, I realized that VStudio was installed in the default path (at% SYSTEMDRIVE%), which doesn't work for me as it's a big product, so:
    • Deleted it
    • Reinstalled it (straight from [VisualStudio]: Visual Studio Downloads ) on a different drive (and yes, I know that changing the install path still installs quite a bit, like the Windows SDK, to% SYSTEMDRIVE%)
    • Since I thought the above 2 steps would break the communication between Unity and the new VStudio, I also reinstalled Unity. There were no VStudio related checkboxes in the Assistant this time (it seems normal to check if any software that needs to be installed is installed 1 ). Later I also discovered a constant (i.e. not erasable during Unity uninstall) RegValue (HKEY_CURRENT_USER \ SOFTWARE \ Unity Technologies \ Installer \ Select_VisualStudio) with a value of 0 (as opposed to many other values ​​in the same key with values ​​of 1)
  • After that I reinstalled Unity several times, including reboots (optional) between uninstall / install, but to no avail (I also took a long shot of enabling RegVaue above before running Assistant)

A little debugging showed that when trying to build (PC Standalone) Unity does something like this (ignore the paths as they are on my machine) that can be reproduced from cmdline:

build_win.bat:

"E:\Install\x64\Unity\5.6.0f3\Editor\Data\MonoBleedingEdge\bin\mono.exe" "E:\Install\x64\Unity\5.6.0f3\Editor\Data\MonoBleedingEdge\lib\mono\4.5\mcs.exe" "@args-win.txt"

      

args_win.txt:

-debug
-target:library
-nowarn:0169
-langversion:4
-out:Temp/Assembly-CSharp.dll
-unsafe
-optimize
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/GUISystem/Standalone/UnityEngine.UI.dll
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/Networking/Standalone/UnityEngine.Networking.dll
-r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll
-define:UNITY_5_3_OR_NEWER
-define:UNITY_5_4_OR_NEWER
-define:UNITY_5_5_OR_NEWER
-define:UNITY_5_6_OR_NEWER
-define:UNITY_5_6_0
-define:UNITY_5_6
-define:UNITY_5
-define:UNITY_ANALYTICS
-define:ENABLE_AUDIO
-define:ENABLE_CACHING
-define:ENABLE_CLOTH
-define:ENABLE_DUCK_TYPING
-define:ENABLE_GENERICS
-define:ENABLE_PVR_GI
-define:ENABLE_MICROPHONE
-define:ENABLE_MULTIPLE_DISPLAYS
-define:ENABLE_PHYSICS
-define:ENABLE_RUNTIME_NAVMESH_BUILDING
-define:ENABLE_SPRITERENDERER_FLIPPING
-define:ENABLE_SPRITES
-define:ENABLE_TERRAIN
-define:ENABLE_RAKNET
-define:ENABLE_UNET
-define:ENABLE_LZMA
-define:ENABLE_UNITYEVENTS
-define:ENABLE_WEBCAM
-define:ENABLE_WWW
-define:ENABLE_CLOUD_SERVICES_COLLAB
-define:ENABLE_CLOUD_SERVICES_ADS
-define:ENABLE_CLOUD_HUB
-define:ENABLE_CLOUD_PROJECT_ID
-define:ENABLE_CLOUD_SERVICES_UNET
-define:ENABLE_CLOUD_SERVICES_BUILD
-define:ENABLE_CLOUD_LICENSE
-define:ENABLE_EDITOR_METRICS
-define:ENABLE_EDITOR_METRICS_CACHING
-define:ENABLE_NATIVE_ARRAY
-define:INCLUDE_DYNAMIC_GI
-define:INCLUDE_GI
-define:PLATFORM_SUPPORTS_MONO
-define:RENDER_SOFTWARE_CURSOR
-define:INCLUDE_PUBNUB
-define:ENABLE_PLAYMODE_TESTS_RUNNER
-define:ENABLE_SCRIPTING_NEW_CSHARP_COMPILER
-define:ENABLE_VIDEO
-define:UNITY_STANDALONE_WIN
-define:UNITY_STANDALONE
-define:ENABLE_SUBSTANCE
-define:ENABLE_RUNTIME_GI
-define:ENABLE_MOVIES
-define:ENABLE_NETWORK
-define:ENABLE_CRUNCH_TEXTURE_COMPRESSION
-define:ENABLE_UNITYWEBREQUEST
-define:ENABLE_CLOUD_SERVICES
-define:ENABLE_CLOUD_SERVICES_ANALYTICS
-define:ENABLE_CLOUD_SERVICES_PURCHASING
-define:ENABLE_CLOUD_SERVICES_CRASH_REPORTING
-define:ENABLE_EVENT_QUEUE
-define:ENABLE_CLUSTERINPUT
-define:ENABLE_VR
-define:ENABLE_WEBSOCKET_HOST
-define:ENABLE_MONO
-define:NET_2_0_SUBSET
Assets/_Scripts/x.cs
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\System.Runtime.Serialization.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\System.Xml.Linq.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\UnityScript.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\UnityScript.Lang.dll
-r:E:\Install\x64\Unity\5.6.0f3\Editor\Data\Mono\lib\mono\unity\Boo.Lang.dll
-sdk:unity

      

args_win.txt is a copy of one of the $ {PROJECT_ROOT} \ Temp \ UnityTempFile- * s (I will call this utfile), more precisely the one that is created when the assembly is run. The most interesting thing is that it was created from another (one of 10+ identical ones created during project load) file (no end-to-end check, maybe there are additional lines) interleaving (and amestecating) multiple lines.

The obvious (don't even need to check the original utfile): -r:E: /Install/x64/Unity/5.6.0f3/Editor/Data/Managed/UnityEngine.dll

which is inserted into the above file works fine. But I don't know how to instruct Unity not to strip it.

Other facts (more or less significant):

  • Several other versions of VStudio installed (2010, 2013, 2015) and more VCRedists, but I seriously doubt any of this will matter since VStudio is only used for editing (for example, Unity starts when a script is clicked)
  • My computer is also "suffering" from [BT]: has the Windows 10 Start menu stopped working? How to fix this (I reboot ~ once a week; 3-4 days later the problem appears again) but it happens weeks before installing Unity

Possible solutions :

  • Remove Unity and VStudio and restore the original setting (if still working) - not desirable
  • Get the answer (here or on the Unity forums, where I'm going to post the same question right away) and hopefully get to the bottom of it.
  • Run the painful debugging / monitoring process ( [MS.Docs]: Process Monitor (ProcMon) is also a great tool), may include disassembling UnityDownloadAssistant-5.6.0f3.exe, but there is no guarantee it will produce a (favorable) result. Anyway, I think there is a (so far hidden) connection between:
    • VStudio checkbox is missing in Assistant when VStudio is already installed
    • Lack of combo boxes of build parameters for PC Standalone
    • Removing UnityEngine.dll Dependency on Build
  • A possible work plan / algorithm to fix this would be (theory only):
    • Debug the helper and determine the resource (registry value, file, ...) requested for the VStudio installation status
    • Configure this resource to make the Assistant think that VStudio is not installed; this will call the VStudio installer (and also make the assistant "mark" that this installation is suitable for stand-alone PC builds), which will detect a previous installation (of course, before that the resource (if the same one) should not be configured) and fails (another long option - helper doesn't check return codes)
    • Let the assistant finish and hope everything will be fine

Any ideas are appreciated.

Note 1 (not relevant to the question): I noticed something while uninstalling / installing Unity; if it's Community Edition specific, I can (sort of) figure it out, but if not, then this is a pretty gross error / behavior:

  • Install Unity (completely as above)
  • Launch the Assistant and don't change anything from the previous installation (the parent RegKey of the RegValue I mentioned above checks this by default). Will be:
    • Download (and overwrite ???) any subpackaged program (e.g. UnitySetup-Linux-Support-for-Editor-5.6.0f3.exe, FacebookGamesArcade.msi, ...); for me it was ~ 3GB + (even if the files were already there )
    • Run each specified ("checked") file / file
    • Remove (UnitySetup64.exe) any existing installation before installing (???)
+3


source to share


2 answers


Long story

Apparently there was no easy fix (or at least I couldn't find one), so I started the "extremely complicated" process of uninstalling / reinstalling Unity and VStudio (with reboots after uninstall - to make sure there were no "hidden" operations left hanging).

I started by looking at what Assistant does internally by specifying my own boot path, as shown in the image below:

Assistant custom paths

Note . The installation paths are slightly different from those in the question because I changed them (since I had to reinstall the products, why not use them?), But these changes don't matter.

There was a bunch (~ 3GB +) of downloaded files (executables) in the specified folder as well as a batch script which is the equivalent of the command line helper.

install.bat:

REM Run this script to automatically install or reinstall all packages,
REM as it performed by the Unity Download Assistant.
REM Needs to be run with superuser permissions.

"UnitySetup64.exe" -UI=reduced /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityDocumentationSetup.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityStandardAssetsSetup.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnityExampleProjectSetup.exe" /S
"vs_Community.exe" --productId "Microsoft.VisualStudio.Product.Community" --add "Microsoft.VisualStudio.Workload.ManagedGame" --campaign "Unity3d_Unity" --passive
msiexec.exe /i "FacebookGamesArcade.msi" /qr LAUNCHEXE=FALSE
"UnitySetup-Android-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-iOS-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-AppleTV-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Linux-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Mac-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Metro-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-UWP-IL2CPP-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Samsung-TV-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Tizen-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-WebGL-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3
"UnitySetup-Facebook-Games-Support-for-Editor-5.6.0f3.exe" /S /D=e:\Install\x64\Unity\Community\5.6.0f3

      

The one that caught my eye was related to VStudio:

"vs_Community.exe" --productId "Microsoft.VisualStudio.Product.Community" --add "Microsoft.VisualStudio.Workload.ManagedGame" --campaign "Unity3d_Unity" --passive

      

Since (some of them) the launcher arguments didn't tell me much, I looked at them: [MS.Docs]: Use command line options to install Visual Studio 2017 . So, I ran it from the command line (without being --passive

able to see which features are selected), and I thought I got it: game development with Unity was selected as --passive

in the image below (before I installed VStudio " ok ", I didn't check this box):



Unity selection

But the behavior was the same !!!

Notes :

  • If you choose to install this option (as well as install Unity yourself), be sure to uncheck the box with the Unity editor so you don't need to install it twice
  • As I later found out (by re-checking, of course), checking / unchecking the box for Developing games with Unity has absolutely no effect
  • Also, the fact that VStudio was not installed in the default path (at some point I became paranoid and thought there might be some hard-coded VStudio paths in the Unity files) was not the reason

The next step I took was to recreate the initial script (where it worked):

  • Install VStudio with "my" initial settings (eg game development without Unity)
  • Install Unity with default options - removing its RegKey (which I mentioned in the question) before installing

and it worked !!!

Then I knew that one of the Unity components was corrupting my settings, so on top of the basic installation (the contents of the install.bat file before vs_Community.exe) I started setting all the other parameters, one by one, and after each install component checks if I can do assembling the PC offline, and ...

Short story

It turns out that Facebook Gameroom Build support (as shown in the Assistant) was at the root of all my problems . So another clean install (both VStudio and) Unity ( no Facebook build support) works like a charm.

Now the investigation is only half completed, I still need to figure out why this is happening, but I'm going to stop there. If I need to create a Facebook app in the future, I'll have to figure it out and get it to work, but I won't.
Note that for my (noobish) purpose the standalone builds (PC as I am currently on Win) (and possibly WebGL for testing from the browser) are sufficient for my (noobish) purpose, but I installed all the others in case I want to play around with them,

+1


source


The issue occurs when adding support for Facebook Gameroom build and has not yet been fixed with 2017.3.1f

.

Workaround:



  • Go to the folder Unity

    ( C:\Program Files\Unity

    on Windows x64)
  • Move Unity/Editor/Data/PlaybackEngines/Facebook

    to folder Unity

    , so now you have Editor

    and Facebook

    next to each other

By @jura_z at https://forum.unity.com/threads/installing-facebook-gameroom-build-support-gives-loads-of-errors-when-building-to-windows-standalone.489495/

+1


source







All Articles