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.

Arch Linux: "The SDK 'Microsoft.Net.Sdk' specified could not be found."

See original GitHub issue

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   2.2.102
 Commit:    96ff75a873

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /opt/dotnet/sdk/2.2.102/

Host (useful for support):
  Version: 2.2.1
  Commit:  878dd11e62

.NET Core SDKs installed:
  2.2.102 [/opt/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.NETCore.App 2.2.1 [/opt/dotnet/shared/Microsoft.NETCore.App]

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

VS Code version:

1.30.2

C# Extension version:

1.17.1

Steps to reproduce

Create new console project using dotnet new console, open VSCode either via start menu or command line.

Expected behavior

Projects loads fine

Actual behavior

Omnisharp loads and displays the mentioned issue above.

Workaround

I found at least a workaround to fix this issue when opening VSCode via command line.
Unfortunately I haven’t yet found a way to solve it when starting via start menu.

Fix:

  • add environment variable MSBuildSDKsPath=/opt/dotnet/sdk/2.2.102/Sdks
  • open project file, replace <Project Sdk="Microsoft.Net.Sdk"> with <Project Sdk="Microsoft.NET.Sdk"> (uppercased Net)

I’m using Arch Linux with KDE, pretty clean/new system.
Used latest Ubuntu before, no problems at all.

Although the workaround works for now, I guess it will break everytime a different SDK version gets used.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
virtualdreamscommented, Feb 1, 2019

Create the file /etc/profile.d/dotnet.sh

export DOTNET_ROOT=/opt/dotnet
export MSBuildSDKsPath=$DOTNET_ROOT/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks
export PATH=${PATH}:${DOTNET_ROOT}

Found here: https://bugs.archlinux.org/task/60903?project=5&string=dotnet-host

0reactions
mwaqasazizcommented, Nov 19, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET - ArchWiki
NET (previously named .NET Core) is a FOSS software framework from Microsoft for C#, Visual Basic, and F#.
Read more >
MSBUILD throws error: The SDK 'Microsoft.NET.Sdk' specified ...
Sdk ' specified could not be found. The version of msbuild is the latest from microsoft visual studio 2017 tools. I'm using Windows...
Read more >
The SDK 'Microsoft.NET.Sdk.Web' specified could not be found
Web' specified could not be found. I was using asp.net core version 2.0.6 version and the application was running fine on that version...
Read more >
Install .NET Core SDK on Arch Linux using the Snap Store
It is open source and it can share the same code with .NET Framework and Xamarin apps.
Read more >
The SDK 'Microsoft.NET.Sdk' specified could not be found
The SDK 'Microsoft.NET.Sdk' specified could not be found ... I have Rider 2020.1 installed on Manjaro linux, using mono 6.4.0 installed using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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