CommonBuildToolset / CBT.Modules

Modules for CBT
MIT License
9 stars 5 forks source link

NuGetAssetsLock.props has lower or upper case on different dev machines. #295

Open huajunzhao opened 4 years ago

huajunzhao commented 4 years ago

Hi,

We're having the same issue as mentioned in this issue: https://github.com/CommonBuildToolset/CBT.Modules/issues/280

How can we use your fix in our project?

jeffkl commented 4 years ago

The latest version of the package should contain the fix. You can also try out the official NuGet lock file feature instead: https://devblogs.microsoft.com/nuget/enable-repeatable-package-restores-using-a-lock-file/

huajunzhao commented 4 years ago

@jeffkl I just set <EnableNuGetDeterministic>False</EnableNuGetDeterministic> in .csproj which helps disable generating NuGetAssetsLock.props. Is this safe? What's the difference for"official Nuget lock file feature" you mentioned from NuGetAssetsLock.props? We have a couple of ASP.NET Core and .NET core projects, are these Nuget lock mechanism is a must? What's the recommendation option?

huajunzhao commented 4 years ago

@jeffkl According to your recommendation, we switch to use <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> to achieve the same functionality.

However our official build failed after configuring this. The errors are:

0>MSBUILD : error : NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\src\AadApplicationEv2Extension\AadApplicationEv2Extension.csproj
     0>MSBUILD : error :     NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\src\Common.Utilities\Common.Utilities.csproj
     0>MSBUILD : error :     NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\test\Common.Tests\Common.Tests.csproj
     0>MSBUILD : error :     NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\src\MsftDomainEv2Extension\MsftDomainEv2Extension.csproj
     0>MSBUILD : error :     NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\src\KeyVaultEv2Extension\KeyVaultEv2Extension.csproj
     0>MSBUILD : error :     NU1403: The package System.Threading.ThreadPool.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\test\AadApplicationEv2Extension.Test\AadApplicationEv2Extension.Test.csproj
     0>MSBUILD : error :     NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     0>MSBUILD : error : Errors in X:\bt\1073396\repo\src\MsftDomainEv2ExtensionTest\MsftDomainEv2ExtensionTest.csproj
     0>MSBUILD : error :     NU1403: The package runtime.native.System.IO.Compression.4.3.0 sha512 validation failed. The package is different than the last restore.
     1>X:\bt\1073396\repo\build\CBT\build.props(96,5): error CBT.NuGet.1003: Traversal packages were not restored and the build cannot continue.  Refer to other errors for more information. [X:\bt\1073396\repo\dirs.proj]

Can you please advise further how to resolve it? Here is the build pipepline https://msazure.visualstudio.com/One/_build/results?buildId=27866486&view=results

jeffkl commented 4 years ago

I'm not too familiar yet with NuGet's lock file features. I'd imagine you have packages coming from two different feeds with the same content but different hashes. You can work directly with the NuGet folks on this as well since its an externally shipped, fully supported feature.