Extension|Author (truncated)|Version
---|---|---
vscode-nuget-package-manager|jmr|1.1.5
csharp|ms-|1.13.1
scorpio|whi|0.0.4
Steps to Reproduce:
With ASP .NET Core MVC application opened, try to use code-completion -it either waits very long with text "loading" . When run without extensions, code completion seems to suggest words which are present in currently opened file.
Doing "dotnet clean" followed by "dotnet build" does not solve the problem.
Reproduces without extensions: Yes
I recently got thesame problem but on windows. When i look in the Omnisharp Log i see error popping up like:
Assets file 'C:\Users\user\Documents\Visual Studio 2017\Projects\project\obj\project.assets.json' doesn't have a target for '.NETFramework,Version=v4.5.2/win7-x86'. Ensure that restore has run and that you have included 'net452' in the TargetFrameworks for your project. You may also need to include 'win7-x86' in your project's RuntimeIdentifiers.
FYI im using target win7-x64, though i have it not in the csproj-file like:
Im specifying it when compiling like:
dotnet build project.csproj -r win7-x64
Vscode:
Version: 1.18.1
Architecture: x64
Dotnet --Info:
.NET Command Line Tools (2.0.3)
Product Information:
Version: 2.0.3
Commit SHA-1 hash: 12f0c7efcc
Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.3\
Microsoft .NET Core Shared Framework Host
Version : 2.0.3
Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df
Also before the problem occured i installed the latest .net core sdk 2.0.3
@marekw2143 : Could you provide your OmniSharp Log when loading your project in VS Code? To retrieve this, select View->Output from the VS Code menu and choose "OmniSharp Log" from the drop-down in the top-right corner of the Output pane.
@cwistedt : Given that you're on Windows, could you file a separate issue? The Windows and Linux implementations vary quite a bit, so the problem you're seeing is very likely different than what @marekw2143 has reported. Be sure to include your OmniSharp Log in the report.
@DustinCampbell : here is log:
Starting OmniSharp server at 11/29/2017, 6:37:12 PM
Target: /home/marek/Projects/mc2
OmniSharp server started wth Mono
Path: /home/marek/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/omnisharp/OmniSharp.exe
PID: 5168
System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
File name: 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at OmniSharp.CommandLineApplication+<>c__DisplayClass11_0.<OnExecute>b__0 () [0x0000b] in <7a616fcab0f646c0afc308a4788c7b30>:0
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute (System.String[] args) [0x0035b] in <e56ebbc3ed87488b8e26736bbadaa5d3>:0
at OmniSharp.CommandLineApplication.Execute (System.Collections.Generic.IEnumerable`1[T] args) [0x00042] in <7a616fcab0f646c0afc308a4788c7b30>:0
at OmniSharp.Stdio.Program+<>c__DisplayClass0_1.<Main>b__0 () [0x00028] in <7f7e432893274c6f9e1075f4a3b6ca8e>:0
at OmniSharp.HostHelpers.Start (System.Func`1[TResult] action) [0x0001c] in <7a616fcab0f646c0afc308a4788c7b30>:0
Thanks @marekw2143. What Linux distro/version are you running? Also, could you let me know what version of Mono you have installed?
@DustinCampbell : Here's output of "mono --version":
Mono JIT compiler version 5.2.0.215 (tarball Mon Aug 14 15:46:23 UTC 2017)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen (concurrent by default)
And I'm on lubuntu 16.04
A couple of suggestions:
mono-complete and msbuild packages.Try adding the following setting in VS Code:
"omnisharp.path": "/home/marek/.vscode/extensions/ms-vscode.csharp-1.13.1/.omnisharp/run"
Thanks @DustinCampbell . previously "omnisharp.path" was set to "null", after changing it code completion works. Maybe upgrade from VSCode 1.17 to 1.18 overriden changes.
Most helpful comment
A couple of suggestions:
mono-completeandmsbuildpackages.Try adding the following setting in VS Code: