How to get autocomplete working in visual studio code? - autocomplete

I don't see any code hints when i write code. i would like to see when i type Input. after the dot list of functions etc that i can use but i see nothing. i see only things that i wrote in that file but i don't see any unity classes or anything that i wrote using... at the top.
How to get autocomplete working in visual studio code?
I tried other code editors but none is working. Please help me I can't do anything without autocomplete my life is ruined.
Why isn't this quality standard?

From the documentation:
If you find IntelliSense has stopped working, the language service may
not be running. Try restarting VS Code and this should solve the
issue. If you are still missing IntelliSense features after installing
a language extension, open an issue in the repository of the language
extension.
See more in the docs.

In Unity i click open c# project and than i have message project have trouble loading
Starting OmniSharp server at 20.01.2021, 14:18:44
Target: c:\Users\Mateusz\Desktop\New Unity Project\New Unity Project.sln
OmniSharp server started.
Path: c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\OmniSharp.exe
PID: 2760
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.8.0 - "c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild
MSBuildToolsPath = c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\Mateusz\Desktop\New Unity Project'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'c:\Users\Mateusz\Desktop\New Unity Project\New Unity Project.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\Mateusz\Desktop\New Unity Project'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'c:\Users\Mateusz\Desktop\New Unity Project' on host 10176.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'UnityEngine.UI.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.Timeline.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.Rider.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'Unity.TextMeshPro.csproj' does not exist.
[warn]: OmniSharp.MSBuild.ProjectLoader
The referenced project 'UnityEditor.UI.csproj' does not exist.
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj'.
c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Timeline.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.VSCode.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.TextMeshPro.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'UnityEngine.UI.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Timeline.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.CollabProxy.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.Rider.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.2D.Sprite.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.2D.Tilemap.Editor.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'Unity.TextMeshPro.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1889,5): Error: The referenced project 'UnityEditor.UI.csproj' does not exist.
c:\Users\Mateusz\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.6-beta.30\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1180,5): Error: The reference assemblies for .NETFramework,Version=v4.7.1 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: c:\Users\Mateusz\Desktop\New Unity Project\Assembly-CSharp.csproj
[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
Could not find document for file c:\Users\Mateusz\Desktop\New Unity Project\Assets\sc.cs

Related

Shader warnings for duplicate keyword line

These are the details for the warnings recieved from with Unity 2022 and Visual Studio 2022
Shader warning in 'Hidden/VFX/Shuriken Galaxy VFX/Shuriken Galaxy VFX/Output Particle Quad': Ignoring duplicate keyword line 'multi_compile_fog __ FOG_LINEAR FOG_EXP FOG_EXP2'
Warning CS8032 An instance of analyzer Unity.MonoScriptGenerator.MonoScriptInfoGenerator cannot be created from C:\Program Files\Unity\Hub\Editor\2022.2.4f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.SourceGenerators.dll: Could not load file or assembly 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.. VFXGraph.OutputEventHandlers C:\Program Files\Unity\Hub\Editor\2022.2.4f1\Editor\Data\Tools\Unity.SourceGenerators C:\Program Files\Unity\Hub\Editor\2022.2.4f1\Editor\Data\Tools\Unity.SourceGenerators\Unity.SourceGenerators.dll 1 Active
I have made sure Visual Studio is using the latest version of .NET but am still finding it difficult to resolve this problem.
Installed .NET 7 with Visual Studio 2022

How can I fix code folding in Visual Studio Code

When opened, Visual Studio Code will show the appropriate vector symbols alongside the line number as usual, but once finished loading the vector symbols that indicate where one should be able to expand or collapse code are gone, and neither clicking the location, outline, nor shortcut keys have any effect. The vectors and ability to collapse folded code disappear at about the same time as a warning message in the lower right hand corner appears saying "Some projects have trouble loading. Please review the output for more details." Before that I am also getting an error message when things still work that says "Unable to start MSBuild language server (see the output window for details)." (The output window says:
Starting OmniSharp server at 2/4/2021, 3:58:32 PM\
Target: d:\Documents\<redacted> Collab\New Macabre Project\New Macabre Project.sln
OmniSharp server started.
Path: c:\Users\casto\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\OmniSharp.exe
PID: 40184
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Visual Studio Enterprise 2017 15.9.28307.812 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
2: StandAlone 16.8.0 - "c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin"
[warn]: OmniSharp.CompositionHostBuilder
It looks like you have Visual Studio lower than VS 2019 16.3 installed.
Try updating Visual Studio to the most recent release to enable better MSBuild support.
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to 'c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin\MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.8.0 - "c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin"
CscToolExe = csc.exe
CscToolPath = c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin\Roslyn
MSBuildExtensionsPath = c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild
MSBuildToolsPath = c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'd:\Documents\<redact> Collab\New Macabre Project'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in 'd:\Documents\<redact> Collab\New Macabre Project\New Macabre Project.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for 'd:\Documents\<redact> Collab\New Macabre Project\New Macabre Project.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\Documents\<redact> Collab\New Macabre Project'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: d:\Documents\<redact> Collab\New Macabre Project\New Macabre Project.csproj
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location 'd:\Documents\<redact> Collab\New Macabre Project' on host 27768.
[fail]: OmniSharp.MSBuild.ProjectLoader
The reference assemblies for .NETFramework,Version=v4.7.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'd:\Documents\Al Petz Collab\New Macabre Project\New Macabre Project.csproj'.
d:\Documents\<redact> Collab\New Macabre Project\New Macabre Project.csproj
c:\Users\<redact>\.vscode\extensions\ms-dotnettools.csharp-1.23.8\.omnisharp\1.37.5\.msbuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(1180,5): Error: The reference assemblies for .NETFramework,Version=v4.7.2 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: d:\Documents\<redact> Collab\New Macabre Project\New Macabre Project.csproj
.) For the past couple of months I have been plighted MS language build errors, and while that might be causing me some trouble this code folding problem is new, and I have nothing to go on.
By seeing the message "It looks like you have Visual Studio lower than VS 2019 16.3 installed."
I tried to google, and I found this.
But in your context is not clear what you are doing and what kind of software you are building; please provide us ( the community ) with a bit more details on what and where you are creating your project (e.g. Unity its version or something else). You can try to google the required version for the engine or the framework you are using.
Please add some more details about the project.
Different engines/programs may require different versions of
Developer Pack or ".NET Core version".
That is why we can only make suggestions in this case.
First of all, I would suggest you close your IDE and do the following steps:
Go to dotnet.microsoft.com;
Download the Developer Pack .NET Framework 4.8 or .NET Framework 4.7.2 3(image down below);
Install the downloaded file and try again.
If it does not help you, you may try to update the Visuall Studio to the latest version as it hints to you.
Another way to solve the issues you may try to:
Click on "Build", which is in the top menu;
Click "Clean Solution";
Click "Rebuild Solution".

Cordova app for Windows, NuGet fails to get correct version of System.Collections.Specialized

I'm tearing my hair out trying to build a windows app using Cordova. The build error I'm getting is:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
MSBuild\Microsoft\NuGet\15.0\Microsoft.NuGet.targets(377, 5):
error : The package System.Collections.Specialized with version 4.0.0
could not be found in C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\.
Run a NuGet package restore to download the package.
[C:\cygwin64\home\Owner\src\apps\mytestapp-
gen\platforms\windows\CordovaApp.Windows10.jsproj]
In visual studio, I attempt to add the version of the package to the project and I get the following error:
Severity Code Description Project File Line Suppression State
Error Could not install package 'System.Collections.Specialized
4.0.0'. You are trying to install this package into a project that targets
'native,Version=v0.0', but the package does not contain any assembly
references or content files that are compatible with that framework. For
more information, contact the package author.
Can anyone advise how to resolve this?
I've looked at this very old question How can I make my managed NuGet package support C++/CLI projects? but I can't find anything (particually from the VS2017 era) that helps
May be, this helps others to solve the issue:
My Visual Studio 2017 installation must obviously have been damaged when removing the Visual Studio 2015 installation from that same machine. After I performed a repair of Visual Studio 2017 via Visual Studio Installer the isuue disappeared.

Visual Studio Code macOS: error loading OmniSharp: spawn EACCES

I'm having no luck in trying to make the C# extension work in macOS. When loading the sln file everything seems to load just fine other than OmniSharp. This makes it hard or impossible to work with Visual Studio Code.
Here's the error I get:
Starting OmniSharp server at 2018-5-4 13:51:51
Target: /PATH/TO/PROJECT/Project.sln
[ERROR] Error: spawn EACCES
Which tells very little about what's wrong.
I followed all instructions found here, including installing Mono SDK but OmniSharp keeps giving this error. I also tried
to install the extension from a vsix file
to overwrite the omnisharp folder content with what I found here
All leading to the same error.
When the extension is freshly installed, it automatically downloads the OmniSharp package and successfully installs it.
Installing C# dependencies...
Platform: darwin, x86_64
Downloading package 'OmniSharp for OSX' (24026 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS / x64)' (44057 KB) .................... Done!
Installing package 'OmniSharp for OSX'
Installing package '.NET Core Debugger (macOS / x64)'
Finished
Someone suggests to add a+x permissions recursively to the whole project folder (as found in this official thread) but is this really necessary? All files in extensions belong to the same staff group as all files in the project do.
I tried this anyway but still [ERROR] Error: spawn EACCES
I'm using Visual Studio Code 1.23.0 and the OmniSharp's version is 1.14.0.
I should also say that all projects I am trying to open are generated by Unity 3D and I have the Unity Debug extension installed.
I don't know where else to go from here. Would someone be able to give advice on this?

NuGet restore during first asp.net vNext project

Today I installed ASP.NET 5 on windows and begun creating my first application in Visual Studio 2015.
When the project loads I get an error: "Package restore failed", specifically the following error:
Restore failed Det gick inte att hitta en del av s�kv�gen C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512. NuGet Config files used:
C:\Users\h\AppData\Roaming\NuGet\nuget.config
C:\Users\h\documents\visual studio 2015\Projects\NextTest\nuget.config
Feeds used:
https://api.nuget.org/v3-flatcontainer/
C:\Program Files (x86)\Microsoft Web Tools\DNU
When I look for the missing file I find the following path missing:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0\Microsoft.Win32.Primitives.4.0.0.nupkg.sha512
But this one exists, note the extra 0 in the version:
C:\Users\h\.dnx\packages\Microsoft.Win32.Primitives\4.0.0.0\Microsoft.Win32.Primitives.4.0.0.0.nupkg.sha512
How would I go about to solve this?
I've tried to search through the project files but no mention of neither Primitives nor verion 4.0.0.
The "Solution DNX SDK version" is 1.0.0-beta8, (beta5 was also available but not selected).
Delete C:\Users\h.dnx\packages folder and try running "dnu restore" command.