You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pack or extract of package does not preserve timestamps on file attributes #5240
When I pack or unpack (install) with nuget it does not preserve the timestamps on included files. For example the date created and date modified attributes. I can see files in my package have been stamped with the date and time of package creation.
Were the changes for the above issues fixed and merged correctly?
NuGet.exe version = 4.1.0.2450 (also tried 3.3.0.212 and 3.4.4.1321)
.NET version = 4.6.01590
OS version = Windows Server 2012 R2 (6.3.9600)
Worked before? = Not for me.
Detailed repro steps so we can see the same problem
Hi, I'm having the same requirements like you and like most users out there.
I'm using nuget 3.5.0.1938 and my experience is little bit different.
For me install command respects the file timestamps and extracts files with the correct timestamp. This seems that was fixed in #420.
But the problem remains in pack command, which sets the timestamps to the current time for all packed files. So the fix of install command doesn't have desired effect.
Seems part of the problem is how the Zip entries are created in PackageBuilder.cs one possible fix is to set the LastWriteTime using the time from the file with the given path.
Due to lack of recent activity, this issue has been marked as a candidate for icebox cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will add a Triage:NeedsTriageDiscussion label and lead to a triaging process.
This process is part of the experimental Stale icebox issues cleanup we are currently trialing. Please share any feedback you might have in the linked issue.
Activity
mirecg commentedon May 30, 2017
Hi, I'm having the same requirements like you and like most users out there.
I'm using nuget 3.5.0.1938 and my experience is little bit different.
For me install command respects the file timestamps and extracts files with the correct timestamp. This seems that was fixed in #420.
But the problem remains in pack command, which sets the timestamps to the current time for all packed files. So the fix of install command doesn't have desired effect.
pepone commentedon Jun 20, 2017
Hi,
Seems part of the problem is how the Zip entries are created in PackageBuilder.cs one possible fix is to set the LastWriteTime using the time from the file with the given path.
BlairPaine commentedon Sep 26, 2017
Thanks for the feedback. Can anyone tell me how I can get a NuGet developer to look into this and fix?
rocker8942 commentedon Oct 9, 2017
Hi,
I have the same issue. @mirecg seems pointed out exact spot. Can anyone help on this?
mishra14 commentedon Nov 9, 2017
it seems that NuGet/NuGet.Client#188 did not fix this. Tagging @rohit21agrawal for visibility.
dotnet-policy-service commentedon Mar 9, 2026
Due to lack of recent activity, this issue has been marked as a candidate for icebox cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will add a
Triage:NeedsTriageDiscussionlabel and lead to a triaging process.This process is part of the experimental Stale icebox issues cleanup we are currently trialing. Please share any feedback you might have in the linked issue.
dotnet-policy-service commentedon Mar 24, 2026
This issue will now be closed since it had been marked Icebox cleanup candidate, but received no further activity in the past 14 days.