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

Failed to load project with Red Hat .NET Core SDK 2.0 (rh-dotnetcore20) #1744

Open
tanaka-takayoshi opened this Issue Aug 31, 2017 · 11 comments

Comments

Projects
None yet
7 participants
@tanaka-takayoshi
Contributor

tanaka-takayoshi commented Aug 31, 2017

Environment data

dotnet --info output:

$ dotnet --info
.NET Command Line Tools (2.0.0)

Product Information:
 Version:            2.0.0
 Commit SHA-1 hash:  cdcd1928c9

Runtime Environment:
 OS Name:     rhel
 OS Version:  7
 OS Platform: Linux
 RID:         rhel.7-x64
 Base Path:   /opt/rh/rh-dotnet20/root/usr/lib64/dotnet/sdk/2.0.0/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.0
  Build    : N/A

VS Code version: 1.15.1
C# Extension version: 1.12.1

Steps to reproduce

  1. Install Red Hat .NET Core SDK 2.0 on RHEL 7.3 Server
    https://access.redhat.com/documentation/en-us/net_core/2.0/html/getting_started_guide/gs_install_dotnet#install_dotnet20

  2. Create a Project.
    $ dotnet new console

  3. Open with Visual Studio Code
    $ code .

Expected behavior

Load C# project without error.

Actual behavior

Got the error.

Starting OmniSharp server at 2017/8/31 21:57:50
    Target: /home/tatanaka/omnisharpdebug

OmniSharp server started wth Mono
    Path: /home/tatanaka/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/run
    PID: 20538

OmniSharp: -s /home/tatanaka/omnisharpdebug --hostPID 20349 --stdio DotNet:enablePackageRestore=false --encoding utf-8 --loglevel information formattingOptions:useTabs=false formattingOptions:tabSize=4 formattingOptions:indentationSize=4
{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.Startup","Message":"Omnisharp server running using Stdio at location '/home/tatanaka/omnisharpdebug' on host 20349."},"Seq":1,"Type":"event"}
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /home/tatanaka/omnisharpdebug
[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
        Omnisharp will use local MSBuild.
    MSBUILD_EXE_PATH: /home/tatanaka/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/MSBuild.dll
    MSBuildExtensionsPath: /home/tatanaka/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild
    RoslynTargetsPath: /home/tatanaka/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/Roslyn
    CscToolPath: /home/tatanaka/.vscode/extensions/ms-vscode.csharp-1.12.1/.omnisharp/omnisharp/msbuild/Roslyn

[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        No solution files found in '/home/tatanaka/omnisharpdebug'
[info]: OmniSharp.MSBuild.MSBuildProjectSystem
        Loading project: /home/tatanaka/omnisharpdebug/omnisharpdebug.csproj
[fail]: OmniSharp.MSBuild.ProjectFile.ProjectFileInfo
        The "Microsoft.NET.Build.Tasks.ReportAssetsLogMessages" task could not be loaded from the assembly /opt/rh/rh-dotnet20/root/usr/lib64/dotnet/sdk/2.0.0/Sdks/Microsoft.NET.Sdk/build/../tools/net46/Microsoft.NET.Build.Tasks.dll.  Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
[warn]: OmniSharp.MSBuild.MSBuildProjectSystem
        Failed to load project file '/home/tatanaka/omnisharpdebug/omnisharpdebug.csproj'.
/home/tatanaka/omnisharpdebug/omnisharpdebug.csproj

[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/tatanaka/omnisharpdebug'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Services.WorkspaceHelper
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Startup
        Configuration finished.

I'm afraid this issue depends on Red Hat provided .NET Core. Could you help finding the root cause? I can ask Red Hat engineers to fix SDK if needed.
The Red Hat .NET Core build is based on https://github.com/dotnet/source-build/. Red Hat .NET Core doesn't have the 'sdk/2.0.0/Sdks/Microsoft.NET.Sdk/tools/net46/Microsoft.NET.Build.Tasks.dll'. Instead, there is such a dll at 'netcoreapp1.0' (instead of 'net46').

@DustinCampbell

This comment has been minimized.

Show comment
Hide comment
@DustinCampbell

DustinCampbell Aug 31, 2017

Collaborator

Thanks for reporting this issue! I've heard about it, but hadn't received any feedback on this yet.

If I recall correctly, the issue here is that the .NET Core SDK source build does not include net46 binaries. @nguerrera, do you know how to route this?

Collaborator

DustinCampbell commented Aug 31, 2017

Thanks for reporting this issue! I've heard about it, but hadn't received any feedback on this yet.

If I recall correctly, the issue here is that the .NET Core SDK source build does not include net46 binaries. @nguerrera, do you know how to route this?

@DustinCampbell

This comment has been minimized.

Show comment
Hide comment
@DustinCampbell

DustinCampbell Aug 31, 2017

Collaborator

To be clear: this issue is caused by the fact that OmniSharp itself runs as a net46 app on Mono. When it uses MSBuild inproc the .NET Core SDK tries to load the MSBuild tasks for net46 because that's the current runtime.

Collaborator

DustinCampbell commented Aug 31, 2017

To be clear: this issue is caused by the fact that OmniSharp itself runs as a net46 app on Mono. When it uses MSBuild inproc the .NET Core SDK tries to load the MSBuild tasks for net46 because that's the current runtime.

@nguerrera

This comment has been minimized.

Show comment
Hide comment
@nguerrera

nguerrera Aug 31, 2017

I've filed dotnet/source-build#125 to route this.

nguerrera commented Aug 31, 2017

I've filed dotnet/source-build#125 to route this.

@DustinCampbell

This comment has been minimized.

Show comment
Hide comment
@DustinCampbell

DustinCampbell Aug 31, 2017

Collaborator

Thanks @nguerrera! I'll leave this open here to track the customer impact of the problem.

Collaborator

DustinCampbell commented Aug 31, 2017

Thanks @nguerrera! I'll leave this open here to track the customer impact of the problem.

@xasx

This comment has been minimized.

Show comment
Hide comment
@xasx

xasx Sep 11, 2017

This also happens for me as a Fedora user (no big surprise though).

Using dotnet packages from the official SIG @ https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/

xasx commented Sep 11, 2017

This also happens for me as a Fedora user (no big surprise though).

Using dotnet packages from the official SIG @ https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet/

@inosik

This comment has been minimized.

Show comment
Hide comment
@inosik

inosik Sep 14, 2017

I get the same error on Windows 7 when I open a C# project from Git Bash with code .. It works correctly if I open VS Code and navigate to the project directory.

inosik commented Sep 14, 2017

I get the same error on Windows 7 when I open a C# project from Git Bash with code .. It works correctly if I open VS Code and navigate to the project directory.

@inosik

This comment has been minimized.

Show comment
Hide comment
@inosik

inosik Sep 14, 2017

Sorry, the error I have is actually different.

inosik commented Sep 14, 2017

Sorry, the error I have is actually different.

@DustinCampbell

This comment has been minimized.

Show comment
Hide comment
@DustinCampbell

DustinCampbell Sep 14, 2017

Collaborator

@inosik: In that case, could you file a separate issue?

Collaborator

DustinCampbell commented Sep 14, 2017

@inosik: In that case, could you file a separate issue?

@martinmine

This comment has been minimized.

Show comment
Hide comment
@martinmine

martinmine Oct 3, 2017

Any update on this? Also having this issue (Fedora).

martinmine commented Oct 3, 2017

Any update on this? Also having this issue (Fedora).

@DustinCampbell

This comment has been minimized.

Show comment
Hide comment
@DustinCampbell

DustinCampbell Oct 3, 2017

Collaborator

@martinmine: The problem is actually within the .NET Core SDK. We're tracking that with dotnet/source-build#125.

Collaborator

DustinCampbell commented Oct 3, 2017

@martinmine: The problem is actually within the .NET Core SDK. We're tracking that with dotnet/source-build#125.

@RheaAyase

This comment has been minimized.

Show comment
Hide comment
@RheaAyase

RheaAyase Mar 2, 2018

To provide a little bit of an update, since there wasn't one, the issue was hacked up in our packages to somehow work, but the results are not guaranteed ;P

RheaAyase commented Mar 2, 2018

To provide a little bit of an update, since there wasn't one, the issue was hacked up in our packages to somehow work, but the results are not guaranteed ;P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment