Hi, sorry to be a pain I've been trying to work this out but don't know enough about the software! I expect this is something that I'm doing wrong.
dotnet --info output:
.NET Command Line Tools (2.0.2)
Product Information:
Version: 2.0.2
Commit SHA-1 hash: a04b4bf512
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.12
OS Platform: Darwin
RID: osx.10.12-x64
Base Path: /usr/local/share/dotnet/sdk/2.0.2/
Microsoft .NET Core Shared Framework Host
Version : 2.0.0
Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d
VS Code version: 1.17.2 (1.17.2)
C# Extension version: 1.13.0
global.json:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "2.0.0"
}
}
and I also tried..
global.json:
{
"projects": [ "src", "test" ],
"sdk": {
"version": "2.0.2"
}
}
I don't know what the Output is normally but I guess vscode c# extension starts up as usual and omnisharp kicks in.
Stack trace from vscode Output below:
Starting OmniSharp server at 2017-11-8 07:36:17
Target: /Users/TGP/Documents/git/Ocelot/Ocelot.sln
OmniSharp server started wth Mono
Path: /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/run
PID: 48934
锘縖info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
MSBuildExtensionsPath = /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild
CscToolPath = /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin
TargetFrameworkRootPath = /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/TGP/Documents/git/Ocelot'.
[info]: OmniSharp.Cake.CakeProjectSystem
Found 1 Cake files.
[warn]: OmniSharp.Cake.CakeProjectSystem
Cake script service not connected. Aborting.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /Users/TGP/Documents/git/Ocelot
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in '/Users/TGP/Documents/git/Ocelot/Ocelot.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj
The specified SDK version [2.0.0] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file '/Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj'.
/Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00042] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, System.Boolean throwOnFileNotExistsError) [0x00198] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000c8] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x000df] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution sdkResolution) [0x00016] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary () [0x00007] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x000e9] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0009c] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.LoadProject (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics, System.Collections.Immutable.ImmutableArray`1[System.String]& targetFrameworks) [0x0004b] in <4334175a8f8f4b01b5db9f56f106c232>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics) [0x0000a] in <4334175a8f8f4b01b5db9f56f106c232>:0
at OmniSharp.MSBuild.MSBuildProjectSystem.LoadProject (System.String projectFilePath) [0x00038] in <4334175a8f8f4b01b5db9f56f106c232>:0
The error that you're getting still indicates that the global.json says 2.0.0:
The specified SDK version [2.0.0] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK
Could you change that global.json to specify 2.0.2, save it, restart VS Code, and let me know what the OmniSharp Log reads in that case?
Edit: Thanks for the help!
I updated the issue to show I already tried that :( unfortunately it did not fix the issue. I've just tried again (madness / don't trust myself) and getting:
Starting OmniSharp server at 2017-11-8 08:59:04
Target: /Users/TGP/Documents/git/Ocelot/Ocelot.sln
OmniSharp server started wth Mono
Path: /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/run
PID: 49920
锘縖info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 15.0 - "/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 15.0 - "/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
MSBuildExtensionsPath = /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild
CscToolPath = /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
MSBuildToolsPath = /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin
TargetFrameworkRootPath = /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/TGP/Documents/git/Ocelot'.
[info]: OmniSharp.Cake.CakeProjectSystem
Found 1 Cake files.
[warn]: OmniSharp.Cake.CakeProjectSystem
Cake script service not connected. Aborting.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /Users/TGP/Documents/git/Ocelot
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in '/Users/TGP/Documents/git/Ocelot/Ocelot.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
Failed to load project file '/Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj'.
/Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. /Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00042] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, System.Boolean throwOnFileNotExistsError) [0x00198] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000c8] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x000df] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution sdkResolution) [0x00016] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary () [0x00007] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x000e9] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0009c] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.LoadProject (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics, System.Collections.Immutable.ImmutableArray`1[System.String]& targetFrameworks) [0x0004b] in <4334175a8f8f4b01b5db9f56f106c232>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Create (System.String filePath, System.String solutionDirectory, Microsoft.Extensions.Logging.ILogger logger, OmniSharp.MSBuild.Discovery.MSBuildInstance msbuildInstance, OmniSharp.Options.MSBuildOptions options, System.Collections.Generic.ICollection`1[T] diagnostics) [0x0000a] in <4334175a8f8f4b01b5db9f56f106c232>:0
at OmniSharp.MSBuild.MSBuildProjectSystem.LoadProject (System.String projectFilePath) [0x00038] in <4334175a8f8f4b01b5db9f56f106c232>:0
It looks like it just isn't finding any SDK I guess. Very strange!
That is strange. I would expect the SdkResolver installed with OmniSharp to locate the SDK you have installed, especially if it's on the path.
Could you try updating the version of Mono you have installed? 4.8.0 is a bit old and installing a recent version will cause OmniSharp to use the MSBuild installed with Mono.
Yep that has fixed it..still saying it can't find the SDK but omnisharp seems to be working as usual.
Starting OmniSharp server at 2017-11-8 09:51:53
Target: /Users/TGP/Documents/git/Ocelot/Ocelot.sln
OmniSharp server started wth Mono
Path: /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/OmniSharp.exe
PID: 50646
锘縖info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
2: StandAlone 15.0 - "/Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
CscToolPath = /Users/TGP/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/TGP/Documents/git/Ocelot'.
[info]: OmniSharp.Cake.CakeProjectSystem
Found 1 Cake files.
[warn]: OmniSharp.Cake.CakeProjectSystem
Cake script service not connected. Aborting.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /Users/TGP/Documents/git/Ocelot
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in '/Users/TGP/Documents/git/Ocelot/Ocelot.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/src/Ocelot/Ocelot.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/TGP/Documents/git/Ocelot/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
The specified SDK version [2.0.2] from global.json [/Users/TGP/Documents/git/Ocelot/global.json] not found; install specified SDK version
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.UnitTests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.AcceptanceTests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.ManualTest
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.Benchmarks
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.IntegrationTests
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/TGP/Documents/git/Ocelot'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.Stdio.Program
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Program
Configuration finished.
[info]: OmniSharp.Stdio.Program
Omnisharp server running using Stdio at location '/Users/TGP/Documents/git/Ocelot' on host 50627.
Those SDK messages are really weird. I assume "dotnet" is on your path?
Yes it is...very weird :(
Do you see those same The specified SDK version [2.0.2] from global.json not found; install specified SDK version messages if you run the following at the command-line? MSBuild is included with Mono these days, so I'd expect it to build.
> msbuild /Users/TGP/Documents/git/Ocelot/Ocelot.sln
@nguerrera, @livarcocc: Have you seen anything like this? We're getting these specified SDK version [2.0.2] from global.json not found from both the SdkResolvers included in OmniSharp and the ones included with Mono. However, according to the top of this issue, .NET Core SDK is certainly installed and on the path. Do you have any ideas of what might cause this or how we could debug the issue?
I get the same thing running that command but the solution does build. I'm using this to try and log the output
msbuild /Users/TGP/Documents/git/Ocelot/Ocelot.sln /fileLogger /fileLoggerParameters:LogFile=MyLog.log;Append;Verbosity=diagnostic;Encoding=UTF-8
For some reason I can see the SDK text in the console but it doesn't appear in MyLog.log so I can't send you an example that shows it.
FYI, I have the same issue on a Windows environment. Used to work on the same machine a couple of days ago.
Thanks @TomPallister : that verifies my suspicion. Out of curiosity have you done anything different with your .NET Core SDK installation? I'm trying to figure out if there's anything I'll need to do on my macOS to replicate the issue. I assume https://github.com/TomPallister/Ocelot is the project to use?
@yreynhout : Is it truly the same issue? Do you have a global.json file that specifies an SDK version that you have installed on your machine? Because you're on Windows, my suspicion is that the issue may be different.
@DustinCampbell I haven't done anything different to my knowledge...I am an idiot tho :(
@TomPallister : I just tried the following steps and could not replicate the SDK message. Here's what I did:
First, I removed all of the .NET Core SDKs from my system.
> sudo rm -rf /usr/local/share/dotnet/`
Next, I downloaded .NET Core SDK 2.0.2 from https://www.microsoft.com/net/download/macos and ran the installer. I verified that I have just .NET Core SDK 2.0.2 on the system.
> ls -al /usr/local/share/dotnet/sdk/
drwxr-xr-x 4 root wheel 128 Nov 8 08:22 .
drwxr-xr-x 10 root wheel 320 Nov 8 08:22 ..
drwxr-xr-x 119 root wheel 3808 Sep 27 18:13 2.0.2
drwxr-xr-x 336 root wheel 10752 Nov 8 08:22 NuGetFallbackFolder
Next, I cloned the Ocelot project.
> git clone https://github.com/TomPallister/Ocelot
> cd Ocelot
Next, I double-checked that the global.json specifies SDK version 2.0.0 (not 2.0.2):
> cat global.json
{
"projects": [ "src", "test" ],
"sdk": {
"version": "2.0.0"
}
I tried building Ocelot with the build.sh script but got a fail when Cake compiled the script.
> ./build.sh
Downloading NuGet...
Feeds used:
/Users/dustincampbell/.nuget/packages/
https://api.nuget.org/v3/index.json
Restoring NuGet package Cake.0.23.0.
Adding package 'Cake.0.23.0' to folder '/Users/dustincampbell/projects/Ocelot/tools'
Added package 'Cake.0.23.0' to folder '/Users/dustincampbell/projects/Ocelot/tools'
Analyzing build script...
Processing build script...
Installing tools...
Installing addins...
Compiling build script...
Error: Error occurred when compiling build script: /Users/dustincampbell/projects/Ocelot/build.cake(417,25): error CS0012: The type 'Dictionary<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
Since I got an error with the build script, I went ahead and restored and build with the SDK.
> dotnet restore
> dotnet build
Both of those operations succeeded, so I went ahead and opened the project in VS Code:
> code .
Everything appears to have loaded successfully:
Starting OmniSharp server at 11/8/2017, 8:27:34 AM
Target: /Users/dustincampbell/projects/Ocelot/Ocelot.sln
OmniSharp server started wth Mono
Path: /Users/dustincampbell/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/OmniSharp.exe
PID: 2006
锘縖info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
2: StandAlone 15.0 - "/Users/dustincampbell/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Mono 15.0 - "/Library/Frameworks/Mono.framework/Versions/5.4.0/lib/mono/msbuild/15.0/bin"
CscToolPath = /Users/dustincampbell/.vscode/extensions/ms-vscode.csharp-1.13.0/.omnisharp/omnisharp/msbuild/15.0/Bin/Roslyn
CscToolExe = csc.exe
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/dustincampbell/projects/Ocelot'.
[info]: OmniSharp.Cake.CakeProjectSystem
Found 1 Cake files.
[warn]: OmniSharp.Cake.CakeProjectSystem
Cake script service not connected. Aborting.
[info]: OmniSharp.DotNet.DotNetProjectSystem
Initializing in /Users/dustincampbell/projects/Ocelot
[info]: OmniSharp.DotNet.DotNetProjectSystem
Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
Resolving projects references
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Detecting projects in '/Users/dustincampbell/projects/Ocelot/Ocelot.sln'.
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/src/Ocelot/Ocelot.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/test/Ocelot.UnitTests/Ocelot.UnitTests.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/test/Ocelot.AcceptanceTests/Ocelot.AcceptanceTests.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/test/Ocelot.ManualTest/Ocelot.ManualTest.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/test/Ocelot.Benchmarks/Ocelot.Benchmarks.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Loading project: /Users/dustincampbell/projects/Ocelot/test/Ocelot.IntegrationTests/Ocelot.IntegrationTests.csproj
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.UnitTests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.AcceptanceTests
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.ManualTest
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.Benchmarks
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
Update project: Ocelot.IntegrationTests
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/dustincampbell/projects/Ocelot'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.Stdio.Program
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Program
Configuration finished.
[info]: OmniSharp.Stdio.Program
Omnisharp server running using Stdio at location '/Users/dustincampbell/projects/Ocelot' on host 1971.
@DustinCampbell I did specify a global.json after observing the issue but doesn't solve it. Oddly, on my Ubuntu environment 1.13.0 is running just fine. I'll post the windows error log tomorrow and try some of the above.
thanks!
@DustinCampbell I will give your instructions a try and see what happens thanks!
@TomPallister : If you still see the SDK issue, try the following at a command prompt:
> set COREHOST_TRACE=1
> code .
This should enable a bunch of diagnostic spew in the OmniSharp Log as it tries to resolve you .NET Core SDK. This might provide some insight.
@yreynhout I've got a similar issue on my Windows environment. I also had Visual Studio 2017 installed while primarily using Visual Studio Code for my .NET core project, but updating Visual Studio solved my issues with the C# extension. Just saying, in case you might have a similar setup.
A workaround while this issue is being fixed:
code --install-extension csharp-1.11.0.vsix (Install from a VSIX section{"extensions.autoUpdate": true} to {"extensions.autoUpdate": false}(https://github.com/Microsoft/vscode/issues/9367)@cboutiette : FWIW, v1.11.0 is not the last stable version. The last stable release should be https://github.com/OmniSharp/omnisharp-vscode/releases/tag/v1.12.1.
Additionally, rolling back to an earlier C# for VS Code may break certain C# features with VS Code 1.18. For example, unit test debugging will likely be broken due to an API break that was introduced in VS Code 1.18 which C# for VS Code 1.13 addresses.
@DustinCampbell Upon testing everything seemed to work for me as it did prior to the update. I haven't tried version 1.12.1 but I am sure it will work the same.
Honestly, as a developer who prefers vscode over visual studio this is more of a temporary fix and not a permanent one.
So do at your own risk. Bottom line is it kept me chugging along and maybe it could help some others.
My VSCode version is 1.18 in case anyone is wondering as well.
Edited: updated this with a newer release of OmniSharp that will work with C# for VS 1.13.
Another potential workaround that would allow you to stay on C# for VS 1.13 until the next version comes out would be to use a newer version of OmniSharp which fixes already contains a fix for the issue.
chmod 755 the run and mono.* files within the folder you decompressed to.In VS Code, set the following options:
"omnisharp.path": "<the-path-you-just-decompressed-to>/OmniSharp.exe"
"omnisharp.path": "<the-path-you-just-decompressed-to>/run"
"omnisharp.path": "<the-path-you-just-decompressed-to>/.omnisharp/OmniSharp.exe"
"omnisharp.useMono": true
@DustinCampbell all seems OK after removing old versions of .net core! Thanks for the help.