question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem after update to .NET SDK 2.2.202-1

See original GitHub issue

Issue Description

Running into error after updating .NET SDK to 2.2.202-1 via Update Manager in Linux Mint 19.1.

Steps to Reproduce

From command line enter “dotnet new webapi -o TodoApi3”, then “cd TodoApi3”, then “code .” to open project in VS Code.

Expected Behavior

Message in VS Code asking if I want to add required assets to project.

Actual Behavior

Message: “Some projects have trouble loading. Please review the output for more details. Source: C# (Extension)”

It appears that the .vscode directory doesn’t get created, along with files launch.json and tasks.json. Workaround is to manually copy those from a prior project and fix the content of the two files to match the project name.

Logs

OmniSharp log

Starting OmniSharp server at 4/4/2019, 4:04:54 PM Target: /home/bob/projects/TodoApi3

OmniSharp server started. Path: /home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/run PID: 9615

    Starting OmniSharp on linuxmint 19.1 (x64)
    DotNetPath set to dotnet
    Located 1 MSBuild instance(s)
        1: StandAlone 15.0 - "/home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin"
    MSBUILD_EXE_PATH environment variable set to '/home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
    Registered MSBuild instance: StandAlone 15.0 - "/home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin"
        MSBuildExtensionsPath = /home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild
        BypassFrameworkInstallChecks = true
        CscToolPath = /home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin/Roslyn
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/bob/.vscode/extensions/ms-vscode.csharp-1.18.0/.omnisharp/1.32.11/omnisharp/msbuild/15.0/Bin
    Detecting Cake files in '/home/bob/projects/TodoApi3'.
    Could not find any Cake files
    Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
    No solution files found in '/home/bob/projects/TodoApi3'
    Queue project update for '/home/bob/projects/TodoApi3/TodoApi3.csproj'
    Detecting CSX files in '/home/bob/projects/TodoApi3'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
    Configuration finished.
    Omnisharp server running using Stdio at location '/home/bob/projects/TodoApi3' on host 9534.
    Loading project: /home/bob/projects/TodoApi3/TodoApi3.csproj
    Failed to load project file '/home/bob/projects/TodoApi3/TodoApi3.csproj'.

/home/bob/projects/TodoApi3/TodoApi3.csproj(1,1) Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK ‘Microsoft.NET.Sdk.Web’ specified could not be found. /home/bob/projects/TodoApi3/TodoApi3.csproj at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <2338fdb301034c1d9c6b95e564d514b0>: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 <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>: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, System.Boolean throwOnFileNotExistsError) [0x00254] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0000d] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000e6] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Evaluator4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x00103] in <2338fdb301034c1d9c6b95e564d514b0>: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.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution.ISdkResolverService sdkResolverService, System.Int32 submissionId, Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x0001a] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.Evaluation.Context.EvaluationContext evaluationContext) [0x00023] in <2338fdb301034c1d9c6b95e564d514b0>: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 <2338fdb301034c1d9c6b95e564d514b0>: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) [0x0009e] in <2338fdb301034c1d9c6b95e564d514b0>: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 <2338fdb301034c1d9c6b95e564d514b0>: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 <2338fdb301034c1d9c6b95e564d514b0>: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 <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <2338fdb301034c1d9c6b95e564d514b0>:0 at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <2338fdb301034c1d9c6b95e564d514b0>:0 at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003f] in <c28baf123c0744eeb7042fb581dc5633>:0 at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <c28baf123c0744eeb7042fb581dc5633>:0 at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectLoader loader) [0x00015] in <c28baf123c0744eeb7042fb581dc5633>:0 at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass28_0.<LoadProject>b__0 () [0x00000] in <c28baf123c0744eeb7042fb581dc5633>: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 <c28baf123c0744eeb7042fb581dc5633>:0

    Attempted to update project that is not loaded: /home/bob/projects/TodoApi3/TodoApi3.csproj

C# log

(nothing)

Environment information

VSCode version: 1.32.3 C# Extension: 1.18.0

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.202 Commit: 8a7ff6789d

Runtime Environment: OS Name: linuxmint OS Version: 19.1 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.2.202/

Host (useful for support): Version: 2.2.3 Commit: 6b8ad509b6

.NET Core SDKs installed: 2.1.602 [/usr/share/dotnet/sdk] 2.2.202 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [/usr/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
Angular2 johnpapa 7.0.1
angular2-switcher infinity1207 0.2.0
auto-rename-tag formulahendry 0.0.15
chilly-vscode-dark-theme ZachTRice 0.1.5
csharp ms-vscode 1.18.0
csharpextensions jchannon 1.3.0
debugger-for-chrome msjsdiag 4.11.3
material-icon-theme PKief 3.7.0
ng-template Angular 0.1.11
path-intellisense christian-kohler 1.4.2
Theme-Oblivion gerane 0.0.2
vscode-angular2-files alexiv 1.6.2
vscode-nuget-package-manager jmrog 1.1.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:31 (4 by maintainers)

github_iconTop GitHub Comments

11reactions
leawpcommented, Apr 5, 2019

For anyone trying to fix this quickly:

$ apt-cache policy dotnet-sdk-2.2 

dotnet-sdk-2.2:
  Installed: 2.2.202-1
  Candidate: 2.2.202-1
  Version table:
... 

which is followed by the list of versions

$ sudo apt install dotnet-sdk-2.2=<your version of choice> for me it was

$ sudo apt install dotnet-sdk-2.2=2.2.105-1

and confirm the downgrade

9reactions
Bob1904commented, Apr 15, 2019

@rchande @akshita31 Thank you for your work on this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NETSDK1141: Unable to resolve the .NET SDK version as ...
Learn about .NET SDK error NETSDK1141, which occurs when the SDK version could not be resolved in global.json.
Read more >
NET Core 2.2 Can't be Selected In Visual Studio Build ...
NET Core project, but after the latest visual studio updates I haven't been able to. Framework Selection. Things I've tried: Repairing the .NET...
Read more >
The current .NET SDK does not support targeting .NET Core ...
I have created an empty ASP.net core 2.2 project and tried to install OrchardCore.Application.Cms.Targets from “Manage Nuget packages from Solution”. After a ...
Read more >
Microsoft Security Advisory CVE-2021-26701 | .NET Core ...
To fix the issue, please install the latest version of .NET 5.0, .NET Core 3.1 or .NET Core 2.1. ... Once you have...
Read more >
Solution to Visual Studio 2022 messing up Visual Studio 2019
The error shown when attempting to load the projects was: The project file cannot be opened. Unable to locate the .NET SDK.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found