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

Preview / source built .NET 6 SDK cannot be used with .NET 6 OmniSharp #2305

Closed
adamijak opened this issue Dec 8, 2021 · 4 comments
Closed
Labels

Comments

@adamijak
Copy link

adamijak commented Dec 8, 2021

Issue Description

Can not start omnisharp

Steps to Reproduce

  1. Open folder in vscode
  2. Set these properties in settings.json "omnisharp.useModernNet": true and "omnisharp.path": "latest"
  3. Create console application using dotnet-cli dotnet new console

Expected Behavior

Start of omnisharp

Actual Behavior

Fails with System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file.

Logs

OmniSharp log

Starting OmniSharp server at 08/12/2021, 14:24:33 Target: /home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli

OmniSharp server started with .NET 6.0.100
.
Path: /home/adamijak/.vscode/extensions/ms-dotnettools.csharp-1.23.18/.omnisharp/1.37.18-beta.111-net6.0/OmniSharp.dll
PID: 489901

Starting OmniSharp on Unknown 0.0 (Unknown)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
DotNetPath set to /usr/lib64/dotnet/dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.100 17.0.0 - "/usr/lib64/dotnet/sdk/6.0.100/"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.100 17.0.0 - "/usr/lib64/dotnet/sdk/6.0.100/"
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.MSBuild.ProjectSystem
No solution files found in '/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli/ReportWorkflowCli.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli' on host 489686.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli/ReportWorkflowCli.csproj
fail: OmniSharp.MSBuild.ProjectLoader
The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)
File name: 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
---> System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 346
at Microsoft.Build.Shared.MSBuildLoadContext.Load(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 678
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 607
at System.Linq.Enumerable.WhereEnumerableIterator1.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 29
at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli/ReportWorkflowCli.csproj'.
/home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli/ReportWorkflowCli.csproj
/usr/lib64/dotnet/sdk/6.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): Error: The "ProcessFrameworkReferences" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)
File name: 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
---> System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=6.0.0.32767, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 346
at Microsoft.Build.Shared.MSBuildLoadContext.Load(AssemblyName assemblyName)
at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 678
at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs:line 607
at System.Linq.Enumerable.WhereEnumerableIterator1.ToList() at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) in /builddir/build/BUILD/dotnet-9e8b04bbff820c93c142f99a507a46b976f5c14c-x64-bootstrap/src/runtime.4822e3c3aa77eb82b2fb33c9321f923cf11ddde6/artifacts/source-build/self/src/src/libraries/System.Linq/src/System/Linq/ToCollection.cs:line 29
at Microsoft.NET.Build.Tasks.ProcessFrameworkReferences.ExecuteCore()
at Microsoft.NET.Build.Tasks.TaskBase.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Attempted to update project that is not loaded: /home/adamijak/Documents/git/greycorbel/O365Usage/O365Usage/ReportWorkflowCli/ReportWorkflowCli.csproj

C# log

Installing C# dependencies... Platform: linux, x86_64, name=fedora, version=35

Failed at stage: touchBeginFile
Error: A release package of OmniSharp does not exist for this platform. Set "omnisharp.path" to "latest" in Settings to use an experimental build.

Finished

Getting latest OmniSharp version information
Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!

Environment information

VSCode version: 1.62.3
C# Extension: 1.23.18

Mono Information OmniSharp using built-in mono
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.100 Commit: 9e8b04bbff

Runtime Environment:
OS Name: fedora
OS Version: 35
OS Platform: Linux
RID: fedora.35-x64
Base Path: /usr/lib64/dotnet/sdk/6.0.100/

Host (useful for support):
Version: 6.0.0
Commit: 4822e3c3aa

.NET SDKs installed:
3.1.118 [/usr/lib64/dotnet/sdk]
5.0.206 [/usr/lib64/dotnet/sdk]
6.0.100 [/usr/lib64/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.18 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.18 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]

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

Visual Studio Code Extensions
Extension Author Version
armview bencoleman 0.4.5
azure-account ms-vscode 0.9.11
azure-pipelines ms-azure-devops 1.195.0
azurecli ms-vscode 0.5.0
azurerm-vscode-tools msazurermtools 0.15.5
csharp ms-dotnettools 1.23.18
vscode-azureappservice ms-azuretools 0.23.0
vscode-azurefunctions ms-azuretools 1.6.0
vscode-azureresourcegroups ms-azuretools 0.4.0
vscode-azurestorage ms-azuretools 0.12.1
vscode-azurevirtualmachines ms-azuretools 0.4.1
vscode-bicep ms-azuretools 0.4.1008
vscode-cosmosdb ms-azuretools 0.18.1
vscode-docker ms-azuretools 1.18.0
vscode-dotnet-runtime ms-dotnettools 1.5.0
vscode-node-azure-pack ms-vscode 0.2.1
@filipw
Copy link
Member

filipw commented Dec 8, 2021

How did you install dotnet SDK?

@filipw filipw transferred this issue from dotnet/vscode-csharp Dec 8, 2021
@filipw filipw changed the title Omnisharp fails with "Could not load file or assembly 'NuGet.Frameworks' .NET 6 Omnisharp fails with "Could not load file or assembly 'NuGet.Frameworks' even though 6.0.100 SDK was discovered Dec 8, 2021
@filipw filipw added the net 6 label Dec 8, 2021
@adamijak
Copy link
Author

adamijak commented Dec 8, 2021

How did you install dotnet SDK?

https://copr.fedorainfracloud.org/coprs/g/dotnet-sig/dotnet-preview/

@filipw
Copy link
Member

filipw commented Dec 8, 2021

Then this is "by design" (or "known limitation"). The preview builds and source builds are currently not supported because they use higher NuGet dependency versions than those that ship with OmniSharp.

You need to use the 'official' stable 6.0.100. See #2291 (comment) for more details.

@filipw filipw changed the title .NET 6 Omnisharp fails with "Could not load file or assembly 'NuGet.Frameworks' even though 6.0.100 SDK was discovered Preview / source built .NET 6 SDK cannot be used with .NET 6 OmniSharp Dec 8, 2021
@filipw
Copy link
Member

filipw commented Dec 15, 2021

resolved by #2308

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

No branches or pull requests

2 participants