diff --git a/src/Core/Authoring/PackageBuilder.cs b/src/Core/Authoring/PackageBuilder.cs index afa5991be..d3aeb09a2 100644 --- a/src/Core/Authoring/PackageBuilder.cs +++ b/src/Core/Authoring/PackageBuilder.cs @@ -259,7 +259,7 @@ public void Save(Stream stream) WriteManifest(package, DetermineMinimumSchemaVersion(Files, DependencySets)); // Write the files to the package - WriteFiles(package); + WriteFiles(package, Id); // Copy the metadata properties back to the package package.PackageProperties.Creator = String.Join(",", Authors); @@ -484,7 +484,7 @@ private void WriteManifest(Package package, int minimumManifestVersion) } } - private void WriteFiles(Package package) + private void WriteFiles(Package package, string packageId) { // Add files that might not come from expanding files on disk foreach (IPackageFile file in new HashSet(Files)) @@ -493,7 +493,7 @@ private void WriteFiles(Package package) { try { - CreatePart(package, file.Path, stream); + CreatePart(package, file.Path, stream, packageId); } catch { @@ -592,9 +592,9 @@ private static void ExcludeFiles(List searchFiles, string b } } - private static void CreatePart(Package package, string path, Stream sourceStream) + private static void CreatePart(Package package, string path, Stream sourceStream, string packageId) { - if (PackageHelper.IsPackageManifest(path, package.PackageProperties.Identifier)) + if (PackageHelper.IsPackageManifest(path, packageId)) { return; } diff --git a/src/Core/Packages/OptimizedZipPackage.cs b/src/Core/Packages/OptimizedZipPackage.cs index fa9b20c46..4fb86058d 100644 --- a/src/Core/Packages/OptimizedZipPackage.cs +++ b/src/Core/Packages/OptimizedZipPackage.cs @@ -254,7 +254,7 @@ private void EnsurePackageFiles() Package package = Package.Open(stream); // unzip files inside package var files = from part in package.GetParts() - where ZipPackage.IsPackageFile(part, package.PackageProperties.Identifier) + where ZipPackage.IsPackageFile(part, Id) select part; // now copy all package's files to disk