豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

System.Xml.XmlException: Unrecognized root element in Core Properties part. Line 2, position 2. #2718

@ghost

Description

One of my projects is failing to pack with the following errors which seems related to:

This has happened after a merge from a different source branch (which still seems to compile and pack properly) However, only a small amount of code has changed with some packages changes in packages.config.

I was running nuget.exe v.3.3 but after reading ##1921 and updating to a new version (NuGet Version: 3.4.3.855:) I am still getting the following error

I cant see any issues with the nuspec file, or the packages.config

NuGet Pack ./Ucas.UnitTests.Common/Ucas.UnitTests.Common.csproj -IncludeReferencedProjects -Verbosity detailed -MSBuildVersion 14 -Build

The build works but the zipping of the files is failing with the following stack trace:

C:\Development\BitBucket\WIP\Identity>NuGet Pack ./Ucas.UnitTests.Common/Ucas.UnitTests.Common.cspro
j -IncludeReferencedProjects -Verbosity detailed -MSBuildVersion 14 -Build
Attempting to build package from 'Ucas.UnitTests.Common.csproj'.
Building project 'C:\Development\BitBucket\WIP\Identity\Ucas.UnitTests.Common\Ucas.UnitTests.Common.
csproj' for target framework '.NETFramework,Version=v4.6'.
Packing files from 'C:\Development\BitBucket\WIP\Identity\Ucas.UnitTests.Common\bin\Debug'.
Using 'Ucas.UnitTests.Common.nuspec' for metadata.
Add file 'C:\Development\BitBucket\WIP\Identity\Ucas.UnitTests.Common\bin\Debug\Ucas.UnitTests.Commo
n.dll' to package as 'lib\net46\Ucas.UnitTests.Common.dll'
Add file 'C:\Development\BitBucket\WIP\Identity\Ucas.UnitTests.Common\bin\Debug\Ucas.UnitTests.Commo
n.xml' to package as 'lib\net46\Ucas.UnitTests.Common.xml'
System.Xml.XmlException: Unrecognized root element in Core Properties part. Line 2, position 2.
at MS.Internal.IO.Packaging.PartBasedPackageProperties.ParseCorePropertyPart(PackagePart part)
at MS.Internal.IO.Packaging.PartBasedPackageProperties.ReadPropertyValuesFromPackage()
at MS.Internal.IO.Packaging.PartBasedPackageProperties..ctor(Package package)
at System.IO.Packaging.Package.get_PackageProperties()
at NuGet.OptimizedZipPackage.<>c__DisplayClassa.b__9(PackagePart part)
at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at NuGet.OptimizedZipPackage.EnsurePackageFiles() at NuGet.OptimizedZipPackage.GetFilesBase() at NuGet.LocalPackage.GetFiles() at NuGet.PackageExtensions.GetFiles(IPackage package, String directory) at NuGet.CommandLine.ProjectFactory.<>c.<AddFiles>b__92_2(IPackage a) at System.Linq.Enumerable.<SelectManyIterator>d__162.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at NuGet.CommandLine.ProjectFactory.AddFiles(PackageBuilder builder, String itemType, String targ etFolder) at NuGet.CommandLine.ProjectFactory.<>c__DisplayClass56_0.<CreateBuilder>b__1(ProjectFactory p) at NuGet.CommandLine.ProjectFactory.RecursivelyApply(Action1 action, Object alreadyAppliedProjec
ts)
at NuGet.CommandLine.ProjectFactory.RecursivelyApply(Action1 action) at NuGet.CommandLine.ProjectFactory.ApplyAction(Action1 action)
at NuGet.CommandLine.ProjectFactory.CreateBuilder(String basePath)
at NuGet.CommandLine.PackCommand.BuildFromProjectFile(String path)
at NuGet.CommandLine.PackCommand.BuildPackage(String path)
at NuGet.CommandLine.PackCommand.ExecuteCommand()
at NuGet.CommandLine.Command.ExecuteCommandAsync()
at NuGet.CommandLine.Command.Execute()
at NuGet.CommandLine.Program.MainCore(String workingDirectory, String[] args)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions