Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Date Modified on dll causing issues with Nuget #47

Open
kinjiru opened this issue May 13, 2020 · 0 comments
Open

Missing Date Modified on dll causing issues with Nuget #47

kinjiru opened this issue May 13, 2020 · 0 comments

Comments

@kinjiru
Copy link

kinjiru commented May 13, 2020

When attempting to include Geo.dll in a nuget package the packaging fails with error 'The DateTimeOffset specified cannot be converted into a Zip file timestamp' because Geo.dll's Modified date is empty.

I believe nuget pack calls the CreateEntryFromFile method documented below, which sets the file's date in the nuget package to the file's Modified date:
https://docs.microsoft.com/en-us/dotnet/api/system.io.compression.zipfileextensions.createentryfromfile?view=netframework-4.7.2

As a workaround our CI process performs this step to set the Modified date before packaging:
gci -path "geo.dll" -rec -file *.dll | Where-Object {$_.LastWriteTime -lt (Get-Date).AddYears(-20)} | % { try { $_.LastWriteTime = '01/01/2020 00:00:00' } catch {} }

Note this was not an issue with Nuget 4.5, but is an issue with Nuget 5.4. From the link above it appears that it would be an issue with Nuget > 4.6
Proposed solution:
Update Geo.dll build process to set the file's Modified date (same as Created date?)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant