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 is using bits not available in a 5.0 source-built sdk #1973

Closed
tmds opened this issue Oct 6, 2020 · 10 comments
Closed

omnisharp is using bits not available in a 5.0 source-built sdk #1973

tmds opened this issue Oct 6, 2020 · 10 comments
Labels

Comments

@tmds
Copy link

tmds commented Oct 6, 2020

Steps

  1. Use a source-built SDK, like the 5.0-preview8 sdk on Fedora.
  2. Create a dotnet new console project.
  3. Add an omnisharp.json file:
{
    "RoslynExtensionsOptions": {
        "enableAnalyzersSupport": true
    },
    "FormattingOptions": {
        "enableEditorConfigSupport": true
    }
}
  1. Open vscode with csharp 1.23.2 installed.

Result

The project fails to load with this message in the log:

fail]: OmniSharp.MSBuild.ProjectLoader
        The "CheckForDuplicateFrameworkReferences" task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.100-preview.8.20417.9/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks.dll. Invalid Image 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.ProjectManager
        Failed to load project file '/tmp/console/console.csproj'.
/tmp/console/console.csproj
/usr/lib64/dotnet/sdk/5.0.100-preview.8.20417.9/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(39,5): Error: The "CheckForDuplicateFrameworkReferences" task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.100-preview.8.20417.9/Sdks/Microsoft.NET.Sdk/targets/../tools/net472/Microsoft.NET.Build.Tasks.dll. Invalid Image 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.

The net472 folder OmniSharp is trying to use does not exist on a source-built sdk:

$ ls /usr/lib64/dotnet/sdk/5.0.100-preview.8.20417.9/Sdks/Microsoft.NET.Sdk/targets/../tools
net5.0

cc @crummel @dagood @omajid

@tmds
Copy link
Author

tmds commented Oct 6, 2020

We ran into a similar issue with .NET Core 2.0: dotnet/vscode-csharp#1744, dotnet/source-build#125.

@dagood
Copy link

dagood commented Oct 6, 2020

dotnet/source-build#1650 is open on the source-build side to build for net* target frameworks properly. Some .NET Framework removal patches got added for 5.0 that are causing this the same way as last time. /cc @dseefeld

@filipw
Copy link
Member

filipw commented Oct 6, 2020

yes indeed, I am not sure it is really OmniSharp problem. As a Mono based tool it will also try to load .NET Framework build tasks

@filipw filipw added the external label Oct 6, 2020
@tmds
Copy link
Author

tmds commented Oct 28, 2020

@filipw as .NET Core and mono are sharing more code, I wonder what is still missing for mono to use the netstandard/netcoreapp assemblies? Do you know?

@tmds
Copy link
Author

tmds commented Dec 3, 2020

We were not able to resolve this for 5.0.0 release of source-build.

as .NET Core and mono are sharing more code, I wonder what is still missing for mono to use the netstandard/netcoreapp assemblies? Do you know?

@filipw your thoughts? something we could look into for .NET 6 perhaps? It would be really nice if we could get rid of the net4* assemblies all together.

@omajid
Copy link
Contributor

omajid commented Dec 3, 2020

I was speaking about this to @leecow and @dleeapho earlier today too.

@leecow
Copy link

leecow commented Dec 10, 2020

OmniSharp is aware of the difficulties and while there is a general desire to move to .NET Core/.NET 5, technical dependencies will keep them on .NET Framework for the foreseeable future.

@dseefeld, can you add your current plan here that you mentioned this morning?

@dseefeld
Copy link

OmniSharp is aware of the difficulties and while there is a general desire to move to .NET Core/.NET 5, technical dependencies will keep them on .NET Framework for the foreseeable future.

@dseefeld Dan Seefeldt FTE, can you add your current plan here that you mentioned this morning?

The current plan for source-build is to build the necessary assemblies for net4x in source-build. PR is here: dotnet/source-build#1928

@tmds
Copy link
Author

tmds commented Dec 11, 2020

OmniSharp is aware of the difficulties and while there is a general desire to move to .NET Core/.NET 5

I was assuming mono would support net6.0, making this problem disappear. But I'm not sure what ithe plan with mono actually is with .NET 5+. I've raised the question here: dotnet/standard#1785.

@tmds
Copy link
Author

tmds commented Dec 14, 2020

I've raised the question here: dotnet/standard#1785.

I got some interesting answers on that issue, though I don't know what it means in practice for a mono-user like omnishiarp.

The current plan for source-build is to build the necessary assemblies for net4x in source-build. PR is here: dotnet/source-build#1928

🎉 @dagood completed this, so I'm closing this issue.

@tmds tmds closed this as completed Dec 14, 2020
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

6 participants