You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes NuGet lock files so they're more correct/compliant.
### Type of Change
- Bug fix (non-breaking change which fixes an issue)
### Why
We recently updated to WinAppSDK 1.7 and have made other changes to the flavors we build (with different dependencies) so our lock files were out of date / constantly overriding one another.
### What
This PR fixes NuGet lock files so they're more correct/compliant. This includes:
1. Updating the `NuGetRestoreForceEvaluateAllSolutions.ps1` script to completely fix the lock files
2. Ensuring every project has a proper `packages.lock.json` file for its default configuration
3. Ensuring projects that are built old AND new arch also have a separate `newarch` lock file
4. Ensuring projects that are build with/without experimental WinUI3 also have a separate `experimentalwinui3` lock file
5. Causing an (optional) CI build error if the lock files change during the build (they shouldn't) with message to re-run the script
6. Removed all unnecessary `packages.config` files which confuse NuGet restoration
## Screenshots
N/A
## Testing
Verified no complaints about changed lock files after builds in the pipeline.
## Changelog
Should this change be included in the release notes: _no_
Copy file name to clipboardExpand all lines: .ado/jobs/e2e-test.yml
+1
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ jobs:
84
84
buildPlatform: ${{ matrix.BuildPlatform }}
85
85
buildLogDirectory: $(BuildLogDirectory)
86
86
workingDirectory: packages/e2e-test-app
87
+
errorOnNuGetLockChanges: false # Sometimes the content hashes of NuGet packages are wrong on VMs, workaround for later .NET versions don't work for UWP C#.
errorOnNuGetLockChanges: false # Sometimes the content hashes of NuGet packages are wrong on VMs, workaround for later .NET versions don't work for UWP C#.
$msg = "Detected NuGet lock file changes during the build. Run vnext/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 locally in a VS Dev PowerShell to update lock files, then submit the changes."
16
+
if ("${{ parameters.errorOnNuGetLockChanges }}" -eq "True") {
17
+
Write-Host "##vso[task.logissue type=error]Detected NuGet lock file changes during the build. Run vnext/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 locally in a VS Dev PowerShell to update lock files, then submit the changes."
18
+
[Environment]::Exit(-1)
19
+
}
20
+
}
21
+
displayName: Detect NuGet lock file changes during build
0 commit comments