kamsar / Dianoga

An automatic image optimizer for the Sitecore media library.
Other
104 stars 45 forks source link

The "PackageRetrievalTask" task failed unexpectedly with version 4.0.0 #47

Closed RomanDvorsky closed 4 years ago

RomanDvorsky commented 5 years ago

Hi,

I cannot build our solution once I have updated dianoga plugin from version 3.1.1 to version 4.0.0. Actually I need the update because of the temp files bug so I have updated just the version of the package:

in .cspoj file I do have:

<Reference Include="Dianoga, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
      <HintPath>..\packages\Dianoga.4.0.0\lib\net452\Dianoga.dll</HintPath>
    </Reference>

in package config there is:

<package id="Dianoga" version="4.0.0" targetFramework="net471" />

and once I build the solution I do have an error:

packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets(65,5): Error MSB4018: The "PackageRetrievalTask" task failed unexpectedly.
System.ArgumentException: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
   at System.IO.Packaging.PackUriHelper.ValidatePartUri(Uri partUri)
   at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessOverrideTagAttributes(XmlTextReader reader)
   at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles)
   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()
Process 'msbuild.exe' exited with code '1'.

Thx for any tips what can be wrong, Roman

kamsar commented 5 years ago

Did you perform the upgrade without Visual Studio? Unless you're using PackageReference (which you aren't), NuGet packages need to be installed via VS to run the installation routines.

RomanDvorsky commented 5 years ago

Hi,

I did the upgrade thru the Visual Studio - but I did customize the previous version a bit - so the upgrade is quite tricky. My customization is that I moved all the Dianoga tools out of the App_Data folder (and of course updated necessary paths in the config files). So just update of the NuGet package version isn't enough - the new version is somehow specific?

R.

jesseglaves commented 5 years ago

Getting the error "Part URI is not valid per rules defined in the Open Packaging Conventions specification." when we click on the "Installed" tab after opening the "Manage NuGet packages for Solution" dialog in Visual Studio. Manually removing Dianoga from packages.config clears the error. We've tried uninstalling/reinstalling, and reverting back to 3.1.1 from 4.0, and the issue persists.

kamsar commented 5 years ago

It sounds like perhaps an issue with one of the files in the nupkg - probably in the dianoga tools folder - may have a character modern NuGet doesn't like (ref: https://help.octopusdeploy.com/discussions/problems/39033-part-uri-is-not-valid-per-rules-defined-in-the-open-packaging-conventions-specification)

markgibbons25 commented 4 years ago

This should be resolved with https://github.com/kamsar/Dianoga/releases/tag/5.0.0-beta.1 can you retest and provide feedback?

RomanDvorsky commented 4 years ago

Hi, currently we do go with a different solution so I cannot validate anymore :(