baseclass / Contrib.Nuget

Extending nuget with nuget packages
MIT License
30 stars 21 forks source link

Unable to build the project after adding this nuget package #62

Open blueelvis opened 4 years ago

blueelvis commented 4 years ago

Hi!

I am getting the following error saying that the key has already been added. Please find the logs below -

Severity    Code    Description Project File    Line    Suppression State
Error   MSB4018 The "PackageRetrievalTask" task failed unexpectedly.
System.ArgumentException: Item has already been added. Key in dictionary: 'packageIcon.png'  Key being added: 'packageIcon.png'
   at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
   at System.Collections.Hashtable.Add(Object key, Object value)
   at System.Collections.Specialized.OrderedDictionary.Add(Object key, Object value)
   at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.ParseRecord(BinaryReader reader, Int64 centralDirectoryOffset, Int32 centralDirectoryCount, Int64 expectedCentralDirectorySize)
   at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager)
   at MS.Internal.IO.Zip.ZipIOBlockManager.get_CentralDirectoryBlock()
   at MS.Internal.IO.Zip.ZipArchive.GetFiles()
   at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)
   at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming)
   at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming)
   at Baseclass.Contrib.Nuget.Output.Build.NugetPackageManager.TryGetUsedPackagesDependendingOnNugetOutput(ITaskItem[]& packages)
   at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() CP  C:\Users\User\.nuget\packages\baseclass.contrib.nuget.output\2.4.3\build\Baseclass.Contrib.Nuget.Output.targets 65  

Any idea what might be the issue?

Thanks!

romerod commented 4 years ago

Does that icon file exist multiple times?

Holen Sie sich Outlook für Androidhttps://aka.ms/ghei36


From: Pranav notifications@github.com Sent: Monday, April 20, 2020 3:00:54 PM To: baseclass/Contrib.Nuget Contrib.Nuget@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: [baseclass/Contrib.Nuget] Unable to build the project after adding this nuget package (#62)

Hi!

I am getting the following error saying that the key has already been added. Please find the logs below -

Severity Code Description Project File Line Suppression State Error MSB4018 The "PackageRetrievalTask" task failed unexpectedly. System.ArgumentException: Item has already been added. Key in dictionary: 'packageIcon.png' Key being added: 'packageIcon.png' at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at System.Collections.Hashtable.Add(Object key, Object value) at System.Collections.Specialized.OrderedDictionary.Add(Object key, Object value) at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.ParseRecord(BinaryReader reader, Int64 centralDirectoryOffset, Int32 centralDirectoryCount, Int64 expectedCentralDirectorySize) at MS.Internal.IO.Zip.ZipIOCentralDirectoryBlock.SeekableLoad(ZipIOBlockManager blockManager) at MS.Internal.IO.Zip.ZipIOBlockManager.get_CentralDirectoryBlock() at MS.Internal.IO.Zip.ZipArchive.GetFiles() at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper) at System.IO.Packaging.ZipPackage..ctor(String path, FileMode mode, FileAccess access, FileShare share, Boolean streaming) at System.IO.Packaging.Package.Open(String path, FileMode packageMode, FileAccess packageAccess, FileShare packageShare, Boolean streaming) at Baseclass.Contrib.Nuget.Output.Build.NugetPackageManager.TryGetUsedPackagesDependendingOnNugetOutput(ITaskItem[]& packages) at Baseclass.Contrib.Nuget.Output.Build.PackageRetrievalTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() CP C:\Users\User.nuget\packages\baseclass.contrib.nuget.output\2.4.3\build\Baseclass.Contrib.Nuget.Output.targets 65

Any idea what might be the issue?

Thanks!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/baseclass/Contrib.Nuget/issues/62, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAYQTXVNXV4UC5IDFRW4NWTRNRBQNANCNFSM4MMNNROQ.

blueelvis commented 4 years ago

@romerod - Yep! I deleted those files from the packages folder as well (Using Dotnet Core 3.0) but still the same error has happening. I have zeroed the error to this line -

usedPackages.Add($"{id}.{version}".ToLowerInvariant());

But that file exists across various packages and not just 1 single package.