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

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

Closed
RomanDvorsky opened this issue Jan 17, 2019 · 6 comments
Closed

Comments

@RomanDvorsky
Copy link

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
Copy link
Owner

kamsar commented Feb 1, 2019

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.

@kamsar kamsar added the question label Feb 1, 2019
@RomanDvorsky
Copy link
Author

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
Copy link

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
Copy link
Owner

kamsar commented Mar 8, 2019

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
Copy link
Collaborator

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

@RomanDvorsky
Copy link
Author

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

markgibbons25 added a commit that referenced this issue Apr 17, 2020
…Also an optimization to properly dispose of the Process handle when done.
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

4 participants