"MSB4018 ResolveTargetingPackAssets task failed unexpectedly" after updating to 5.0.103
See original GitHub issueDescription
After updating dotnet to 5.0.3 via dnf update
, I’m finding myself unable to build any project resulting in the error:
usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly.
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,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/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data/FrameworkList.xml' [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlTextReaderImpl.FinishInitUriString() [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackRoot, String targetingPackDllFolder, ITaskItem targetingPack, List`1 referenceItems) [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/henrik/RiderProjects/test/test.csproj]
/usr/share/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(324,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/henrik/RiderProjects/test/test.csproj]
Configuration
OS: Fedora 33 x64 Dotnet: 5.0.103 via Microsoft repo dnf Dotnet info which lists all versions I’ve tried:
.NET SDK (reflecting any global.json):
Version: 5.0.100
Commit: 5044b93829
Runtime Environment:
OS Name: fedora
OS Version: 33
OS Platform: Linux
RID: fedora.33-x64
Base Path: /usr/share/dotnet/sdk/5.0.100/
Host (useful for support):
Version: 5.0.3
Commit: eae88cc11b
.NET SDKs installed:
5.0.100 [/usr/share/dotnet/sdk]
5.0.101 [/usr/share/dotnet/sdk]
5.0.102 [/usr/share/dotnet/sdk]
5.0.103 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Regression?
Initially, I believed this was a dotnet 5.0.103 issue due to it starting after updating to said version but after testing .103 to .100 with all giving the same error, I’m starting to think it might be my system which is acting up (why I’m not sure of)
Other information
I checked the folder which the error refers to and found /usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/5.0.0/data
to be empty, no FrameworkList.xml exists.
I’ve also attempted reinstalling dotnet multiple times clearing dnf cache in-between reinstalls
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Build error: The "ResolveTargetingPackAssets" task failed ...
Build fails with the following error: : error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly.
Read more >MSB4018 - MSBuild
This error is emitted when a task fails with an unhandled exception. This is generally a sign of a bug in the task....
Read more >Troubleshoot .NET package mix ups on Linux
These errors may occur when you run the dotnet command. ... ResolveTargetingPackAssets task failed unexpectedly" after updating to 5.0.103 ...
Read more >Error MSB4018 The "ResolvePackageAssets" task failed ...
Error MSB4018 The “ResolvePackageAssets” task failed unexpectedly. NuGet.Packaging.Core.PackagingException: Unable to find fallback package ...
Read more >The "ResolveTargetingPackAssets" task failed unexpectedly
I cant compile .net core projects anymore. The following error is displayed in the event log Project 'CoreForms' load. The "ResolveTargetingPackAssets" task ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Downgrading the dotnet-sdk-5.0 package did not work for me, had some other problems then (probably because dotnet-host and other packages where not downgraded). So I resolved this by doing the following:
sudo dnf remove dotnet*
sudo dnf install dotnet-sdk-5.0
Now I am on 5.0.102 and all is working again. Is there a difference between the packages from the microsoft prod repo and the ones from the Fedora Updates repo? Are the fedora ones maintained by Microsoft?
Edit: I once again removed all packages and reinstalled them again using the ms prod repo. Now everything seems to work fine with the latest version:
sudo dnf install dotnet-sdk-5.0.x86_64 dotnet-sdk-3.1.x86_64 --repo packages-microsoft-com-prod
dotnet --info
output:@dseefeld @crummel can what @Kampfmoehre suggested about version numbers be done? This seems like yet another manifestation of distro-native / ms feed coexistence https://github.com/dotnet/runtime/issues/47500