[Bug]: Missing "Date modified" causes dotnet-pack to fail
alsami opened this issue · 6 comments
Hey guys,
I update some dependencies in one of the projects at work and wanted to create a new version of that project which uses Autofac.Extensions.DependencyInjection
.
When I tried running dotnet pack
I received that weird error:
error : The DateTimeOffset specified cannot be converted into a Zip file timestamp
I googled a litttle bit and found out that this might be related to some assembly missing the modified date and indeed, the latest version does miss this date.
Downgrading again to version 4.4.0 fixed that issue for me.
Anyone knows how this happened and how it can be fixed? We might want to create a new release with a fix and update dependent Autofac-Libs like Autofac.AspNetCore.Multitenant
.
Best regards,
Sami
IIRC, modified dates are part of the filesystem metadata, and not stored in the file itself. Worth looking into from that angle, anyway.
IIRC, modified dates are part of the filesystem metadata, and not stored in the file itself. Worth looking into from that angle, anyway.
It looks like the bug was caused by nuget itself and should be fixed now. More information can also be found here.
Since I cannot, would someone be so kind to create a new version to address the issue?
Looking at Autofac.Extensions.DependencyInjection v5.0.0 tag, it appears it was built/packaged with the release version of .NET Core 3.0 SDK, not with the preview version. This comment indicates the issue was fixed in this version.
I just kicked off an AppVeyor build of the develop
branch again. No code changes have been made, it's still ostensibly building with .NET Core 3.0.100, but we can see if the package that gets pushed to MyGet has the date present on the assembly. If it doesn't, we may need to manually set that <Deterministic>false</Deterministic>
thing in the project to force the fix.
At least from a cursory test it appears this is fixed just by building it again, even though no code has changed, nor has the pinned SDK.
@alsami can you verify that 5.0.0-develop-00417
from MyGet comes across for you with the date correct? If it does, I'll increment to 5.0.1 to force the rebuild and do the whole publish routine. I don't think we can really "overwrite" an existing published package due to caching and such. 😞
Install-Package Autofac.Extensions.DependencyInjection -Version 5.0.0-develop-00417 -Source https://www.myget.org/F/autofac/api/v3/index.json
@alsami can you verify that
5.0.0-develop-00417
from MyGet comes across for you with the date correct?
Looks good now mate!
Yeah, sadly it's not possible this problem will only concern users, who included that package in another package. For everyone else it shouldn't be a problem.
Rebuilt and pushed as 5.0.1.