Sdk: dotnet pack nuget package don't contains update time on file attributes

Created on 19 Sep 2019  路  2Comments  路  Source: dotnet/sdk

Steps to reproduce

Just run: dotnet pack on a project folder.

Expected behavior

Dll file on nuget package should contains update time attribute.
image

Actual behavior

But it fixed to 01/01/1980
image

Environment data

dotnet --info output:

 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-rc2-014266\

Host (useful for support):
  Version: 3.0.0
  Commit:  7d57652f33

Note:

  • I'm experience this issue on just .NET Core 3.0, maybe since preview9(or earlier).
  • When I using dotnet pack on .NET Core SDK 2.2, this is all good.
  • If I create nuget package using msbuild.exe or by nuget pack {projectFile} -build, this is also all good.

Most helpful comment

I also met this problem. It causes my deployment tool (like Azure DevOps web deploy) not overriding server dll with new version of dll because it's modified time is empty, and eventually caused a .NET runtime exception for unable to load some assembly.

Just unzip the nupkg that dotnet pack has built, you will find the dll is missing modifed time:

image

My workaround on a local machine:

  1. Open the nupkg with "NuGet Package Explorer".
  2. Replace the dll with the one in "binrelease" folder.
  3. Save the changes to this nupkg file.
  4. Upload to NuGet server.

But I can't do a workaround on CI/CD environments. So I think this need to be fixed ASAP.

All 2 comments

I also met this problem. It causes my deployment tool (like Azure DevOps web deploy) not overriding server dll with new version of dll because it's modified time is empty, and eventually caused a .NET runtime exception for unable to load some assembly.

Just unzip the nupkg that dotnet pack has built, you will find the dll is missing modifed time:

image

My workaround on a local machine:

  1. Open the nupkg with "NuGet Package Explorer".
  2. Replace the dll with the one in "binrelease" folder.
  3. Save the changes to this nupkg file.
  4. Upload to NuGet server.

But I can't do a workaround on CI/CD environments. So I think this need to be fixed ASAP.

We have already addressed this problem. A fix for it will ship with the 3.0.100 GA SDK version.

Was this page helpful?
0 / 5 - 0 ratings