FS#60903 - [dotnet-sdk][dotnet-host] OmniSharp does not work

Attached to Project: Community Packages
Opened by Mateusz Paluszkiewicz (TheAifam5) - Saturday, 24 November 2018, 16:05 GMT
Last edited by Maxime Gauduin (Alucryd) - Monday, 03 February 2020, 17:16 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:
OmniSharp could not find the 'Microsoft.NET.Sdk' thing.

Please add this two files to the package:

/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}

/etc/profile.d/dotnet.csh
setenv DOTNET_ROOT="/opt/dotnet"
setenv MSBuildSDKsPath="${DOTNET_ROOT}/sdk/$(${DOTNET_ROOT}/dotnet --version)/Sdks"
setenv PATH="${PATH}:${DOTNET_ROOT}"

Reproduce:
1. Install vscode
2. Install C# extension to vscode
3. Create new project (shared library) using dotnet command
4. Open the project using vscode
5. Open "OmniSharp Log".
This task depends upon

Closed by  Maxime Gauduin (Alucryd)
Monday, 03 February 2020, 17:16 GMT
Reason for closing:  Fixed
Additional comments about closing:  3.1.0.sdk100-2
Comment by Mateusz Paluszkiewicz (TheAifam5) - Saturday, 24 November 2018, 16:06 GMT
'MSBuildSDKsPath' I think should be only in "-sdk" package.
Comment by Alexandre Oliveira (Xinayder) - Friday, 15 March 2019, 23:44 GMT
I'd like to add that it still won't work with OmniSharp or any other IDE that supports .NET Core. I've just tried using it with Rider and it failed to compile a project that targets .NET Framework 4.0 and .NET Standard 2.0, saying it couldn't find the TargetFramework assemblies for .NET Framework 4.0. Installing msbuild-stable fixed the issue (Mono's msbuild).
Comment by Daniel Kozák (kozzi) - Tuesday, 23 July 2019, 12:50 GMT
issue is here: https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/dotnet-core&id=7ff28a9a3898b6aa168289eee1b68b676140ea01

When I remove /usr/bin/dotnet and make it symlink to /opt/dotnet/dotnet it seems works ok
Comment by David Velasco (davvelsan) - Thursday, 14 November 2019, 11:58 GMT
I second the solution proposed by Daniel Kozák (kozzi).

See this issue for various workarounds and an ongoing discussion on the topic: https://github.com/OmniSharp/omnisharp-roslyn/issues/1610
See this comment for the particular workaround (and others) presented by Daniel Kozák: https://github.com/OmniSharp/omnisharp-roslyn/issues/1610#issuecomment-535657086

Loading...