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

RHEL/CentOS 8 missing net46/Microsoft.NET.Sdk.Razor.Tasks.dll #2006

Closed
michaelbarkdoll opened this issue Jan 28, 2021 · 20 comments
Closed

RHEL/CentOS 8 missing net46/Microsoft.NET.Sdk.Razor.Tasks.dll #2006

michaelbarkdoll opened this issue Jan 28, 2021 · 20 comments
Assignees
Labels
area-build Improvements in source-build's own build process area-product-experience Improvements in the end-user's product experience blocking-downstream Issues that are blocking downstream maintainers or scenarios
Milestone

Comments

@michaelbarkdoll
Copy link

Hi, I have an issue with a missing .dll file.

My C# extension no longer loads in VS Code due to this missing dll.

dotnet/vscode-csharp#4360

On the Ubuntu 20.04 LTS the dotnet-sdk-5.0 package has the following dll files:
/usr/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.Razor/tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll
/usr/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.Razor/tasks/net5.0/Microsoft.NET.Sdk.Razor.Tasks.dll

However, my CentOS 8 only has the following file installed after upgrading to 5.0.102:
/usr/lib64/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.Razor/tasks/net5.0/Microsoft.NET.Sdk.Razor.Tasks.dll

So it appears that in RHEL/CentOS 8 the following file(s) are missing:
/usr/lib64/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk.Razor/tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll

ls -la tasks/net46/
-rw-r--r-- 1 root root 77192 Dec 14 20:17 Microsoft.NET.Sdk.Razor.Tasks.dll
-rw-r--r-- 1 root root 189832 Dec 14 20:17 System.Collections.Immutable.dll
-rw-r--r-- 1 root root 464776 Dec 14 20:17 System.Reflection.Metadata.dll

@dagood dagood transferred this issue from dotnet/installer Jan 29, 2021
@dagood
Copy link
Member

dagood commented Jan 29, 2021

For context: CentOS builds .NET from source, based on the infrastructure in this repo dotnet/source-build. That's why it's different from the build produced by Microsoft.

We currently have a patch that removes the net46 build for this part of the SDK, so we'll have to look into removing the patch to build the net46 files. https://github.com/dotnet/source-build/blob/release/5.0/patches/aspnetcore/0010-Don-t-build-for-full-fx.patch. (It's not new to 5.0.102, it was in 5.0.100 as well: https://github.com/dotnet/source-build/blob/v5.0.100-SDK/patches/aspnetcore/0012-Don-t-build-for-full-fx.patch.)
@crummel do you happen to know why this patch was needed?

/cc @omajid (FWIW, the test script at #1950 seems to work fine with CentOS 8's 5.0.102.)

@omajid
Copy link
Member

omajid commented Jan 29, 2021

@omajid (FWIW, the test script at #1950 seems to work fine with CentOS 8's 5.0.102.)

I took a quick look and it looks like that script only tries out a dotnet new console project, which works with omnisharp. Many other project types (for example, web, blazorserver) don't.

omajid added a commit to omajid/dotnet-regular-tests that referenced this issue Jan 29, 2021
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
@dseefeld dseefeld added triaged area-build Improvements in source-build's own build process labels Feb 4, 2021
@dagood
Copy link
Member

dagood commented Feb 8, 2021

We got an error message from #2008 showing what the patch was avoiding:

Based on this error:

/src/artifacts/src/aspnetcore.2670c128d522473e146ff9f8159bfffdfe694cd9/src/Razor/Microsoft.NET.Sdk.Razor/src/Microsoft.NET.Sdk.Razor.csproj : error NU1202: Package Microsoft.Build.Framework 16.8.3 is not compatible with net46 (.NETFramework,Version=v4.6). Package Microsoft.Build.Framework 16.8.3 supports: netstandard2.0 (.NETStandard,Version=v2.0) [/src/.dotnet/sdk/5.0.100/NuGet.targets]

I would guess we need to get rid of this DotNetBuildFromSource condition:

https://github.com/dotnet/msbuild/blob/39993bd9d02917993b6147a9973dc3aa6e9b00c7/src/Directory.Build.props#L29-L30

    <LibraryTargetFrameworks>$(FullFrameworkTFM);netstandard2.0</LibraryTargetFrameworks>
    <LibraryTargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">netstandard2.0</LibraryTargetFrameworks>

@dagood dagood added the area-product-experience Improvements in the end-user's product experience label Feb 8, 2021
@tvildo
Copy link

tvildo commented Mar 4, 2021

On Centos 33 Omnisharp was crashing with exception and to solve that I had to install additional package:
dotnet add package Microsoft.NET.Sdk.Razor --version 3.1.12

@omajid
Copy link
Member

omajid commented Apr 19, 2021

Hey folks. Any progress on this? Is there anything I can do to help here?

@richlander
Copy link
Member

FYI: https://bugs.archlinux.org/task/70018

@omajid
Copy link
Member

omajid commented Apr 30, 2021

Hey, @crummel @dseefeld @MichaelSimons. Any updates on this? This is affecting all users of source-build (Fedora, Arch, etc) and makes the IDE experience (eg, VSCode) really bad. Can we prioritize a fix for this? Do we need help from any other team?

@crummel
Copy link
Contributor

crummel commented Apr 30, 2021

We have a planning/triage meeting on Monday, I'll make sure to bring this up as something to prioritize. I'll noodle with the MSBuild issue a bit, I know we had to change that patch for the feature branch upgrade so maybe we can fix that now.

@crummel crummel added untriaged blocking-downstream Issues that are blocking downstream maintainers or scenarios labels May 3, 2021
@MichaelSimons MichaelSimons added this to the 5.0 milestone May 3, 2021
@tmds
Copy link
Member

tmds commented May 4, 2021

I just hit this one too.

[fail]: OmniSharp.MSBuild.ProjectLoader
        The "Microsoft.AspNetCore.Razor.Tasks.DiscoverDefaultScopedCssItems" task could not be loaded from the assembly /usr/lib64/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tasks/net46/Microsoft.NET.Sdk.Razor.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/web/web.csproj'.

@zpxp
Copy link

zpxp commented May 15, 2021

Is there a workaround for this issue? It makes the IDE (via omnisharp) unusable.

@exyi
Copy link

exyi commented May 19, 2021

@zpxp

Is there a workaround for this issue? It makes the IDE (via omnisharp) unusable.

Adding the reference to Microsoft.NET.Sdk.Razor as was suggested: dotnet add package Microsoft.NET.Sdk.Razor --version 3.1.12. At least it fixed the issue for me on Arch Linux.

@victormikael
Copy link

@zpxp

Is there a workaround for this issue? It makes the IDE (via omnisharp) unusable.

Adding the reference to Microsoft.NET.Sdk.Razor as was suggested: dotnet add package Microsoft.NET.Sdk.Razor --version 3.1.12. At least it fixed the issue for me on Arch Linux.

Thanks! Work for me.

I too try install bin packages dotnet-sdk-bin aspnet-runtime-bin aspnet-targeting-pack-bin from AUR and worked. To use it not is needed to add Razor package old.

@omajid
Copy link
Member

omajid commented May 20, 2021

Hey @dleeapho can we increase the priority of this issue and it's short-term and long-term fixes too? Due to this bug, the IDE experience (auto-completion/Intellisense) is completely broken for ASP.NET projects in 5.0.

@crummel
Copy link
Contributor

crummel commented May 20, 2021

I'm looking at this now, I'm hoping to get it done this week.

@zpxp
Copy link

zpxp commented May 21, 2021

As another workaround, you can use the vscode dev containers and docker to develop inside the .NET 5 docker template image

@JoeRobich
Copy link
Member

From the VS Code C# extension side of things, OmniSharp (the C# language server) runs on Full Framework (Mono or .NET Framework) to support the greatest number of project types. This means when the Web SDK targets are loading MSBuild tasks, it is trying to load the Full Framework build of the assemblies (net46 or net472) instead of the .NET 5 assemblies shipped with the source build version of teh .NET SDK.

omajid added a commit to omajid/dotnet-regular-tests that referenced this issue Jun 14, 2021
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
@2bdkid
Copy link

2bdkid commented Jun 22, 2021

Also running into this issue

omajid added a commit to omajid/dotnet-regular-tests that referenced this issue Jul 8, 2021
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
omajid added a commit to omajid/dotnet-regular-tests that referenced this issue Jul 8, 2021
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
omajid added a commit to redhat-developer/dotnet-regular-tests that referenced this issue Jul 8, 2021
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
@omajid
Copy link
Member

omajid commented Jul 30, 2021

This was fixed by #2178 (thanks, @crummel!) and included in the latest release: https://github.com/dotnet/source-build/releases/tag/v5.0.205-SDK

AFAIK, updates have gone out for CentOS 8, Fedora, and RHEL.

I see that the Arch Linux package has been updated too: archlinux/svntogit-community@055b029#diff-3e341d2d9c67be01819b25b25d5e53ea3cdf3a38d28846cda85a195eb9b7203a

Is there anything else to do here? Can we close this issue now?

@ultimaweapon
Copy link

I can confirm the issue has been fixed on Arch Linux with the latest version.

@crummel
Copy link
Contributor

crummel commented Aug 2, 2021

Closing this issue then, thanks for testing!

Fixed by #2178.

@crummel crummel closed this as completed Aug 2, 2021
nicolestandifer3 added a commit to nicolestandifer3/regular-tests-dotnet that referenced this issue Aug 6, 2023
Omnisharp needs separate tasks/dlls for separate project types. Testing
with just a `console` project is not sufficient to verify that all
project types work. We need to test with each project type that we care
about to make sure it works.

See dotnet/source-build#2006 for more
information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-build Improvements in source-build's own build process area-product-experience Improvements in the end-user's product experience blocking-downstream Issues that are blocking downstream maintainers or scenarios
Projects
None yet
Development

No branches or pull requests