Error when creating nuget lib package from C:\Users\gotos\source\repos\corefx2\artifacts\packages\Debug\specs\Microsoft.NETCore.Targets.nuspec. System.ArgumentOutOfRangeException: The DateTimeOffset specified cannot be converted into a Zip file timestamp. (Parameter 'value') [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
at NuGet.Packaging.PackageBuilder.Save(Stream stream) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
at Microsoft.DotNet.Build.Tasks.Packaging.NuGetPack.Pack(String nuspecPath, String nupkgPath, Manifest manifest, Boolean packSymbols) in /_/src/Microsoft.DotNet.Build.Tasks.Packaging/src/NuGetPack.cs:line 297 [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Targets\Microsoft.NETCore.Targets.pkgproj]
Error when creating nuget lib package from C:\Users\gotos\source\repos\corefx2\artifacts\packages\Debug\specs\Microsoft.NETCore.Platforms.nuspec. System.ArgumentOutOfRangeException: The DateTimeOffset specified cannot be converted into a Zip file timestamp. (Parameter 'value') [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
at NuGet.Packaging.PackageBuilder.Save(Stream stream) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
at Microsoft.DotNet.Build.Tasks.Packaging.NuGetPack.Pack(String nuspecPath, String nupkgPath, Manifest manifest, Boolean packSymbols) in /_/src/Microsoft.DotNet.Build.Tasks.Packaging/src/NuGetPack.cs:line 297 [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms\Microsoft.NETCore.Platforms.pkgproj]
Error when creating nuget lib package from C:\Users\gotos\source\repos\corefx2\artifacts\packages\Debug\specs\Microsoft.NETCore.Platforms.Future.nuspec. System.ArgumentOutOfRangeException: The DateTimeOffset specified cannot be converted into a Zip file timestamp. (Parameter 'value') [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
at NuGet.Packaging.PackageBuilder.Save(Stream stream) [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
at Microsoft.DotNet.Build.Tasks.Packaging.NuGetPack.Pack(String nuspecPath, String nupkgPath, Manifest manifest, Boolean packSymbols) in /_/src/Microsoft.DotNet.Build.Tasks.Packaging/src/NuGetPack.cs:line 297 [C:\Users\gotos\source\repos\corefx2\pkg\Microsoft.NETCore.Platforms.Future\Microsoft.NETCore.Platforms.Future.pkgproj]
Running on Windows 10 Pro Insider Edition (18990) Korean, x64. Ran build on the VS2019 preview CMD (Currently have VS Community edition 16.4 P1 installed), clean clone from the latest state of the master branch (@ https://github.com/dotnet/corefx/commit/296c0e71ddcc4885d30af18dea829c1923cfdc5c). I can send the binlog file if anyone wants it (can't upload due to size limit).
This looks related to dotnet/core/issues/3388. Is it possible that the nuget you are using in that preview of VS has deterministic timestamps?
/cc @nkolev92
Yeah this is another regression from NuGet's deterministic pack changes. @ViktorHofer and I were seeing this when consuming packages produced from an arcade build that had the deterministic build change, even though we were using an SDK with that change reverted in CoreFx.
If you look at that NuSpec, you'll find one or more of the files being included is coming from another package. The timestamp of that file is going to be broken, since it will be set to minimum UTC, which in your timezone will make it less than minimum.
@ViktorHofer I thought we avoided merging the arcade version with this break?
Is it possible that the nuget you are using in that preview of VS has deterministic timestamps?
I have no idea if it does, but it is possible since I noticed the failure after I updated the VS from 16.3 P4 to 16.4 P1.
It's a fall out from deterministic and this bug is being hit. https://github.com/NuGet/Home/issues/7001
We'll try to fix that in the next NuGet release.
@nkolev92, Wondering when the approximate planned release date is, or if there's a simple workaround/hack (possibly without altering the source/output file)? looks like setting the timezone to UTC may work.
@Gnbrkm41 Please follow the linked issue, I can't commit to an exact timeline just yet.
For a workaround, you can update the timestamp on the problematic file. Based on the hash you shared that would be:
C:\Users\<userName>\.nuget\packages\microsoft.dotnet.build.tasks.packaging\5.0.0-beta.19473.5\build\content\_._
Simply opening and saving that file should fix this. FWIW, I don;t see the issue when using the latest master, do you?
looking at the issue it seemed to happen for machines that are ahead of UTC (I'm on UTC +9). I had the same issue a couple days ago on the latest master.
Yes, it is time-zone dependent. The problem packages with bad timestamps were coming from arcade. Arcade should have seen a fix with https://github.com/dotnet/arcade/commit/fa55d892ce5c6a3d624ffd6e322cb2581019e176, which would have hit corefx in https://github.com/dotnet/corefx/commit/2f77d4236a1de29300b9286a5c31bc1be642bc0f. I don't think you should be hitting this any more from tip of master.
Double check that you're on tip, delete your artifacts folder, and build from root and it should go away.
:mips-interest