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
Crash on opening push dialog/save: The DateTimeOffset specified cannot be converted into a Zip file timestamp.' #269
What is the expected result? showing popup for push
Please post full exception details in case of an Exception (message, stacktrace, inner exceptions)
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=The DateTimeOffset specified cannot be converted into a Zip file timestamp.
Parameter name: value
Source=System.IO.Compression
StackTrace:
at System.IO.Compression.ZipArchiveEntry.set_LastWriteTime(DateTimeOffset value)
at NuGet.Packaging.PackageBuilder.CreatePart(ZipArchive package, String path, Stream sourceStream, DateTimeOffset lastWriteTime)
at NuGet.Packaging.PackageBuilder.WriteFiles(ZipArchive package, HashSet`1 filesWithoutExtensions)
at NuGet.Packaging.PackageBuilder.Save(Stream stream)
at PackageExplorerViewModel.PackageHelper.SavePackage(IPackageMetadata packageMetadata, IEnumerable`1 files, String targetFilePath, Boolean useTempFile) in X:\_github\NuGetPackageExplorer\PackageViewModel\Utilities\PackageHelper.cs:line 34
Are there any work arrounds? no
Is there a version in which it did worked? not checked
Is there a package on Nuget.org which shows the bug?
Nlog 4.4.12
changed the title [-]Push bug: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/-][+]Crash on opening push dialog: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/+]on Dec 11, 2017
changed the title [-]Crash on opening push dialog: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/-][+]Crash on opening push dialog/save: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/+]on Dec 11, 2017
I think that should work long as that doesn't throw. AFAIK, the base is set to the directory the nuspec file is in. NPE doesn't support specifying an alternate base directory.
304NotModified + this still appears to be an issue when creating a new package with several files and folders. Upon saving (as) the program will hang and eventually respond with "DateTimeOffset specified cannot be converted into a zip file timestamp. It seems to work fine with a smaller amount of files and/or saving the initial package with a smaller amount of files and adding more in after each save. I have an older stable release in my repository which does not report this issue.
@ItsMrQ can you repro on the current CI version? The one that has these changes has not been in a stable release yet. Otherwise, please open a new issue with a repro.
Unfortunally, i don't know... I start NPE (used the CI setup on the main github page) leave the metadata as default, add a lib folder, add an empty net45 folder and click save. It does not save and says the error like above.
Latest Windows 10, .NET 4.7.1 installed (which i was trying to create a package for)
Run the below Powershell script.
It sets all the invalid DLL dates to 01/01/2000.
Change the path parameter for your computer.
My GitHub repositories are on my C drive so I'm running this -path C:\.
Activity
[-]Push bug: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/-][+]Crash on opening push dialog: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/+]304NotModified commentedon Dec 11, 2017
mmm same for save and with a new package.
Setting current culture on en-US won't help (or maybe too late)
@onovotny any idea?
[-]Crash on opening push dialog: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/-][+]Crash on opening push dialog/save: The DateTimeOffset specified cannot be converted into a Zip file timestamp.'[/+]clairernovotny commentedon Dec 11, 2017
Is this a localization thing? Is there a sample? What's the DateTimeOffset that's failing?
Isn't there a new
LastWriteTimeon the file metadata? we could be defaulting it to minvalue, but we probably need to handle it and set it correctly.304NotModified commentedon Dec 11, 2017
I don't know where there is a DateTimeOffset. I'm debugging it
clairernovotny commentedon Dec 11, 2017
Here it is:
ec476eb#diff-aab7ef1f82c6b9b12128e7accb3ec08aR66
I stubbed it out, guess we need to populate it.
304NotModified commentedon Dec 11, 2017
public DateTimeOffset LastWriteTime => DateTimeOffset.MinValue;?think so, seeing this call stack:
304NotModified commentedon Dec 11, 2017
any idea if we could use
File.LastAccessTime(path)?as we only have a partial path of course
clairernovotny commentedon Dec 11, 2017
I think that should work long as that doesn't throw. AFAIK, the base is set to the directory the nuspec file is in. NPE doesn't support specifying an alternate base directory.
304NotModified commentedon Dec 11, 2017
it gives also minValue.
I could read the content of the file (e.g. dll) as stream in
NuGetPackageExplorer/Core/Packages/ZipPackageFile.cs
Line 17 in 5d966e2
but that doesn't have a lastWriteTime of course.
304NotModified commentedon Dec 11, 2017
ah found it, but now thinking where this code should be added
304NotModified commentedon Dec 11, 2017
I think i'm almost there
Fix The DateTimeOffset specified cannot be converted into a Zip file …
qgjevukaj commentedon Dec 30, 2017
304NotModified + this still appears to be an issue when creating a new package with several files and folders. Upon saving (as) the program will hang and eventually respond with "DateTimeOffset specified cannot be converted into a zip file timestamp. It seems to work fine with a smaller amount of files and/or saving the initial package with a smaller amount of files and adding more in after each save. I have an older stable release in my repository which does not report this issue.
clairernovotny commentedon Dec 30, 2017
@ItsMrQ can you repro on the current CI version? The one that has these changes has not been in a stable release yet. Otherwise, please open a new issue with a repro.
Thanks!
delasource commentedon Jan 25, 2018
I can confirm that the error still happens on the new CI version. I can't use NPE anymore. It seems to have affected the whole program
clairernovotny commentedon Jan 25, 2018
@GENYX can you share a repro?
delasource commentedon Jan 25, 2018
Unfortunally, i don't know... I start NPE (used the CI setup on the main github page) leave the metadata as default, add a lib folder, add an empty net45 folder and click save. It does not save and says the error like above.
Latest Windows 10, .NET 4.7.1 installed (which i was trying to create a package for)
clairernovotny commentedon Jan 25, 2018
Thanks, should be fixed in #325
delasource commentedon Jan 25, 2018
Yes, that fixed it for me. thanks
WspDev commentedon Feb 13, 2018
I got this issue when I had an empty folder under a net folder under lib.
Putting files in it solved the issue.
[Edit] Using version 4.0.9 [/Edit]
ebicoglu commentedon Apr 4, 2020
My solution:
Run the below Powershell script.
It sets all the invalid DLL dates to 01/01/2000.
Change the
pathparameter for your computer.My GitHub repositories are on my
Cdrive so I'm running this-path C:\.Fix dotnet pack error with Sqlite package