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

dotnet build always throwing error #17411

Closed
sahaaditya62 opened this issue May 4, 2021 · 9 comments
Closed

dotnet build always throwing error #17411

sahaaditya62 opened this issue May 4, 2021 · 9 comments
Milestone

Comments

@sahaaditya62
Copy link

Description

Configuration

Regression?

Other information

@sahaaditya62
Copy link
Author

dotnet build
Microsoft (R) Build Engine version 16.9.0+57a23d249 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

Determining projects to restore...
All projects are up-to-date for restore.
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: System.IO.FileNotFoundException: Could not find file '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data/FrameworkList.xml'. [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data/FrameworkList.xml' [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func2 errorRewriter) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlTextReaderImpl.FinishInitUriString() [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackRoot, String targetingPackDllFolder, ITaskItem targetingPack, List1 referenceItems) [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/aditya/dotnetproject/demo1/demo1.csproj]

Build FAILED.

/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: System.IO.FileNotFoundException: Could not find file '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data/FrameworkList.xml'. [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data/FrameworkList.xml' [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func2 errorRewriter) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlTextReaderImpl.FinishInitUriString() [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [/home/aditya/dotnetproject/demo1/demo1.csproj] /usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackRoot, String targetingPackDllFolder, ITaskItem targetingPack, List1 referenceItems) [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/aditya/dotnetproject/demo1/demo1.csproj]
/usr/share/dotnet/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(326,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/aditya/dotnetproject/demo1/demo1.csproj]
0 Warning(s)
1 Error(s)

Time Elapsed 00:00:00.82

I am using redhat 8.0

@mairaw mairaw transferred this issue from dotnet/core May 4, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label May 4, 2021
@sahaaditya62
Copy link
Author

Any update on this issue ?is anyone working , if you need more info please do let me know.

@dagood
Copy link
Member

dagood commented May 5, 2021

This looks to me like it might be an instance of dotnet/docs#18347 / dotnet/runtime#47500 based on it being Red Hat with /usr/share/dotnet paths.
+@NikolaMilosavljevic @MichaelSimons @omajid

@marcpopMSFT marcpopMSFT self-assigned this May 5, 2021
@omajid
Copy link
Member

omajid commented May 6, 2021

Thanks for cc'ing me, @dagood .

Hey @sahaaditya62, can you please tell us how you installed .NET on this RHEL 8 machine? I guess you installed Microsoft's .NET RPM/yum/dnf package repository and then used dnf/yum to install the .NET SDK?

Did you know that RHEL 8 includes .NET SDK in the default package repositories and you can install it on a fresh RHEL 8 installation using simply dnf install dotnet-sdk-5.0? Please see the .NET on RHEL 8 docs for more information.

If you really want to use the RPM packages built by Microsoft (and not Red Hat), I can help you come up with the steps to get htat working, but please let me know what your goal is.

@YusufMavzer
Copy link

Read this

#17851

@omajid
Copy link
Member

omajid commented May 25, 2021

Hey @sahaaditya62 ! We updated the docs to try and offer a few solutions to this issue: https://docs.microsoft.com/en-us/dotnet/core/install/linux-package-mixup. Let us know if that helps (or doesn't, for that matter)

@vrushalivartak
Copy link

@marcpopMSFT I think this issue can be closed. The possible solutions were suggested/documented. And there is no further open follow-up questions from submitter or anyone else.

@marcpopMSFT
Copy link
Member

Closing per above as it looks like suggests were made and documented as noted.

@marcpopMSFT marcpopMSFT closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2024
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

6 participants