You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Opening a C# file in a C# Project yields the following error in OmniSharp.
Target: d:\dev\Visual Studio\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.sln
OmniSharp server started
Path: C:\Users\blakeb\.vscode\extensions\ms-vscode.csharp-1.7.0\bin\omnisharp\OmniSharp.exe
PID: 2408
OmniSharp: -s d:\dev\Visual Studio\ConsoleApplication1\ConsoleApplication1\ConsoleApplication1.sln --hostPID 6592 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
[info]: OmniSharp.Startup
Omnisharp server running using Stdio at location 'd:\dev\Visual Studio\ConsoleApplication1\ConsoleApplication1' on host 6592.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in d:\dev\Visual Studio\ConsoleApplication1\ConsoleApplication1
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[fail]: OmniSharp.Startup
The project system 'MSBuildProjectSystem' threw exception during initialization.
Failed to convert 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319' to type 'OmniSharp.Options.MSBuildOptions'.
at Microsoft.Extensions.Configuration.ConfigurationBinder.ConvertValue(Type type, String value)
at Microsoft.Extensions.Configuration.ConfigurationBinder.Bind(IConfiguration configuration, Object instance)
at OmniSharp.MSBuild.MSBuildProjectSystem.Initalize(IConfiguration configuration) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\MSBuildProjectSystem.cs:line 80
at OmniSharp.Startup.Configure(IApplicationBuilder app, IServiceProvider serviceProvider, ILoggerFactory loggerFactory, ISharedTextWriter writer, IAssemblyLoader loader, IOptions`1 optionsAccessor) in C:\projects\omnisharp-roslyn\src\OmniSharp.Host\Startup.cs:line 184
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'd:\dev\Visual Studio\ConsoleApplication1\ConsoleApplication1'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.Startup
Configuration finished.
Environment data
dotnet --info output:
Product Information:
Version: 1.0.0-preview2-1-003177
Commit SHA-1 hash: a2df9c2576
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
VS Code version: 1.9.1
C# Extension version: 1.7.0
Steps to reproduce
Get a fresh install of Visual Studio Code 1.9.1 by uninstalling, deleting .vscode directory and Code directory from AppData/Roaming
Install DotNet CLI Preview 2.1
Install Visual Studio Code 1.9.1
Run Visual Studio Code
Install C# Extension via Extensions pane, reloading when prompted
Open a blank C# project with at least one C# code file in it in Visual Studio Code (I used Visual Studio 2010)
Open a C# code file in Visual Studio Code
Open OmniSharp Log
Expected behavior
OmniSharp starts correctly when a project solution is correctly opened. Intellisense and other features such as Find All References work as expected.
Actual behavior
OmniSharp appears to error out during MSBuildProjectSystem initialization, despite not having MSBuild set as the project build tool in tasks.json. Intellisense features are unavailable, and Find All References does not work.
Notes
I tried this in multiple project files, a couple of them being Unity projects, one of them being a blank Visual Studio 2010 project.
I have done the following to try to fix this issue:
Here is my PATH variable: C:\Users\blakeb\AppData\Local\Microsoft\WindowsApps;C:\Python27;C:\Python27\Scripts;C:\android-sdk\platform-tools;C:\android-sdk\tools;C:\Program Files (x86)\Microsoft VS Code\bin
I recognize that this may be fully dependent on my local setup, and was hoping to get any insight as to why this might be the case.
Also note that C:\projects\omnisharp-roslyn\src\ does not exist on my machine, though it appears to be referenced in the error log. I don't know if that's relevant, my guess is it isn't.
The text was updated successfully, but these errors were encountered:
Hi, sorry you're having trouble getting things working. Could you provide the project that you created in VS 2010?
A few quick points:
There's no need to set "omnisharp.useMono" -- that won't have any affect.
C:\projects\omnisharp-roslyn\src is likely unrelated. That's simply the source file listed in the exception call stack coming from OmniSharp.
Do you have an omnisharp.json file in your project? It's unlikely but I thought I'd check.
Do you happen to have an environment variable defined named "MSBuild"? It's entirely possible that a previously defined environment variable is getting confused as part of OmniSharp's configuration.
Do you happen to have an environment variable defined named "MSBuild"? It's entirely possible that a previously defined environment variable is getting confused as part of OmniSharp's configuration.
That was the issue. Well that's embarrassing. I had removed it from the PATH but I forgot that it was still an environment variable. Thanks!
Opening a C# file in a C# Project yields the following error in OmniSharp.
Environment data
dotnet --info
output:VS Code version: 1.9.1
C# Extension version: 1.7.0
Steps to reproduce
Expected behavior
OmniSharp starts correctly when a project solution is correctly opened. Intellisense and other features such as Find All References work as expected.
Actual behavior
OmniSharp appears to error out during MSBuildProjectSystem initialization, despite not having MSBuild set as the project build tool in tasks.json. Intellisense features are unavailable, and Find All References does not work.
Notes
I tried this in multiple project files, a couple of them being Unity projects, one of them being a blank Visual Studio 2010 project.
I have done the following to try to fix this issue:
Here is my PATH variable:
C:\Users\blakeb\AppData\Local\Microsoft\WindowsApps;C:\Python27;C:\Python27\Scripts;C:\android-sdk\platform-tools;C:\android-sdk\tools;C:\Program Files (x86)\Microsoft VS Code\bin
System PATH:
C:\ProgramData\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Perforce;C:\Program Files\Perforce\DVCS\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\dotnet\
I recognize that this may be fully dependent on my local setup, and was hoping to get any insight as to why this might be the case.
Also note that
C:\projects\omnisharp-roslyn\src\
does not exist on my machine, though it appears to be referenced in the error log. I don't know if that's relevant, my guess is it isn't.The text was updated successfully, but these errors were encountered: