-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Build error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. #4526
Comments
Please help. |
@seunsaber I see you're using 3.0 SDK and targeting netcoreapp3.0 which are out of support. The LTS version is 3.1, I recommend installing the 3.1 SDK and re-targeting your app and see if that still happens there. @dsplaisted might have more insights for the error. |
I think this is an issue we've seen before where the targeting pack was not installed correctly. I think it had something to do with the package dependencies. @wli3 do you remember more? What is in the following folder? If you delete that folder, it may fix the problem. |
Sorry that doesn't ring a bell |
Yep, here: #3868. (#3868 (comment)) It's kind of the opposite: the package wasn't uninstalled correctly, so removing the folder is a workaround that lets the SDK download a replacement from nuget.org. @seunsaber if you can tell us what Linux distro you're using and how you installed .NET Core (package manager?) we can probably confirm you're hitting the same problem. |
Hi guys, thanks for the replies. I had to reinstall the SDk. Maybe I did something wrong during the original installation. All is well now, thanks. |
I ran into this same issue. I'm using Fedora 32 and Fedora's dnf package system to update packages. I recently upgraded from Fedora 31 to 32. Deleting the directory
and then rebuilding the project worked. |
i am getting the error Error MSB4018 The "ResolveTargetingPackAssets" task failed unexpectedly. System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.23\data\FrameworkList.xml'.
|
I am trying to build a dotnet core project on a linux machine.
Build fails with the following error:
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: The "ResolveTargetingPackAssets" task failed unexpectedly. [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: System.IO.FileNotFoundException: Could not find file '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml'. [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: File name: '/usr/share/dotnet/packs/Microsoft.NETCore.App.Ref/3.0.0/data/FrameworkList.xml' [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func
2 errorRewriter) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions options) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlDownloadManager.GetStream(Uri uri, ICredentials credentials, IWebProxy proxy, RequestCachePolicy cachePolicy) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlTextReaderImpl.FinishInitUriString() [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlTextReaderImpl..ctor(String uriStr, XmlReaderSettings settings, XmlParserContext context, XmlResolver uriResolver) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlReaderSettings.CreateReader(String inputUri, XmlParserContext inputContext) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.XmlReader.Create(String inputUri, XmlReaderSettings settings) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at System.Xml.Linq.XDocument.Load(String uri) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj] /usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.AddReferencesFromFrameworkList(String frameworkListPath, String targetingPackDllFolder, ITaskItem targetingPack, List
1 referenceItems) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.NET.Build.Tasks.ResolveTargetingPackAssets.ExecuteCore() [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.NET.Build.Tasks.TaskBase.Execute() [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
/usr/share/dotnet/sdk/3.0.103/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(264,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/var/lib/jenkins/workspace/MyProject/MyProject.Shared/MyProject.Shared.csproj]
Build FAILED.
See my csproj:
The text was updated successfully, but these errors were encountered: