scottksmith95 / LINQKit

LINQKit is a free set of extensions for LINQ to SQL and Entity Framework power users.
MIT License
1.65k stars 165 forks source link

File timestamps in nuget are the same causing publish to fail #157

Closed jesslilly closed 2 years ago

jesslilly commented 2 years ago

I don't know if this is even something you can fix, but I will report it anyway. Maybe it will help someone out there who runs into this same issue.

We package our applications on a build server using this powershell command:

$MsBuild $StartUpProjectFilePath /t:Publish /p:PublishProfile=$PublishProfile /p:PackageLocation=Package\$AppEnvironment\$StartUpProjectName.zip

We recently upgraded an app from .NET Core 3.1 to .NET 6. Also we upgraded LinqKit.Microsoft.EntityFrameworkCore from 3.1.27 to 6.0.27. MsBuild errantly published the 3.1.27 version of the assembly and our application failed to run. This is because msbuild (package) by default uses timestamps. I think you can set it up to use hashcodes or GUIDs or something else, but the documentation on that is sketchy. Anyway, LinqKit.Microsoft.EntityFrameworkCore from 3.1.27 to 6.0.27 have the exact same timestamp on our build server: Saturday, ‎November ‎13, ‎2021, ‏‎7:15:24 AM. (I'm in UTC-5) This is in the nuget cache.

So I downloaded both versions onto my own PC and indeed they have the same timestamp: ‎Saturday, ‎November ‎13, ‎2021, ‏‎12:15:24 PM (UTC)

Could you update the timestamp on the version 6 of the dll in nuget?

StefH commented 2 years ago

I am confused.

How could the timestamp from a NuGet package be of any influence?

StefH commented 2 years ago

@jesslilly Can you elaborate please?

jesslilly commented 2 years ago

Hi Stef. Yeah like I said, there is probably not much you can do. We have an app in which we changed from Linqkit 3.1.27 to 6.0.27. Using MSFT Package Deployment (Similar to a publish profile), our package failed to include the correct version of Linqkit because the timestamps in NuGet are the exact same for both of these dll file versions.

StefH commented 2 years ago

@jesslilly

I don't know how to add hashcodes or GUIDs.

But maybe this can help? --> https://github.com/scottksmith95/LINQKit/pull/166

jesslilly commented 2 years ago

Interesting! Sounds cool.

StefH commented 2 years ago

Within some days, I'll release a new version with this PR. Then you can test if it solves your issue.