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

The DateTimeOffset specified cannot be converted into a Zip file timestamp. #4477

Closed
fernandoweiler opened this issue Oct 4, 2019 · 18 comments
Labels
Milestone

Comments

@fernandoweiler
Copy link

image

Having an error with the released .net core 3.0. Right click on project and on Pack:

image

If the PackageReference for OrchardCore.Module.Targets is removed, the error is gone. The error was seen here before: NuGet/Home#7001

Microsoft Visual Studio Community 2019
Version 16.3.2
VisualStudio.16.Release/16.3.2+29326.143
Microsoft .NET Framework
Version 4.8.03752
Installed Version: Community
Application Insights Tools for Visual Studio Package 9.1.00913.1
Application Insights Tools for Visual Studio
ASP.NET and Web Tools 2019 16.3.283.64955
ASP.NET and Web Tools 2019
ASP.NET Web Frameworks and Tools 2019 16.3.283.64955
For additional information, visit https://www.asp.net/
Azure App Service Tools v3.0.0 16.3.283.64955
Azure App Service Tools v3.0.0
Azure Functions and Web Jobs Tools 16.3.283.64955
Azure Functions and Web Jobs Tools
C# Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
IntelliCode Extension 1.0
IntelliCode Visual Studio Extension Detailed Info
Microsoft Azure Tools 2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.20816.1
Microsoft Continuous Delivery Tools for Visual Studio 0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.
Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines
Microsoft Library Manager 2.0.83+gbc8a4b23ec
Install client-side libraries easily to any web project
Microsoft MI-Based Debugger 1.0
Provides support for connecting Visual Studio to MI compatible debuggers
Microsoft Visual Studio Tools for Containers 1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.
NuGet Package Manager 5.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/
Productivity Power Tools 2017/2019 16.0
Installs the individual extensions of Productivity Power Tools 2017/2019
ProjectServicesPackage Extension 1.0
ProjectServicesPackage Visual Studio Extension Detailed Info
SQL Server Data Tools 16.0.61908.27190
Microsoft SQL Server Data Tools
TypeScript Tools 16.0.10821.2002
TypeScript Tools for Microsoft Visual Studio
Visual Basic Tools 3.3.1-beta3-19461-02+2fd12c210e22f7d6245805c60340f6a34af6875b
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.
Visual F# Tools 10.4 for F# 4.6 16.3.0-beta.19455.1+0422ff293bb2cc722fe5021b85ef50378a9af823
Microsoft Visual F# Tools 10.4 for F# 4.6
Visual Studio Code Debug Adapter Host Package 1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio
Visual Studio Tools for Containers 1.0
Visual Studio Tools for Containers

@sebastienros
Copy link
Member

It's a Nuget/VS bug, and I assume we'll have to re-publish the packages to fix it.

@sebastienros
Copy link
Member

It should be fixed in Nuget 5.3 NuGet/Home#8599
So it's maybe because one of the packages we reference was published with a faulty version.

Can you share some repro steps?

@sebastienros sebastienros added this to the 1.0 milestone Oct 4, 2019
@fernandoweiler
Copy link
Author

fernandoweiler commented Oct 4, 2019

Ok, let's close the issue than.

@fernandoweiler
Copy link
Author

It should be fixed in Nuget 5.3 NuGet/Home#8599
So it's maybe because one of the packages we reference was published with a faulty version.

Can you share some repro steps?

I just followed exactly what was shown here: https://youtu.be/yrQaKv2mxFU (starting on 4:40).

@neman
Copy link
Contributor

neman commented Oct 15, 2019

I got the same error, here are the repro steps (cc @sebastienros ):

  1. I installed OC Templates dotnet new -i OrchardCore.ProjectTemplates::1.0.0-rc1-10004

  2. I created new project dotnet new ocmodulecms -n CmsPart -A true -P Nemke

  3. I tried dotnet pack and got the following

image

I got the same error when I check Generate NuGet package on build in VS

image

@hishamco
Copy link
Member

@neman please file a new instead of replying to a closed issue

@sebastienros sebastienros reopened this Oct 15, 2019
@sebastienros
Copy link
Member

There @hishamco, I fixed it ;)

@sebastienros
Copy link
Member

I will try to repro locally as you provided the steps.

@neman
Copy link
Contributor

neman commented Oct 15, 2019

I also tried

dotnet new -i OrchardCore.ProjectTemplates::1.0.0-rc1-10222 --nuget-source https://www.myget.org/F/orchardcore-preview/api/v3/index.json

Template does not build at all. After I commented some code to make it buildable, pack command did work. It might be fixed on dev branch

@lakuri
Copy link
Contributor

lakuri commented Oct 28, 2019

image-2019-10-24-10-12-28-034

@lakuri
Copy link
Contributor

lakuri commented Nov 6, 2019

@sebastienros Will there be re-publishing of packages or an intermediate release?

@sebastienros
Copy link
Member

Apparently if you upgrade to the latest sdk (3.0.100) then it should fix the issue.
Also this only happens if your timezone is positive to UTC.

A workaround is to disable deterministic packages like this:
natemcmaster/CommandLineUtils@464ca46

@lurumad
Copy link

lurumad commented Dec 4, 2019

Same problem with .NET Core 3.1

image

Any ideas?

@sebastienros
Copy link
Member

Republishing would only be part of the solution, we need to find all the packages that we reference and are also "poisoned". Could someone try to find these packages? It should be doable by doing a publish folder, and look at any assembly and if their metadata for a timestamp that is MinValue.

@ebicoglu
Copy link

I made a console app to fix invalid dates in a drive.
https://github.com/ebicoglu/FileBulkDateChanger

Usage:
FileBulkDateChanger.exe C:\

Run this tool and forget about this issue :)

@sebastienros
Copy link
Member

@ebicoglu awesome, thanks

@lurumad
Copy link

lurumad commented Dec 19, 2019

With PowerShell:

dotnet publish
Get-ChildItem -File -Recurse | % {$_.LastWriteTime = (Get-Date)}
dotnet pack --no-build

Cheers!

@ebicoglu
Copy link

ebicoglu commented Apr 4, 2020

My solution:

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:\.

gci -path "C:\" -rec -file *.dll | Where-Object {$_.LastWriteTime -lt (Get-Date).AddYears(-20)} | %  { try { $_.LastWriteTime = '01/01/2000 00:00:00' } catch {} }

Goosemaner pushed a commit to Goosemaner/EFCore-Bulk-Extensions that referenced this issue Jun 15, 2022
Problem:
When you install Microsoft.EntityFrameworkCore.Sqlite 3.1.0 you can see dlls without modify date. It cause to "The DateTimeOffset specified cannot be converted into a Zip file timestamp" when you try to pack my program.
Solution:
Update lib version

related problem
NuGetPackageExplorer/NuGetPackageExplorer#269
OrchardCMS/OrchardCore#4477
NuGet/Home#7001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants