Related
I just downloaded Visual Studio Code and my Intellisense is not automatically working.
The two settings that control this seem to be set correctly:
"editor.quickSuggestions": true,
"editor.suggestOnTriggerCharacters": true,
I do get an Intellisense menu when i start typing and press "CTRL + Space", but this gives me a list of everything and not things specifically for my object.
What am i doing wrong?
If you have a workspace and for some reason have multiple folders you may need to 'help' omnisharp a bit. I initially had a big project and added a solution for it further on - ending up with TWO workspace folders (one to a startup project and one to the solution). After composing that setup I experienced only the first project to have intellisense working.
Solution to get intellisense working was to make sure omnisharp worked its way from the solution instead of the project:
Ctrl + Shift + p
Write "OmniSharp: Select Project" and press Enter.
Choose the solution workspace entry.
Inspiration gotten from 'swaner':
https://github.com/OmniSharp/omnisharp-vscode/issues/1889
Visual Studio Code's more advanced editing features (IntelliSense, refactoring tools, etc.) only work in C# files if you have a project.json file or *.sln file that VSCode is aware of. Open the folder (i.e. open the File menu and click Open Folder...) with the *.sln file or project.json and VSCode will attempt to find all project/solution files in the folder. If there are multiple projects, you may need to select one from the projects button on the right side of the status bar (bottom of the window).
From the VSCode website:
Selecting a project.json-file is opening a DNX-project and VSCode will load that project plus the referenced projects
Selecting a *.sln-file is opening a MSBuild-project. It will load the referenced *.csproj-projects and sibling or descendant project.json-files but no other project files that are referenced from the solution file.
Selecting a folder will make VSCode scan for *.sln and project.json files and VSCode will attempt to load them all.
If you are start your project with c#, then some time you haven't download extension.
Process by written
Ctrl + Shift + p.
Write "OmniSharp: Select Project" and press Enter.
Choose the solution workspace entry.
Then enable the c# extension for "OmniSharp : Project".
Process by image
Downgrading to 1.23.9 of the C# VS Code extension fixed the intellisense for me. So if nothing else is working for you, perhaps try installing an older version of the extension (doesn't necessarily have to be that exact one I mentioned). You can do this by selecting this option in VS Code:
As of the 0.5 version I have found that I need to close and re-open my working files to get some new intellisense information to start working for my own files. This usually happens after I have a file open that needs to use type information from another file I just created. Until I close and re-open them (within the editor) the intellisense doesn't always work.
Hopefully this is something that'll get fixed as the app matures.
Inorder to make the intelligence working, the Visual Studio Code extension OmniSharp should be there along with Mono. When you open a project/solution folder, the OmniSharp gets the project dependencies from either project.json or from the dotnet solution file (if the project/solution created with other versions of visual studio).
So, when you look at the omnisharp's output window after immediately opening the project/ solution folder, you may see the following lines
Starting OmniSharp server at 2017-9-18 09:26:44
Target: /Users/{username}/Source/{Your Solution Folder}/{Your Solution
file}.sln
OmniSharp server started wth Mono
Path: /Users/{username}/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/run
PID: 5808
post that, you may see couple of lines coming up like below,
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: {Your Project1 Name}
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: {Your Project2 Name}
....
they mean that your projects are getting recognised by OmniSharp Extension.
If you get any error message informing you about timeout, please get into the settings of the Visual Studio Code, and add a configuration override like the one below:
"omnisharp.projectLoadTimeout": 200
I know it is too long to wait for 200 seconds. But don't worry, this won't stop you anymore working with project files. But, remember that the IntelliSense will be automatically available once all the projects in the folder are successfully loaded.
Feel free to extend the Timeout setting since it will help you getting intellisense even-though you are not getting it immediately.
Here is another link with the same solution: https://github.com/OmniSharp/omnisharp-vscode/issues/1585
Hope my information helps you! Enjoy your VSCode!
This case was for an existing project that was working fine before. Opened via the vs code "recent" history.
For dotnet core. I opened my project's *.csprog file, made no changes, and saved it via the vs code editor.
As soon as I saved, all of the intellisense stuff starting working again in my other files within that project.
Another troubleshooting strategy to try if none of the above works out is uninstalling Mono, which is unnecessary anyways if you're using .NET Core. I also experienced a sudden disappearance of Intellisense after pulling changes to one of our enterprise repos that included an upgrade from ASP.NET Core 2.0 to 2.1. Strangely, at the same time, Intellisense was working fine in another C# project repo running ASP.NET Core 2.2.
For the project in question, I was puzzled to see successful logs for each reboot of the Omnisharp server as well as perfectly clean builds and runs. The puzzlement increased as I compared these Omnisharp logs to those from the 2.2 project and found them effectively identical.
Upon uninstalling Mono, the one detail that changed is how Omnisharp started. Now it boots up from a shell script located at ~/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/run. Previously, Mono itself was booting the server from the executable at ~/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/Omnisharp.exe.
Other troubleshooting I attempted in this instance though to no avail:
dotnet clean / Deleting bin and obj directories
Updating launch.json to point at the proper /bin/Debug/netcoreapp2.1 build
directory
Wiping my local nuget cache
Restarting Omnisharp
Uninstalling and reinstalling VS Code, as well as bumping back a version from 1.33.1 as the breakage coincided oddly with the March 2019 update
Uninstalling and reinstalling the C# VS Code extension, as well as bumping back a version from 1.19.0 given other users' reports of said version interfering with Intellisense for certain projects*
Adding a global.json file at project root to override default utilization of latest .NET Core SDK (mine was 2.2.105) and run instead using 2.1.302 in concert with the project's version
Wiping/rebuilding the project .sln file
Specs: VS Code 1.33.1, C# Extension 1.19.0, MacOS High Sierra 10.13.6.
*NB: As it turns out, in another .NET Core 2.1 project with the same issues in VS Code as described above, uninstalling Mono alone did not fix things. I also did wind up needing to bump back the C# extension to v. 1.18.0 to recover Intellisense. Weird.
The issue I had was OmniSharp was an older version. I set the flag to update to latest version in Settings.json file. This ensures the extension is always the latest version.
"omnisharp.path": "latest"
And restarted VS code. That fixed it for me.
Simply reinstall the extension and restart the VSCode/PC.
I use Task Manager and kill the Visual Studio Code process, then restart Visual Studio Code, the intellisense shows and fixed.
I've had some good experiences in C# with this extension so far:
https://marketplace.visualstudio.com/items?itemName=jchannon.csharpextensions
This extension traverses up the folder tree to find the project.json or *.csproj and uses that as the parent folder to determine namespaces.
Try "Install Extension" from command Pallete - probably if C# intellisense is not there:
https://code.visualstudio.com/docs/customization/colorizer
if intellisense in not working for react js or javascript or node js this solution will help for windows
uninistall type script by typing npm uninstall -g typescript
install specific version of type script that is 3.3 by typing npm install -g typescript#3.3
add the typescript location in vscode by navigating to file > Preferences > settings > here search for edit in setting.json then add this path "typescript.tsdk": "/Users/yourusename/AppData/Roaming/npm/node_modules/typescript/lib"
settings.json should look someting like this
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection":"automaticallyOverrodeDefaultValue",
"typescript.tsdk": "/Users/yourusername/AppData/Roaming/npm/node_modules/typescript/lib"
}
I was able to fix this by changing the Api Compatibility Level from .Net Standard 2.0 to .NT 4.x. You can find this setting on Project Settings / Player.
After that, intellisense started working again.
This is because of C# extension issue.
Reinstall the extension will work.
https://code.visualstudio.com/docs/editor/intellisense
https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp
I fixed this with a multiple project solution in .net5 / .net core 3.1 by
opening each project (not the sln folder) in VSCODE. This then prompts to add the resources/ .CSX? files to the project; enabling intellisense, per project. Finally close that window and reopen the solution folder and all works as expected.
See image
Add VSCode assets
Downgrading to 1.23.9 of C# for Visual Studio Code (powered by OmniSharp).
https://i.stack.imgur.com/VrdJl.png
After trying several things I looked at the OmniSharp logs only to realize that because I had two different sln files in my workspace. It had picked up the “other” one and thus wasn’t working. I deleted it, reopened vs code, and all is well again.
For me I had been working without internet for a long time. It had previously been working but then stopped. I closed+reopened VSCode with a stable wifi connection and the Output tab in VSCode popped up, displaying the the extensions were re-installing. After that it worked!
in my case , the extension wasn't enabled
I just had this happen (this being no code completion suggestions appearing). What resolved it for me was changing the VSCode Editor package in Unity to a previous version and then back to the current version.
For me, this was going from 1.2.0 to 1.1.3 and then back to 1.2.0. I believe removing and reinstalling 1.2.0 would have accomplished the same.
Window > Package Manager > Visual Studio Code Editor
I know this is probably the most obvious answer. But I had enough dealing with VS Code ridiculous bugs. You should be focusing on code, not the buggy IDE. Their documentation doesn't make it easy either to debug.
Steps for complete uninstallation:
Save your personalization files such as keybindings.json,
Just put it on GitHub or something so whenever you need have trouble with VS Code you simply just need to go to GitHub and copy-paste it.
Uninstall VS Code completely
When you uninstalled VS Code, it doesn't erase your extension files and some old settings. This is the cause of the re-installation ended up the same. Horrible move VS Code. For the list of the files that you must delete, you can check out this answer.
Go to their website and install the new one.
I hope this helps some people who are already had enough with the VS Code ridiculous bug.
In my case, the issue was not with VS Code settings. The error was due to a corrupted TEMP path configured in my PC's registry user profile environment settings.
I got this error from Help --> Toggle Developer Tools --> Console
The error was flagged in the console when I opened a new typescript file.
Unable to write file c:\Users\XXX\AppData\Local\Temp;C:\wamp64\bin\php\php5.6.25;C:\vufind-3.1.2\install.php\09cf49d8-af5b-42e9-8194-43f5b566be0f'
Obviously this path was corrupted. After updating the environment variables in registry settings, the VS code IntelliSense started working. Checking the console is a good start to find the root cause of this issue.
Earlier intellisense was working for Angular in VS-Code but for some reason (which I don't know) intellisense stopped working. I had extensions installed i.e. Angular Essentials and Angular Language Service etc. that were responsible for this intellisense and all that.
What I did?
I disabled the extensions, restarted VS Code and enabled them. It was all working fine as before.
If everything in VSCode is working ( No errors in output console, language server is working etc.) and built-in extensions are enabled. Still, if your IntelliSense is not working for normal .js files make sure variables are defined with a type identifier such as var d = new Date() or let d = new Date(). In my case, IntelliSense was not working for d = new Date() (No autocomplete for Date object 'd' APIs in this way) but started working fine when I specified a type before my variable names.
Download and install "Tool for Visual Studio 2019" as the C# extension under hood use the build tools: https://visualstudio.microsoft.com/downloads/
In my case, I had an extension installed (Explorer Exclude) to help me focus and hide certain files that I don't regularly work with within the Explorer.
I so happened to have disabled viewing *.sln, *.csproj and *.vsconfig files and folders, which apparently prevents VSCode from even knowing the file is there in the first place. Disabling these specific rules solved the problem instantly.
Took me ages to figure out... The more you know.
I solved it by uninstalling all SDK's (not sure if this is needed)
and installed 4.7.1 developer pack
win 10, vscode 1.63.2, unity 2020.3.25f1
I fixed this by installing .NET Framework 4.7.1 Developer Pack:
https://dotnet.microsoft.com/en-us/download/dotnet-framework/net471
I have a dotnet core console app I generated from the cli via
dotnet new console -n EODG.VsCodeTester.Cli
Using the C# Extensions extension, I right click on the project folder in VSCode, and click "New C# Class".
The class/file opens just fine, but Omnisharp doesn't appear to recognize the file/class. From Program.cs, the class doesn't show up in the code completion, and the codelens in the new class doesn't show up.
The following is outputted from the OmniSharp log...
[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file c:\Users\elrod\src\test\src\EODG.VsCodeTester.Cli\Cat.cs
Now, if I restart OmniSharp, it recognizes the new file just fine... but it's kind of a pain to restart omnisharp everytime I make a new class/interface or rename them. I've never seen this before, and I've been doing dotnet core development in vscode since v1.
I tried googling OmniSharp "Could not find document for file"... and it said No results found for OmniSharp "Could not find document for file".... so, that's nice.
Pertinent Details
OS: Windows 10 (fresh install... like less than 2 hours old)
VSCode version: 1.50.1
OmniSharp version: 1.23.5
Dotnet version: 3.1.403
I will be more than happy to provide any other details I can.
Thanks, y'all!
It looks like OmniSharp version 1.23.5 might be busted... I reverted to version 1.23.3, and things work as expected now. Possibly related to this issue on their git repo.
UPDATE: updating to v1.23.6 resolves this issue.
What worked for me on my mac, was that in settings, search for omnisharp, then look for the option that says Omnisharp: Use Global Mono and set it to always.
Steps to follow to make it work:
Find Assembly-CSharp.csproj.
Find the field under which your
old script names are present for compilation.
Add the new script name.
Save in Unity. Restart VS Code if required.
It should get solved.
I've downloaded VSCode as an IDE for Unity including the extensions unity Debugger and Unity code snippets. The editor shows me suggentions like awake() or start() methods but no variables like Rigidbody, transform or input. How can i solve this problem?
I´ve had the same problem. Only switching to Visual Studio (and downloading the Unity extension) solved it for me.
My Colleagues first recommended Code to me too, but in the end I didn´t see the benefit in it.
In Unity Edit -> Preferences -> External Tools -> Select your external script editor
Still having troubles?
I answered a similar question here:
Visual Studio Code error when using unity
Also here:
How to get Visual Studio to recommend unity codes
You can install only one extension for Unity in VSCode.
unity3d-pack (1.0.0)
This package contains 10 packages in it and all sub-packages are useful for Unity programming.
C#
C# FixFormat
C# Snippets
C# XML Documentation Comments
Debugger for Unity
Shader languages support
Unity Code Snippets
Unity Tools
ShaderlabVSCode(Free)
Code Outline
I tried a few different quick-fix solutions, and none of them worked for me. I finally realized that there was a better way to debug this myself:
Open the Output panel in VSCode ("View -> Output" from the top menu)
Select "OmniSharp Log" from the drop-down in the top right of the Output panel
The problems were MUCH easier to debug once I could see the problems OmniSharp was having just trying to start up. Here were the problems on my Mac:
Somehow, the option "Omnisharp: Use Modern Net" was set to true. This is not supported by the Unity integration, so I had to unset it.
Even though dotnet was on my path, VSCode couldn't find it. I ran which dotnet in a terminal to find the path to the dotnet executable, and set the "Omnisharp: Dotnet Path" setting to that path.
Even though mono was on my path, VSCode couldn't find it. I ran which mono in a terminal to find the path to the mono executable, and set the "Omnisharp: Mono Path" setting to that path.
I am using Visual Studio Code and I have already loaded C# OMNISharp plugin to my system and it works all fine in my existing project/solutions.
However, I just created a new solution and a new project in Visual Studio code and it sounds like for this particular solution, the Intellisense or any other Omnisharp features are just not working. I have tried following things:
Restarting Visual Studio Code
Disabling and enabling my OmniSharp Plug-in
Also, one thing that I noticed is that when a solution is created in Visual studio, it has a lot of code which looks like following:
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AEA16303-6991-4FF1-A3A9-72D892D7968C}"
EndProject
Basically, these are all project references. However, when a solution is created by Visual Studio Code then there is not any section like that. This solution runs and compiles fine, just that it looks fundamentally different than how a Visual Studio solution looks like.
However, nothing seems to be working. Is there anything that I can try to make it work? Any ideas ?
It's caused by adding *.sln and *.csproj to your "files.exclude" setting.
Try this:
Code -> Preferences -> Settings -> "omnisharp.useMono": true/false
Remove from setting file.
Or, Open your project with MonoDevelop or Visual Studio 2015/2017 first, then reopen VS-Code.
Edit 1: Try setting "omnisharp.useGlobalMono": never and then restarting the omnisharp server.
Credit: The_Wolf and kao peter
How did you created the project?
For the Intellisense to work properly the project needs to have a specific structure.
Assuming you have the .net core sdk for mac and the omnisharp extension installed:
Try the following:
Open your integrated terminal (View => Integrated terminal)
Create some new directory to host a test project say "testproj" e.g => mkdir testproj
use the dotnet cli to initialize the project => dotnet new console
See if you got intellisense.
Also i'd recommend watching the .net core on Mac introduction video.
In VS Code v1.43.2 adding following line to settings worked for me:
"omnisharp.useGlobalMono": "never"
The setting's value "never" had to be double-quoted otherwise it would be flagged in red. Even with the quotes, it remained highlighted in yellow. Not sure why, as all other options/values in there are blue. I presume this indicates some sort of warning, but it works.
(As an aside, I would love to understand what a "Globally installed mono" is. However my only interest here was getting IntelliSense working, so re: omnisharp I'm pleading 'newb'.)
This worked for me
"omnisharp.useGlobalMono": "never"
Were your new solution and projects created in a "OneDrive" folder in Windows 10? In latest Windows 10 release, the C# plugin can't start up when a project resides in a OneDrive folder with "File On-Demand" feature on. Please take a look at this issue on Github
I my case, the problem came from the resource folder of my project.
I had added a visual studio .sln file in the ressources to be used as a template but I somehow "variabilized" it with custom tags. OmniSharp tried to parse it and obviously failed, but no error poped up in VSCode, it was only visible in OmniSharp output.
The solution was to rename the template from .sln to .txt to prevent OmniSharp from loading it.
In my case, after installing C# extension, I had to click the setting icon on the extension and then click "Add to workspace recormendations"
I had this problem in 2022 and nothing mentioned above worked for me.
For me the problem was caused by VS Code and C# plugin being updated (in my case c# plugin to v1.25.0+) because in this version they made this:
.NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild tooling (See announcement omnisharp-roslyn#2339). To ensure that the C# > > extension remains usable out of the box for .NET SDK projects, we have > changed the default value of omnisharp.useModernNet to true.
If you still need Unity or .NET Framework support, you can set > omnisharp.useModernNet to false in your VS Code settings and restart OmniSharp.
So entier problem was in omnisharp.useModernNet being set to true by default which renders entire plugin unfunctional but doing what they said and setting
omnisharp.useModernNet to false manually in .vscode > settings.json file solved this problem for me!
For more info, you can also read the entire official VS Code C# Plugin announcement under plugins Details section in VS Code or on this webpage as well!
Although it's only remotely related to programming, here it goes:
Since last week, I've been playing with Unity (5.6.0f3 Community x64) on Win 10 (x64) - using Visual Studio (2017 Community) as attached editor, as Unity "requires" -, and started with the [Unity]: Tutorials (first of them). For a few days everything went just fine, but then, building for PC Standalone target, stopped working. Googleing and checking the forums, didn't help finding information about this exact behavior:
As seen on the Build Settings dialog (moved to the right), there are no (Target Platform or Architecture) combo-boxes allowing to specify build parameters. Errors are on the left side.
Notes (about the current behavior):
First guess was that the tutorial project became somehow messed up, so I created a new one from scratch (a dummy / simple one containing one Sphere having attached a Rigidbody and a C# script that applies forces based on user input), but it behaves the same (this is the project build output in the above image)
WebGL build runs just fine (loads in browser); this is the workaround currently used, but it takes ages to complete
Playing (obviously) also works (needless to say that things are OK in VStudio, no complains from csc), !!!but!!! after trying (and failing) to build, Playing no longer works (reloading the project is the only way to fix it)
To rule out any possible doubts, here's a DownloadAssistant screenshot:
Everything is checked, there are 2 items (not very relevant to this case) that are not showing (because the window is not sizeable), but they are checked (and installed).
Background info:
When first installing Unity, there was no VStudio 2017 version present on the computer, so it (Community Edition) was installed as part of Unity install process (I remember (at least) one VStudio related combo-box in the Assistant)
Then, a VStudio patch was available; when preparing to install it, I realized that VStudio was installed on the default path (on %SYSTEMDRIVE%), which doesn't work for me, since it's a large product, so:
Uninstalled it
Reinstalled it (directly from [VisualStudio]: Visual Studio Downloads) on a different drive (and yes, I am aware that changing the install path, still installs a pretty big part like Windows SDK on %SYSTEMDRIVE%)
Since I thought that the above 2 steps would break the link between Unity and the new VStudio, I also reinstalled Unity. This time, there were no VStudio related check-boxes in the Assistant (seems normal to check if any piece of software that it needs to install, isn't already installed 1). Later on, I also found a persistent (meaning that it's not wiped out at Unity uninstall time) RegValue (HKEY_CURRENT_USER\SOFTWARE\Unity Technologies\Installer\Select_VisualStudio) with a value of 0 (as opposed to a bunch of other values under the same key with values of 1)
After that, I reinstalled Unity several times, including reboots (not required) between uninstall / install, but no result (I also took a long shot of enabling the RegVaue above before starting Assistant)
A little debugging revealed that when trying to build (PC Standalone), Unity does something like this (don't mind the paths, it's how they're 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'm going to refer to such a file as utfile), more precisely of the one that gets created when starting the build. The funky thing is that it's created from another (one of the 10+ identical created at project load time) utfile by (didn't do a through check, maybe there are additional lines as well) striping (and shuffling (amestecating)) some lines.
The obvious one (don't even have to check the source utfile) is: -r:E:/Install/x64/Unity/5.6.0f3/Editor/Data/Managed/UnityEngine.dll, which inserted in the above file, works perfectly. But I don't know how to instruct Unity not to strip it.
Other facts (more or less relevant):
There are several other VStudio versions installed (2010, 2013, 2015), and more VCRedists, but I seriously doubt that any of this would make a difference, since VStudio is only used for editing (e.g. launched by Unity when dblclicking a script)
My computer also "suffers" from [BT]: Has your Windows 10 Start menu stopped working? How to fix it (I restart it ~once a week; after ~3-4 days the problem reappears), but this is happening for weeks before installing Unity
Possible solutions:
Uninstall Unity and VStudio, and restore the original setup (if it still works) - not desirable
Get an answer (here or on Unity forums, where I'm going to post the same question right away), and hopefully get to the bottom of it
Start the painful process of debugging/monitoring ([MS.Docs]: Process Monitor (ProcMon) is an excellent tool) also, might involve disassembling UnityDownloadAssistant-5.6.0f3.exe, but there are no guarantees that it would yield a (favorable) result. Anyway, I think there is a (hidden for now) link between:
VStudio check-box not being present in Assistant, when VStudio already installed
Lack of the build parameters combo-boxes for PC Standalone
Stripping the UnityEngine.dll dependency when building
A possible work plan / algorithm for fixing this would be (just theory):
Debugging the Assistant and identifying the resource (registry value, file, ...) queried for VStudio installation status
Tweak that resource to make Assistant "think" that VStudio is not installed; that would trigger the VStudio installer (and also make Assistant "mark" that this installation as suitable for PC Standalone builds), which would detect a previous installation (of course before this, the resource (if the same) needs to be untweaked) and would fail (another long shot here would be that Assistant doesn't check the return codes)
Let Assistant finish and hopefully everything will be fine
Any ideas are welcome.
Side note 1 (not related to question): While uninstalling/installing Unity, I noticed smth; if it's Community Edition specific, I can (sort of) understand it, but if not, then it's a quite lame bug / behavior:
Have Unity installed (fully as above)
Run the Assistant and don't change anything from previous installation (the parent RegKey of the RegValue that I mentioned above, makes sure of that by default). It will:
Download (and overwrite ???) any sub pkg (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 every specified("checked") pkg / file
Remove (UnitySetup64.exe) any existing installation before installing (???)
The problem seems introduced when adding Facebook Gameroom build support and is not yet fixed as of 2017.3.1f.
Workaround:
Go to Unity folder (C:\Program Files\Unity on Windows x64)
Move Unity/Editor/Data/PlaybackEngines/Facebook to the Unity folder, 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/
Long story
Apparently, there wasn't an easy fix (or at least I couldn't find any), so I started the "extremely challenging" process of uninstalling / reinstalling Unity and VStudio (with restarts after uninstall - to make sure that there are no "hidden" operations left hanging).
I started by looking at what the Assistant does under the hood, by specifying a custom download path, as in the image below:
Note: The installation paths are a little bit different from the ones in the question because I changed them (since I had to reinstall the products why not make some use of it?), but those changes are not relevant.
In the specified folder there were a bunch(~3GB+) of downloaded files (executables), and a batch script that is the command line equivalent of the Assistant.
install.bat:
REM Run this script to automatically install or reinstall all packages,
REM as it's 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 the VStudio related one:
"vs_Community.exe" --productId "Microsoft.VisualStudio.Product.Community" --add "Microsoft.VisualStudio.Workload.ManagedGame" --campaign "Unity3d_Unity" --passive
As (some of) the launcher arguments didn't say much to me, I looked them up: [MS.Docs]: Use command-line parameters to install Visual Studio 2017. So, I launched it by command line (without --passive tho get a chance of looking what features are selected), and I thought I've got it: the Game development with Unity was selected as in the image below (before, when I was installing VStudio "normally", I didn't check that box):
But the behavior was the same !!!
Notes:
If you choose to install this option (and also install Unity yourself), make sure to uncheck Unity editor, to avoid installing it twice
As I later found out (by reinstalling, of course), checking / unchecking Game development with Unity has absolutely no impact
Also, the fact that VStudio wasn't installed on its default path (at some point I became paranoid and thought that there might be some VStudio hardcoded paths in Unity files) was not the cause
The next step that I did, was to recreate the initial scenario (where it used to work):
Install VStudio with "my" initial options (e.g. Game development with Unity unchecked)
Install Unity with default options - deleting its RegKey (that I mentioned in the question) prior to installation
and it worked !!!
Then I knew that one of the Unity components is screwing around with my settings, so on top of the basic installation (the contents of the install.bat til vs_Community.exe) I started installing all the other options, one by one, and after each component install check whether I am able to do a PC Standalone build, and ...
Short story
It turns out that Facebook Gameroom Build Support (as showing in the Assistant) was the root of all my problems. So, another clean install of (both VStudio and) Unity (without the Facebook build support) works like a charm.
Now, the investigation is only half way done, I still need to find out why does this happen, but I'm going to stop here. If in the future, I'll need to build for Facebook, then I'll have to figure it out and make it work, but for now I won't. Note that for my (noobish) purpose, Standalone (PC since currently I'm on Win) builds are enough (and maybe WebGL as well to test from browser), but I installed all the others in case I want to play around with them.