Skip to content

.NET Core SDK cannot be located #3505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
FinleyMcIlwaine opened this issue Jan 11, 2020 · 6 comments
Closed

.NET Core SDK cannot be located #3505

FinleyMcIlwaine opened this issue Jan 11, 2020 · 6 comments

Comments

@FinleyMcIlwaine
Copy link

FinleyMcIlwaine commented Jan 11, 2020

Issue Description

I installed the .NET Core 3.1.0 SDK, tried to add this extension to VSCode and got the following popup:
46F9F9AB-EF0C-4DC8-B18A-0532E2DDEDF2_4_5005_c

I'm quite sure I've installed everything correctly. After messing with this for long enough, I tried uninstalling all SDKs and runtimes on my machine following the steps listed here. Reinstalled SDK 3.1.0 and the issue persisted.

Steps to Reproduce

Not quite sure how this could be reproduced since it seems like a rare problem! I did have VS Community installed on my machine when the issue first occurred, but I've since uninstalled it and all of the associated SDKs but the issue is still happening.

Expected Behavior

For the extension to be able to find the SDK, since I can run all dotnet commands from my terminal just fine.

Actual Behavior

It can't find it.

Logs

OmniSharp log

Starting OmniSharp server at 1/11/2020, 12:55:00 PM Target: /Users/finley/dev/dotnet/DatingApp/DatingApp.API

OmniSharp server started.
Path: /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/run
PID: 3072

Starting OmniSharp on MacOS 10.15.2 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.3 - "/Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.3 - "/Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin
CscToolPath = /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/finley/dev/dotnet/DatingApp/DatingApp.API'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/Users/finley/dev/dotnet/DatingApp/DatingApp.API'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/finley/dev/dotnet/DatingApp/DatingApp.API'.
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.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/finley/dev/dotnet/DatingApp/DatingApp.API' on host 2959.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
It was not possible to find any installed .NET Core SDKs
Did you mean to run .NET Core SDK commands? Install a .NET Core SDK from:
https://aka.ms/dotnet-download
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'.
/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. /Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <10b73e4bf233421cae439ef765e97ef0>: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 <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List1[Microsoft.Build.Construction.ProjectRootElement]& projects, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult, System.Boolean throwOnFileNotExistsError) [0x00254] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, Microsoft.Build.BackEnd.SdkResolution.SdkResult& sdkResult) [0x00027] in <10b73e4bf233421cae439ef765e97ef0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <10b73e4bf233421cae439ef765e97ef0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x0011c] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCacheBase projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext, System.Boolean interactive) [0x0002f] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0005e] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00035] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00007] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00126] in <10b73e4bf233421cae439ef765e97ef0>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00093] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0 at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f7] in <10b73e4bf233421cae439ef765e97ef0>:0
at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <10b73e4bf233421cae439ef765e97ef0>:0
at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <21e2225264e848eb88f797c7e4a5cc78>:0
at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <21e2225264e848eb88f797c7e4a5cc78>:0
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectIdInfo projectIdInfo, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <21e2225264e848eb88f797c7e4a5cc78>:0
at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass29_0.b__0 () [0x00000] in <21e2225264e848eb88f797c7e4a5cc78>:0
at (wrapper delegate-invoke) System.Func1[System.ValueTuple3[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic],OmniSharp.MSBuild.Notification.ProjectLoadedEventArgs]].invoke_TResult() at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func1[TResult] loader) [0x0001b] in <21e2225264e848eb88f797c7e4a5cc78>:0

Attempted to update project that is not loaded: /Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj

C# log

Installing C# dependencies... Platform: darwin, x86_64

Downloading package 'OmniSharp for OSX' (44721 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package 'OmniSharp for OSX'

Downloading package '.NET Core Debugger (macOS / x64)' (51272 KB).................... Done!
Validating download...
Integrity Check succeeded.
Installing package '.NET Core Debugger (macOS / x64)'

Downloading package 'Razor Language Server (macOS / x64)' (50263 KB).................... Done!
Installing package 'Razor Language Server (macOS / x64)'

Finished

Failed to spawn 'dotnet --info'

Environment information

VSCode version: 1.41.1
C# Extension: 1.21.9

Mono Information OmniSharp using built-in mono
Dotnet Information A valid dotnet installation could not be found.
Visual Studio Code Extensions
Extension Author Version
code-gnu-global austin 0.2.2
cpptools ms-vscode 0.26.3-insiders3
csharp ms-vscode 1.21.9
ng-template Angular 0.900.4

My dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.1.100
 Commit:    cd82f021f4

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.100/

Host (useful for support):
  Version: 3.1.0
  Commit:  65f04fb6db

.NET Core SDKs installed:
  3.1.100 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download
@FinleyMcIlwaine
Copy link
Author

FinleyMcIlwaine commented Jan 13, 2020

After some further investigation, this appears to be an issue with VSCode's permissions on my machine mixed with this extension's expectations for permissions. When I open VSCode with sudo, the extension is allowed to run dotnet --info and thus sees the SDKs, but some access errors still occur. See the issue output in the C# logs below (also note that it picked up the SDKs this time):

OmniSharp log

Starting OmniSharp server at 1/12/2020, 5:02:04 PM Target: /Users/finley/dev/dotnet/DatingApp

OmniSharp server started with Mono 6.6.0.
Path: /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/OmniSharp.exe
PID: 11623

Starting OmniSharp on MacOS 10.15.2 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 2 MSBuild instance(s)
1: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
2: StandAlone 16.3 - "/Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
CscToolExe = csc.exe
CscToolPath = /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/Roslyn
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/Users/finley/dev/dotnet/DatingApp'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/Users/finley/dev/dotnet/DatingApp'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/Users/finley/dev/dotnet/DatingApp'.
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.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/Users/finley/dev/dotnet/DatingApp' on host 11607.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
Could not read state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path "/Users/finley/dev/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache" is denied.
[warn]: OmniSharp.MSBuild.ProjectLoader
Could not write state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache' is denied.
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'.
/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2126,5): Error: Could not read state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path "/Users/finley/dev/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache" is denied.
/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2126,5): Error: Could not write state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache' is denied.

Adding project '/Users/finley/dev/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: DatingApp.API

C# log

no output

Environment information

VSCode version: 1.41.1
C# Extension: 1.21.9

Mono Information OmniSharp using global mono :6.6.0
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.100 Commit: cd82f021f4

Runtime Environment:
OS Name: Mac OS X
OS Version: 10.15
OS Platform: Darwin
RID: osx.10.15-x64
Base Path: /usr/local/share/dotnet/sdk/3.1.100/

Host (useful for support):
Version: 3.1.0
Commit: 65f04fb6db

.NET Core SDKs installed:
3.1.100 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
code-gnu-global austin 0.2.2
cpptools ms-vscode 0.26.3-insiders3
csharp ms-vscode 1.21.9
ng-template Angular 0.900.4

@gregg-miskelly
Copy link
Contributor

This isn't actually an issue with this extension. What is probably going on is that VS Code isn't able to scrape the PATH from your shell. I suspect it works from sudo because sudo already has the PATH set correctly -- it would probably also worked if you launched VS Code from bash (or whatever your builtin shell is).

If you find it also works when launched from bash, but you want it to work from the normal shortcut, I believe this is the code that VS Code uses if you want to try and debug what is going wrong: https://github.com/microsoft/vscode/blob/ab10e26096a5494b68bc709a405a0dddeb227e0b/src/vs/code/node/shellEnv.ts#L13

@FinleyMcIlwaine
Copy link
Author

FinleyMcIlwaine commented Jan 14, 2020

Thanks for your help with this! You're right, it can see my path if I use my builtin terminal! For some reason just not with zsh, which is an issue for another day.

But, even when it can see my path, I get OmniSharp errors about being denied access to paths:

Starting OmniSharp server at 1/13/2020, 5:44:18 PM
    Target: /Users/finley/dev/courses/dotnet/DatingApp

OmniSharp server started with Mono 6.6.0.
    Path: /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/OmniSharp.exe
    PID: 15000

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.15.2 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
            2: StandAlone 16.3 - "/Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
            CscToolExe = csc.exe
            CscToolPath = /Users/finley/.vscode/extensions/ms-vscode.csharp-1.21.9/.omnisharp/1.34.9/omnisharp/.msbuild/Current/Bin/Roslyn
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/finley/dev/courses/dotnet/DatingApp'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/Users/finley/dev/courses/dotnet/DatingApp'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/finley/dev/courses/dotnet/DatingApp'.
[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.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/finley/dev/courses/dotnet/DatingApp' on host 14983.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
        Could not read state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path "/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache" is denied.
[warn]: OmniSharp.MSBuild.ProjectLoader
        Could not write state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path '/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache' is denied.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'.
/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj
/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2126,5): Error: Could not read state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path "/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache" is denied.
/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin/Microsoft.Common.CurrentVersion.targets(2126,5): Error: Could not write state file "obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache". Access to the path '/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/obj/Debug/netcoreapp3.1/DatingApp.API.csprojAssemblyReference.cache' is denied.

[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/finley/dev/courses/dotnet/DatingApp/DatingApp.API/DatingApp.API.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: DatingApp.API

Could this be fixed by changing where extensions are stored on my machine?

@JoeRobich
Copy link
Member

I get OmniSharp errors about being denied access to paths

@FinleyMcIlwaine Assuming you ran as root previously and are no longer running as root. You probably just need to delete your /bin and /obj folders so they will no longer be owned by root.

@FinleyMcIlwaine
Copy link
Author

Spot on @JoeRobich, thank you guys! All is working now.

@irvanherz
Copy link

irvanherz commented Apr 13, 2023

For me, in linux system, moving these variables from .bashrc to /etc/profile can solve the problem.

export DOTNET_ROOT=$HOME/.dotnet
export PATH=$PATH:$HOME/.dotnet:$HOME/.dotnet/tools

It looks like vscode doesn't load variables from .bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants