Skip to content
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

Omnisharp error on Fedora, Red Hat Linux. #4583

Closed
rasbjac opened this issue May 31, 2021 · 6 comments
Closed

Omnisharp error on Fedora, Red Hat Linux. #4583

rasbjac opened this issue May 31, 2021 · 6 comments

Comments

@rasbjac
Copy link

rasbjac commented May 31, 2021

Starting OmniSharp server at 31/05/2021 19:52:46
Target: /home/rafael/Documentos/Projetos/Shop/Shop.Api

OmniSharp server started.
Path: /home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/run
PID: 3412

Starting OmniSharp on rhel 8.4 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 16.11.0 - "/home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild/Current/Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 16.11.0 - "/home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/rafael/.vscode/extensions/ms-dotnettools.csharp-1.23.12/.omnisharp/1.37.11-beta.9/omnisharp/.msbuild
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.Completion.CompletionOptionsProvider, 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.ImplementTypeWorkspaceOptionsProvider, Order: 110
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/rafael/Documentos/Projetos/Shop/Shop.Api'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/rafael/Documentos/Projetos/Shop/Shop.Api'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/rafael/Documentos/Projetos/Shop/Shop.Api/Shop.Api.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/rafael/Documentos/Projetos/Shop/Shop.Api'.
info: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/rafael/Documentos/Projetos/Shop/Shop.Api' on host 3304.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/rafael/Documentos/Projetos/Shop/Shop.Api/Shop.Api.csproj
fail: OmniSharp.MSBuild.ProjectLoader
The "Microsoft.AspNetCore.Razor.Tasks.DiscoverDefaultScopedCssItems" task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll. Invalid Image Confirm that the 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.ProjectManager
Failed to load project file '/home/rafael/Documentos/Projetos/Shop/Shop.Api/Shop.Api.csproj'.
/home/rafael/Documentos/Projetos/Shop/Shop.Api/Shop.Api.csproj
/usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/Microsoft.NET.Sdk.Razor.ScopedCss.targets(118,3): Error: The "Microsoft.AspNetCore.Razor.Tasks.DiscoverDefaultScopedCssItems" task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll. Invalid Image Confirm that the 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.

Attempted to update project that is not loaded: /home/rafael/Documentos/Projetos/Shop/Shop.Api/Shop.Api.csproj
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: /home/rafael/Documentos/Projetos/Shop/Shop.Api/obj/Debug/net5.0/.NETCoreApp,Version=v5.0.AssemblyAttributes.cs added to workspace

@jbox5
Copy link

jbox5 commented Jun 2, 2021

I am experiencing the same. Fresh Fedora 34 install, dnf install the dotnet core 5 packages, install vscode and use dotnet new webapi to create a new API. Immediately get this exact message from Omnisharp.

@JoeRobich
Copy link
Member

@rasbjac Sorry you are running into issues. Does the file that is having issues loading exist on disk? /usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll?

@jbox5
Copy link

jbox5 commented Jun 2, 2021

@JoeRobich For me, it does not. At this point in the folder structure:

/usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/tasks/

I only have a net5.0 folder, no net46 folder.

image

@rasbjac
Copy link
Author

rasbjac commented Jun 2, 2021

No, from what I've seen installing dotnet 5.0.x on Red Hat, Fedora and derivative distros is different from other distributions.
it follows the images:

These are folder on my Debian:
image

And this is the folder that exists on my Red Hat:

image

But I tried to copy the net46 folder into the /usr/lib64/dotnet/sdk/5.0.203/Sdks/Microsoft.NET.Sdk.Razor/tasks/ path in Red Hat and it worked with some exceptions.
Below is the issue with this information:
#4360
image

@JoeRobich
Copy link
Member

Looks like this has already been reported. The source build version of the SDK produced does not include the full framework version of the Razor build tasks. You can continue to track this issue at dotnet/source-build#2006

@JoeRobich
Copy link
Member

There are different packages you can install. For Arch users there is the dotnet-sdk-bin package. For Fedora or CentOS users you can try this suggestion #4360 (comment)

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

No branches or pull requests

3 participants