Orchardcore: The DateTimeOffset specified cannot be converted into a Zip file timestamp.

Created on 4 Oct 2019  路  18Comments  路  Source: OrchardCMS/OrchardCore

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: https://github.com/NuGet/Home/issues/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

P1

Most helpful comment

There @hishamco, I fixed it ;)

All 18 comments

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

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

Can you share some repro steps?

Ok, let's close the issue than.

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).

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

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

There @hishamco, I fixed it ;)

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

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

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

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

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:
https://github.com/natemcmaster/CommandLineUtils/commit/464ca463518aab43a6aef76f93005359ce5bb7ea

Same problem with .NET Core 3.1

image

Any ideas?

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.

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 :)

@ebicoglu awesome, thanks

With PowerShell:

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

Cheers!

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 {} }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

randaratceridian picture randaratceridian  路  3Comments

jeffolmstead picture jeffolmstead  路  4Comments

cbadger360 picture cbadger360  路  4Comments

jardg picture jardg  路  3Comments

mobinzk picture mobinzk  路  4Comments