Skip to content

Pack or extract of package does not preserve timestamps on file attributes #5240

Closed

Description

@BlairPaine

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?

Appears to be related/replica of:
NuGet do not honor time-stamps when unpacking nupkg files #420
Set proper file timestamp when copying from unzipped folder #188

Details about Problem

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

nuget.exe pack -Version -OutputDirectory
nuget.exe install -Source -OutputDirectory

Activity

  1. mirecg commented on May 30, 2017

    @mirecg

    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.

  2. pepone commented on Jun 20, 2017

    @pepone

    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.

  3. BlairPaine commented on Sep 26, 2017

    @BlairPaine
    Author

    Thanks for the feedback. Can anyone tell me how I can get a NuGet developer to look into this and fix?

  4. rocker8942 commented on Oct 9, 2017

    @rocker8942

    Hi,

    I have the same issue. @mirecg seems pointed out exact spot. Can anyone help on this?

  5. added
    help wanted
    on Nov 9, 2017
  6. added this to the Backlog milestone on Nov 9, 2017
  7. added
    Priority:2
    on Nov 9, 2017
  8. mishra14 commented on Nov 9, 2017

    @mishra14
    Contributor

    it seems that NuGet/NuGet.Client#188 did not fix this. Tagging @rohit21agrawal for visibility.

  9. ghost added
    Status:Inactive
    on Sep 1, 2022
  10. added
    Priority:3
    and removed
    Priority:2
    on Apr 3, 2023
  11. dotnet-policy-service commented on Mar 9, 2026

    @dotnet-policy-service
    Contributor

    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.

  12. dotnet-policy-service commented on Mar 24, 2026

    @dotnet-policy-service
    Contributor

    This issue will now be closed since it had been marked Icebox cleanup candidate, but received no further activity in the past 14 days.

  13. removed this from the Backlog milestone on Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Functionality:PackIcebox cleanup candidatePriority:3Product:NuGet.exeStatus:Inactivehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions