Skip to content

Nuget "Part URI cannot start with two forward slashes."  #637

Closed
@GJBos

Description

@GJBos

When uploading the package to our server, or when opening the package in a NuGet Package explorer the error "Part URI cannot start with two forward slashes." is shown.

Stacktrace when uploading to our nuget server:

<?xml version="1.0" encoding="UTF-8"?>

-<m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

<m:code/>

<m:message xml:lang="en-US">An error has occurred.</m:message>


-<m:innererror>

<m:message>Part URI cannot start with two forward slashes.</m:message>

<m:type>System.ArgumentException</m:type>

<m:stacktrace> 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(Stream s, FileMode mode, FileAccess access, Boolean streaming) at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming) at NuGet.PackageHelper.GetManifestStream(Stream packageStream) at NuGet.OptimizedZipPackage.EnsureManifest() at NuGet.Server.Core.PackageFactory.Open(String fullPackagePath) at NuGet.Server.Core.Infrastructure.ServerPackageRepository.AddPackagesFromDropFolderWithoutLocking() at NuGet.Server.Core.Infrastructure.ServerPackageRepository.<RebuildPackageStoreWithoutLockingAsync>d__48.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Server.Core.Infrastructure.ServerPackageRepository.<RebuildIfNeededAsync>d__37.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Server.Core.Infrastructure.ServerPackageRepository.<GetPackagesAsync>d__36.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NuGet.Server.V2.Controllers.NuGetODataController.<Get>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()</m:stacktrace>

</m:innererror>

</m:error>

The issue seems to be the double // in the [Content_Types].xml file.
<Override PartName="//LICENSE" ContentType="application/octet" />

I had to remove this file from the nuget and repackage the nuget before I could upload the package to our server. I tried to find the error and submit a fix, but I cannot find the problem.

This error occures in both the Microsoft.AspNet.WebApi.Versioning.ApiExplorer and Microsoft.AspNet.WebApi.Versioning package

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions