dependabot-nuget 0.245.0 → 0.246.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. checksums.yaml +4 -4
  2. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/PackagesConfigUpdater.cs +42 -7
  3. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/SdkPackageUpdater.cs +164 -90
  4. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Updater/UpdaterWorker.cs +38 -2
  5. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +57 -17
  6. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/NuGetHelper.cs +1 -1
  7. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +115 -14
  8. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/{UpdateWorker.DirsProj.cs → UpdateWorkerTests.DirsProj.cs} +22 -24
  9. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +66 -0
  10. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +355 -83
  11. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +7 -4
  12. data/lib/dependabot/nuget/file_parser/project_file_parser.rb +0 -4
  13. data/lib/dependabot/nuget/file_parser.rb +15 -1
  14. data/lib/dependabot/nuget/http_response_helpers.rb +14 -0
  15. data/lib/dependabot/nuget/metadata_finder.rb +6 -2
  16. data/lib/dependabot/nuget/nuget_client.rb +8 -13
  17. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +23 -13
  18. data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +75 -11
  19. data/lib/dependabot/nuget/update_checker/repository_finder.rb +4 -10
  20. data/lib/dependabot/nuget/update_checker.rb +2 -3
  21. metadata +7 -7
  22. data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/SdkPackageUpdaterTests.cs +0 -317
@@ -30,7 +30,7 @@ public partial class UpdateWorkerTests
30
30
  <PropertyGroup>
31
31
  <TargetFramework>{tfm}</TargetFramework>
32
32
  </PropertyGroup>
33
-
33
+
34
34
  <ItemGroup>
35
35
  <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
36
36
  </ItemGroup>
@@ -42,7 +42,7 @@ public partial class UpdateWorkerTests
42
42
  <PropertyGroup>
43
43
  <TargetFramework>{tfm}</TargetFramework>
44
44
  </PropertyGroup>
45
-
45
+
46
46
  <ItemGroup>
47
47
  <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
48
48
  </ItemGroup>
@@ -50,6 +50,149 @@ public partial class UpdateWorkerTests
50
50
  """);
51
51
  }
52
52
 
53
+ [Fact]
54
+ public async Task UpdateVersionChildElement_InProjectFile_ForPackageReferenceInclude()
55
+ {
56
+ // update Newtonsoft.Json from 9.0.1 to 13.0.1
57
+ await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
58
+ // initial
59
+ projectContents: $"""
60
+ <Project Sdk="Microsoft.NET.Sdk">
61
+ <PropertyGroup>
62
+ <TargetFramework>netstandard2.0</TargetFramework>
63
+ </PropertyGroup>
64
+ <ItemGroup>
65
+ <PackageReference Include="Newtonsoft.Json">
66
+ <Version>9.0.1</Version>
67
+ </PackageReference>
68
+ </ItemGroup>
69
+ </Project>
70
+ """,
71
+ // expected
72
+ expectedProjectContents: $"""
73
+ <Project Sdk="Microsoft.NET.Sdk">
74
+ <PropertyGroup>
75
+ <TargetFramework>netstandard2.0</TargetFramework>
76
+ </PropertyGroup>
77
+ <ItemGroup>
78
+ <PackageReference Include="Newtonsoft.Json">
79
+ <Version>13.0.1</Version>
80
+ </PackageReference>
81
+ </ItemGroup>
82
+ </Project>
83
+ """);
84
+ }
85
+
86
+ [Fact]
87
+ public async Task UpdateVersions_InProjectFile_ForDuplicatePackageReferenceInclude()
88
+ {
89
+ // update Newtonsoft.Json from 9.0.1 to 13.0.1
90
+ await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
91
+ // initial
92
+ projectContents: $"""
93
+ <Project Sdk="Microsoft.NET.Sdk">
94
+ <PropertyGroup>
95
+ <TargetFramework>netstandard2.0</TargetFramework>
96
+ </PropertyGroup>
97
+ <ItemGroup>
98
+ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
99
+ <PackageReference Include="Newtonsoft.Json">
100
+ <Version>9.0.1</Version>
101
+ </PackageReference>
102
+ </ItemGroup>
103
+ </Project>
104
+ """,
105
+ // expected
106
+ expectedProjectContents: $"""
107
+ <Project Sdk="Microsoft.NET.Sdk">
108
+ <PropertyGroup>
109
+ <TargetFramework>netstandard2.0</TargetFramework>
110
+ </PropertyGroup>
111
+ <ItemGroup>
112
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
113
+ <PackageReference Include="Newtonsoft.Json">
114
+ <Version>13.0.1</Version>
115
+ </PackageReference>
116
+ </ItemGroup>
117
+ </Project>
118
+ """);
119
+ }
120
+
121
+ [Fact]
122
+ public async Task PartialUpdate_InMultipleProjectFiles_ForVersionConstraint()
123
+ {
124
+ // update Newtonsoft.Json from 12.0.1 to 13.0.1
125
+ await TestUpdateForProject("Newtonsoft.Json", "12.0.1", "13.0.1",
126
+ // initial
127
+ projectContents: $"""
128
+ <Project Sdk="Microsoft.NET.Sdk">
129
+ <PropertyGroup>
130
+ <TargetFramework>netstandard2.0</TargetFramework>
131
+ </PropertyGroup>
132
+ <ItemGroup>
133
+ <PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
134
+ <ProjectReference Include="../Project/Project.csproj" />
135
+ </ItemGroup>
136
+ </Project>
137
+ """,
138
+ additionalFiles:
139
+ [
140
+ (Path: "src/Project/Project.csproj", Content: """
141
+ <Project Sdk="Microsoft.NET.Sdk">
142
+ <PropertyGroup>
143
+ <TargetFramework>netstandard2.0</TargetFramework>
144
+ </PropertyGroup>
145
+ <ItemGroup>
146
+ <PackageReference Include="Newtonsoft.Json" Version="[12.0.1, 13.0.0)" />
147
+ </ItemGroup>
148
+ </Project>
149
+ """),
150
+ ],
151
+ // expected
152
+ expectedProjectContents: $"""
153
+ <Project Sdk="Microsoft.NET.Sdk">
154
+ <PropertyGroup>
155
+ <TargetFramework>netstandard2.0</TargetFramework>
156
+ </PropertyGroup>
157
+ <ItemGroup>
158
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
159
+ <ProjectReference Include="../Project/Project.csproj" />
160
+ </ItemGroup>
161
+ </Project>
162
+ """,
163
+ additionalFilesExpected:
164
+ [
165
+ (Path: "src/Project/Project.csproj", Content: """
166
+ <Project Sdk="Microsoft.NET.Sdk">
167
+ <PropertyGroup>
168
+ <TargetFramework>netstandard2.0</TargetFramework>
169
+ </PropertyGroup>
170
+ <ItemGroup>
171
+ <PackageReference Include="Newtonsoft.Json" Version="[12.0.1, 13.0.0)" />
172
+ </ItemGroup>
173
+ </Project>
174
+ """),
175
+ ]);
176
+ }
177
+
178
+ [Fact]
179
+ public async Task NoChange_WhenPackageHasVersionConstraint()
180
+ {
181
+ // Dependency package has version constraint
182
+ await TestNoChangeforProject("AWSSDK.Core", "3.3.21.19", "3.7.300.20",
183
+ projectContents: $"""
184
+ <Project Sdk="Microsoft.NET.Sdk">
185
+ <PropertyGroup>
186
+ <TargetFramework>netstandard2.0</TargetFramework>
187
+ </PropertyGroup>
188
+ <ItemGroup>
189
+ <PackageReference Include="AWSSDK.S3" Version="3.3.17.3" />
190
+ <PackageReference Include="AWSSDK.Core" Version="3.3.21.19" />
191
+ </ItemGroup>
192
+ </Project>
193
+ """);
194
+ }
195
+
53
196
  [Fact]
54
197
  public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclude_Windows()
55
198
  {
@@ -62,7 +205,7 @@ public partial class UpdateWorkerTests
62
205
  <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
63
206
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
64
207
  </PropertyGroup>
65
-
208
+
66
209
  <ItemGroup>
67
210
  <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
68
211
  </ItemGroup>
@@ -75,7 +218,7 @@ public partial class UpdateWorkerTests
75
218
  <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
76
219
  <RuntimeIdentifier>win-x64</RuntimeIdentifier>
77
220
  </PropertyGroup>
78
-
221
+
79
222
  <ItemGroup>
80
223
  <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
81
224
  </ItemGroup>
@@ -83,6 +226,73 @@ public partial class UpdateWorkerTests
83
226
  """);
84
227
  }
85
228
 
229
+ [Fact]
230
+ public async Task UpdateVersionAttribute_InMultipleProjectFiles_ForPackageReferenceInclude()
231
+ {
232
+ // update Newtonsoft.Json from 9.0.1 to 13.0.1
233
+ await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
234
+ // initial
235
+ projectContents: $"""
236
+ <Project Sdk="Microsoft.NET.Sdk">
237
+ <PropertyGroup>
238
+ <TargetFramework>net8.0</TargetFramework>
239
+ </PropertyGroup>
240
+
241
+ <ItemGroup>
242
+ <ProjectReference Include="lib\Library.csproj" />
243
+ </ItemGroup>
244
+
245
+ <ItemGroup>
246
+ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
247
+ </ItemGroup>
248
+ </Project>
249
+ """,
250
+ additionalFiles:
251
+ [
252
+ ("lib/Library.csproj", $"""
253
+ <Project Sdk="Microsoft.NET.Sdk">
254
+ <PropertyGroup>
255
+ <TargetFramework>net8.0</TargetFramework>
256
+ </PropertyGroup>
257
+
258
+ <ItemGroup>
259
+ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
260
+ </ItemGroup>
261
+ </Project>
262
+ """)
263
+ ],
264
+ // expected
265
+ expectedProjectContents: $"""
266
+ <Project Sdk="Microsoft.NET.Sdk">
267
+ <PropertyGroup>
268
+ <TargetFramework>net8.0</TargetFramework>
269
+ </PropertyGroup>
270
+
271
+ <ItemGroup>
272
+ <ProjectReference Include="lib\Library.csproj" />
273
+ </ItemGroup>
274
+
275
+ <ItemGroup>
276
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
277
+ </ItemGroup>
278
+ </Project>
279
+ """,
280
+ additionalFilesExpected:
281
+ [
282
+ ("lib/Library.csproj", $"""
283
+ <Project Sdk="Microsoft.NET.Sdk">
284
+ <PropertyGroup>
285
+ <TargetFramework>net8.0</TargetFramework>
286
+ </PropertyGroup>
287
+
288
+ <ItemGroup>
289
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
290
+ </ItemGroup>
291
+ </Project>
292
+ """)
293
+ ]);
294
+ }
295
+
86
296
  [Theory]
87
297
  [InlineData("$(NewtonsoftJsonVersion")]
88
298
  [InlineData("$NewtonsoftJsonVersion)")]
@@ -113,7 +323,7 @@ public partial class UpdateWorkerTests
113
323
  var privateNugetContent = """
114
324
  <?xml version="1.0" encoding="utf-8"?>
115
325
  <configuration>
116
-
326
+
117
327
  <packageSources>
118
328
  <clear />
119
329
  <add key="nuget_PrivateFeed" value="https://api.nuget.org/v3/index.json" />
@@ -200,7 +410,7 @@ public partial class UpdateWorkerTests
200
410
  <PropertyGroup>
201
411
  <TargetFramework>net6.0</TargetFramework>
202
412
  </PropertyGroup>
203
-
413
+
204
414
  <ItemGroup>
205
415
  <PackageReference Include="Newtonsoft.Json" Version="[9.0.1]" />
206
416
  </ItemGroup>
@@ -212,7 +422,7 @@ public partial class UpdateWorkerTests
212
422
  <PropertyGroup>
213
423
  <TargetFramework>net6.0</TargetFramework>
214
424
  </PropertyGroup>
215
-
425
+
216
426
  <ItemGroup>
217
427
  <PackageReference Include="Newtonsoft.Json" Version="[13.0.1]" />
218
428
  </ItemGroup>
@@ -228,11 +438,11 @@ public partial class UpdateWorkerTests
228
438
  // initial
229
439
  projectContents: """
230
440
  <Project Sdk="Microsoft.NET.Sdk">
231
-
441
+
232
442
  <PropertyGroup>
233
443
  <TargetFramework>netcoreapp3.1</TargetFramework>
234
444
  </PropertyGroup>
235
-
445
+
236
446
  <ItemGroup>
237
447
  <PackageReference Include="Mongo2Go" Version="3.1.3" />
238
448
  </ItemGroup>
@@ -242,11 +452,11 @@ public partial class UpdateWorkerTests
242
452
  // expected
243
453
  expectedProjectContents: """
244
454
  <Project Sdk="Microsoft.NET.Sdk">
245
-
455
+
246
456
  <PropertyGroup>
247
457
  <TargetFramework>netcoreapp3.1</TargetFramework>
248
458
  </PropertyGroup>
249
-
459
+
250
460
  <ItemGroup>
251
461
  <PackageReference Include="Mongo2Go" Version="3.1.3" />
252
462
  <PackageReference Include="System.Text.Json" Version="5.0.2" />
@@ -267,7 +477,7 @@ public partial class UpdateWorkerTests
267
477
  <PropertyGroup>
268
478
  <TargetFramework>netstandard2.0</TargetFramework>
269
479
  </PropertyGroup>
270
-
480
+
271
481
  <ItemGroup>
272
482
  <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.0">
273
483
  <PrivateAssets>all</PrivateAssets>
@@ -282,7 +492,7 @@ public partial class UpdateWorkerTests
282
492
  <PropertyGroup>
283
493
  <TargetFramework>netstandard2.0</TargetFramework>
284
494
  </PropertyGroup>
285
-
495
+
286
496
  <ItemGroup>
287
497
  <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
288
498
  <PrivateAssets>all</PrivateAssets>
@@ -304,7 +514,7 @@ public partial class UpdateWorkerTests
304
514
  <PropertyGroup>
305
515
  <TargetFramework>netstandard2.0</TargetFramework>
306
516
  </PropertyGroup>
307
-
517
+
308
518
  <ItemGroup>
309
519
  <PackageReference Include="Newtonsoft.JSON" Version="9.0.1" />
310
520
  <PackageReference Update="Newtonsoft.Json" Version="9.0.1" />
@@ -317,7 +527,7 @@ public partial class UpdateWorkerTests
317
527
  <PropertyGroup>
318
528
  <TargetFramework>netstandard2.0</TargetFramework>
319
529
  </PropertyGroup>
320
-
530
+
321
531
  <ItemGroup>
322
532
  <PackageReference Include="Newtonsoft.JSON" Version="13.0.1" />
323
533
  <PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
@@ -337,7 +547,7 @@ public partial class UpdateWorkerTests
337
547
  <PropertyGroup>
338
548
  <TargetFramework>netstandard2.0</TargetFramework>
339
549
  </PropertyGroup>
340
-
550
+
341
551
  <ItemGroup>
342
552
  <PackageReference Include="Newtonsoft.Json" />
343
553
  <PackageReference Update="Newtonsoft.Json" Version="9.0.1" />
@@ -350,7 +560,7 @@ public partial class UpdateWorkerTests
350
560
  <PropertyGroup>
351
561
  <TargetFramework>netstandard2.0</TargetFramework>
352
562
  </PropertyGroup>
353
-
563
+
354
564
  <ItemGroup>
355
565
  <PackageReference Include="Newtonsoft.Json" />
356
566
  <PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
@@ -370,7 +580,7 @@ public partial class UpdateWorkerTests
370
580
  <PropertyGroup>
371
581
  <TargetFramework>netstandard2.0</TargetFramework>
372
582
  </PropertyGroup>
373
-
583
+
374
584
  <ItemGroup>
375
585
  <PackageReference Include="Newtonsoft.Json" />
376
586
  </ItemGroup>
@@ -383,7 +593,7 @@ public partial class UpdateWorkerTests
383
593
  <PropertyGroup>
384
594
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
385
595
  </PropertyGroup>
386
-
596
+
387
597
  <ItemGroup>
388
598
  <PackageVersion Include="Newtonsoft.Json" Version="9.0.1" />
389
599
  </ItemGroup>
@@ -396,7 +606,7 @@ public partial class UpdateWorkerTests
396
606
  <PropertyGroup>
397
607
  <TargetFramework>netstandard2.0</TargetFramework>
398
608
  </PropertyGroup>
399
-
609
+
400
610
  <ItemGroup>
401
611
  <PackageReference Include="Newtonsoft.Json" />
402
612
  </ItemGroup>
@@ -409,7 +619,7 @@ public partial class UpdateWorkerTests
409
619
  <PropertyGroup>
410
620
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
411
621
  </PropertyGroup>
412
-
622
+
413
623
  <ItemGroup>
414
624
  <PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
415
625
  </ItemGroup>
@@ -429,7 +639,7 @@ public partial class UpdateWorkerTests
429
639
  <PropertyGroup>
430
640
  <TargetFramework>netstandard2.0</TargetFramework>
431
641
  </PropertyGroup>
432
-
642
+
433
643
  <ItemGroup>
434
644
  <PackageReference Include="Newtonsoft.Json" />
435
645
  </ItemGroup>
@@ -442,7 +652,7 @@ public partial class UpdateWorkerTests
442
652
  <PropertyGroup>
443
653
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
444
654
  </PropertyGroup>
445
-
655
+
446
656
  <ItemGroup>
447
657
  <PackageVersion Include="Newtonsoft.Json" Version="[9.0.1]" />
448
658
  </ItemGroup>
@@ -455,7 +665,7 @@ public partial class UpdateWorkerTests
455
665
  <PropertyGroup>
456
666
  <TargetFramework>netstandard2.0</TargetFramework>
457
667
  </PropertyGroup>
458
-
668
+
459
669
  <ItemGroup>
460
670
  <PackageReference Include="Newtonsoft.Json" />
461
671
  </ItemGroup>
@@ -468,7 +678,7 @@ public partial class UpdateWorkerTests
468
678
  <PropertyGroup>
469
679
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
470
680
  </PropertyGroup>
471
-
681
+
472
682
  <ItemGroup>
473
683
  <PackageVersion Include="Newtonsoft.Json" Version="[13.0.1]" />
474
684
  </ItemGroup>
@@ -488,7 +698,7 @@ public partial class UpdateWorkerTests
488
698
  <TargetFramework>netstandard2.0</TargetFramework>
489
699
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
490
700
  </PropertyGroup>
491
-
701
+
492
702
  <ItemGroup>
493
703
  <PackageReference Include="Newtonsoft.Json" Version="[$(NewtonsoftJsonPackageVersion)]" />
494
704
  </ItemGroup>
@@ -501,7 +711,7 @@ public partial class UpdateWorkerTests
501
711
  <TargetFramework>netstandard2.0</TargetFramework>
502
712
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
503
713
  </PropertyGroup>
504
-
714
+
505
715
  <ItemGroup>
506
716
  <PackageReference Include="Newtonsoft.Json" Version="[$(NewtonsoftJsonPackageVersion)]" />
507
717
  </ItemGroup>
@@ -520,7 +730,7 @@ public partial class UpdateWorkerTests
520
730
  <TargetFramework>netstandard2.0</TargetFramework>
521
731
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
522
732
  </PropertyGroup>
523
-
733
+
524
734
  <ItemGroup>
525
735
  <PackageReference Include="Newtonsoft.Json" Version="$(newtonsoftjsonpackageversion)" />
526
736
  </ItemGroup>
@@ -533,7 +743,7 @@ public partial class UpdateWorkerTests
533
743
  <TargetFramework>netstandard2.0</TargetFramework>
534
744
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
535
745
  </PropertyGroup>
536
-
746
+
537
747
  <ItemGroup>
538
748
  <PackageReference Include="Newtonsoft.Json" Version="$(newtonsoftjsonpackageversion)" />
539
749
  </ItemGroup>
@@ -552,7 +762,7 @@ public partial class UpdateWorkerTests
552
762
  <TargetFramework>netstandard2.0</TargetFramework>
553
763
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
554
764
  </PropertyGroup>
555
-
765
+
556
766
  <ItemGroup>
557
767
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
558
768
  </ItemGroup>
@@ -565,7 +775,7 @@ public partial class UpdateWorkerTests
565
775
  <TargetFramework>netstandard2.0</TargetFramework>
566
776
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
567
777
  </PropertyGroup>
568
-
778
+
569
779
  <ItemGroup>
570
780
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
571
781
  </ItemGroup>
@@ -584,7 +794,7 @@ public partial class UpdateWorkerTests
584
794
  <TargetFramework>netstandard2.0</TargetFramework>
585
795
  <NewtonsoftJsonPackageVersion>[9.0.1]</NewtonsoftJsonPackageVersion>
586
796
  </PropertyGroup>
587
-
797
+
588
798
  <ItemGroup>
589
799
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
590
800
  </ItemGroup>
@@ -597,7 +807,7 @@ public partial class UpdateWorkerTests
597
807
  <TargetFramework>netstandard2.0</TargetFramework>
598
808
  <NewtonsoftJsonPackageVersion>[13.0.1]</NewtonsoftJsonPackageVersion>
599
809
  </PropertyGroup>
600
-
810
+
601
811
  <ItemGroup>
602
812
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
603
813
  </ItemGroup>
@@ -616,7 +826,7 @@ public partial class UpdateWorkerTests
616
826
  <TargetFramework>netstandard2.0</TargetFramework>
617
827
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
618
828
  </PropertyGroup>
619
-
829
+
620
830
  <ItemGroup>
621
831
  <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
622
832
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -630,7 +840,7 @@ public partial class UpdateWorkerTests
630
840
  <TargetFramework>netstandard2.0</TargetFramework>
631
841
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
632
842
  </PropertyGroup>
633
-
843
+
634
844
  <ItemGroup>
635
845
  <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
636
846
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -650,7 +860,7 @@ public partial class UpdateWorkerTests
650
860
  <TargetFramework>netstandard2.0</TargetFramework>
651
861
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
652
862
  </PropertyGroup>
653
-
863
+
654
864
  <ItemGroup>
655
865
  <PackageReference Include="Newtonsoft.Json" />
656
866
  <PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -664,7 +874,7 @@ public partial class UpdateWorkerTests
664
874
  <TargetFramework>netstandard2.0</TargetFramework>
665
875
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
666
876
  </PropertyGroup>
667
-
877
+
668
878
  <ItemGroup>
669
879
  <PackageReference Include="Newtonsoft.Json" />
670
880
  <PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -684,7 +894,7 @@ public partial class UpdateWorkerTests
684
894
  <PropertyGroup>
685
895
  <TargetFramework>netstandard2.0</TargetFramework>
686
896
  </PropertyGroup>
687
-
897
+
688
898
  <ItemGroup>
689
899
  <PackageReference Include="Newtonsoft.Json" />
690
900
  </ItemGroup>
@@ -698,7 +908,7 @@ public partial class UpdateWorkerTests
698
908
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
699
909
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
700
910
  </PropertyGroup>
701
-
911
+
702
912
  <ItemGroup>
703
913
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
704
914
  </ItemGroup>
@@ -711,7 +921,7 @@ public partial class UpdateWorkerTests
711
921
  <PropertyGroup>
712
922
  <TargetFramework>netstandard2.0</TargetFramework>
713
923
  </PropertyGroup>
714
-
924
+
715
925
  <ItemGroup>
716
926
  <PackageReference Include="Newtonsoft.Json" />
717
927
  </ItemGroup>
@@ -725,7 +935,7 @@ public partial class UpdateWorkerTests
725
935
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
726
936
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
727
937
  </PropertyGroup>
728
-
938
+
729
939
  <ItemGroup>
730
940
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
731
941
  </ItemGroup>
@@ -745,7 +955,7 @@ public partial class UpdateWorkerTests
745
955
  <PropertyGroup>
746
956
  <TargetFramework>netstandard2.0</TargetFramework>
747
957
  </PropertyGroup>
748
-
958
+
749
959
  <ItemGroup>
750
960
  <PackageReference Include="Newtonsoft.Json" />
751
961
  </ItemGroup>
@@ -759,7 +969,7 @@ public partial class UpdateWorkerTests
759
969
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
760
970
  <NewtonsoftJsonPackageVersion>[9.0.1]</NewtonsoftJsonPackageVersion>
761
971
  </PropertyGroup>
762
-
972
+
763
973
  <ItemGroup>
764
974
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
765
975
  </ItemGroup>
@@ -772,7 +982,7 @@ public partial class UpdateWorkerTests
772
982
  <PropertyGroup>
773
983
  <TargetFramework>netstandard2.0</TargetFramework>
774
984
  </PropertyGroup>
775
-
985
+
776
986
  <ItemGroup>
777
987
  <PackageReference Include="Newtonsoft.Json" />
778
988
  </ItemGroup>
@@ -786,7 +996,7 @@ public partial class UpdateWorkerTests
786
996
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
787
997
  <NewtonsoftJsonPackageVersion>[13.0.1]</NewtonsoftJsonPackageVersion>
788
998
  </PropertyGroup>
789
-
999
+
790
1000
  <ItemGroup>
791
1001
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
792
1002
  </ItemGroup>
@@ -806,7 +1016,7 @@ public partial class UpdateWorkerTests
806
1016
  <PropertyGroup>
807
1017
  <TargetFramework>netstandard2.0</TargetFramework>
808
1018
  </PropertyGroup>
809
-
1019
+
810
1020
  <ItemGroup>
811
1021
  <PackageReference Include="Newtonsoft.Json" VersionOverride="9.0.1" />
812
1022
  </ItemGroup>
@@ -820,7 +1030,7 @@ public partial class UpdateWorkerTests
820
1030
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
821
1031
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
822
1032
  </PropertyGroup>
823
-
1033
+
824
1034
  <ItemGroup>
825
1035
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
826
1036
  </ItemGroup>
@@ -833,7 +1043,7 @@ public partial class UpdateWorkerTests
833
1043
  <PropertyGroup>
834
1044
  <TargetFramework>netstandard2.0</TargetFramework>
835
1045
  </PropertyGroup>
836
-
1046
+
837
1047
  <ItemGroup>
838
1048
  <PackageReference Include="Newtonsoft.Json" VersionOverride="13.0.1" />
839
1049
  </ItemGroup>
@@ -847,7 +1057,7 @@ public partial class UpdateWorkerTests
847
1057
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
848
1058
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
849
1059
  </PropertyGroup>
850
-
1060
+
851
1061
  <ItemGroup>
852
1062
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
853
1063
  </ItemGroup>
@@ -876,7 +1086,7 @@ public partial class UpdateWorkerTests
876
1086
  <PropertyGroup>
877
1087
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
878
1088
  </PropertyGroup>
879
-
1089
+
880
1090
  <ItemGroup>
881
1091
  <GlobalPackageReference Include="Newtonsoft.Json" Version="9.0.1" />
882
1092
  </ItemGroup>
@@ -898,7 +1108,7 @@ public partial class UpdateWorkerTests
898
1108
  <PropertyGroup>
899
1109
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
900
1110
  </PropertyGroup>
901
-
1111
+
902
1112
  <ItemGroup>
903
1113
  <GlobalPackageReference Include="Newtonsoft.Json" Version="13.0.1" />
904
1114
  </ItemGroup>
@@ -928,7 +1138,7 @@ public partial class UpdateWorkerTests
928
1138
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
929
1139
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
930
1140
  </PropertyGroup>
931
-
1141
+
932
1142
  <ItemGroup>
933
1143
  <GlobalPackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
934
1144
  </ItemGroup>
@@ -951,7 +1161,7 @@ public partial class UpdateWorkerTests
951
1161
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
952
1162
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
953
1163
  </PropertyGroup>
954
-
1164
+
955
1165
  <ItemGroup>
956
1166
  <GlobalPackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
957
1167
  </ItemGroup>
@@ -970,7 +1180,7 @@ public partial class UpdateWorkerTests
970
1180
  <PropertyGroup>
971
1181
  <TargetFramework>netstandard2.0</TargetFramework>
972
1182
  </PropertyGroup>
973
-
1183
+
974
1184
  <ItemGroup>
975
1185
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
976
1186
  </ItemGroup>
@@ -993,7 +1203,7 @@ public partial class UpdateWorkerTests
993
1203
  <PropertyGroup>
994
1204
  <TargetFramework>netstandard2.0</TargetFramework>
995
1205
  </PropertyGroup>
996
-
1206
+
997
1207
  <ItemGroup>
998
1208
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
999
1209
  </ItemGroup>
@@ -1020,11 +1230,11 @@ public partial class UpdateWorkerTests
1020
1230
  projectContents: """
1021
1231
  <Project Sdk="Microsoft.NET.Sdk">
1022
1232
  <Import Project="my-properties.props" />
1023
-
1233
+
1024
1234
  <PropertyGroup>
1025
1235
  <TargetFramework>netstandard2.0</TargetFramework>
1026
1236
  </PropertyGroup>
1027
-
1237
+
1028
1238
  <ItemGroup>
1029
1239
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1030
1240
  </ItemGroup>
@@ -1045,11 +1255,11 @@ public partial class UpdateWorkerTests
1045
1255
  expectedProjectContents: """
1046
1256
  <Project Sdk="Microsoft.NET.Sdk">
1047
1257
  <Import Project="my-properties.props" />
1048
-
1258
+
1049
1259
  <PropertyGroup>
1050
1260
  <TargetFramework>netstandard2.0</TargetFramework>
1051
1261
  </PropertyGroup>
1052
-
1262
+
1053
1263
  <ItemGroup>
1054
1264
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1055
1265
  </ItemGroup>
@@ -1079,7 +1289,7 @@ public partial class UpdateWorkerTests
1079
1289
  <PropertyGroup>
1080
1290
  <TargetFramework>netstandard2.0</TargetFramework>
1081
1291
  </PropertyGroup>
1082
-
1292
+
1083
1293
  <ItemGroup>
1084
1294
  <PackageReference Include="Newtonsoft.Json" />
1085
1295
  </ItemGroup>
@@ -1094,7 +1304,7 @@ public partial class UpdateWorkerTests
1094
1304
  <PropertyGroup>
1095
1305
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1096
1306
  </PropertyGroup>
1097
-
1307
+
1098
1308
  <ItemGroup>
1099
1309
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1100
1310
  </ItemGroup>
@@ -1114,7 +1324,7 @@ public partial class UpdateWorkerTests
1114
1324
  <PropertyGroup>
1115
1325
  <TargetFramework>netstandard2.0</TargetFramework>
1116
1326
  </PropertyGroup>
1117
-
1327
+
1118
1328
  <ItemGroup>
1119
1329
  <PackageReference Include="Newtonsoft.Json" />
1120
1330
  </ItemGroup>
@@ -1129,7 +1339,7 @@ public partial class UpdateWorkerTests
1129
1339
  <PropertyGroup>
1130
1340
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1131
1341
  </PropertyGroup>
1132
-
1342
+
1133
1343
  <ItemGroup>
1134
1344
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1135
1345
  </ItemGroup>
@@ -1156,7 +1366,7 @@ public partial class UpdateWorkerTests
1156
1366
  <PropertyGroup>
1157
1367
  <TargetFramework>netstandard2.0</TargetFramework>
1158
1368
  </PropertyGroup>
1159
-
1369
+
1160
1370
  <ItemGroup>
1161
1371
  <PackageReference Include="Newtonsoft.Json" />
1162
1372
  </ItemGroup>
@@ -1172,7 +1382,7 @@ public partial class UpdateWorkerTests
1172
1382
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1173
1383
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1174
1384
  </PropertyGroup>
1175
-
1385
+
1176
1386
  <ItemGroup>
1177
1387
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1178
1388
  </ItemGroup>
@@ -1192,7 +1402,7 @@ public partial class UpdateWorkerTests
1192
1402
  <PropertyGroup>
1193
1403
  <TargetFramework>netstandard2.0</TargetFramework>
1194
1404
  </PropertyGroup>
1195
-
1405
+
1196
1406
  <ItemGroup>
1197
1407
  <PackageReference Include="Newtonsoft.Json" />
1198
1408
  </ItemGroup>
@@ -1208,7 +1418,7 @@ public partial class UpdateWorkerTests
1208
1418
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1209
1419
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1210
1420
  </PropertyGroup>
1211
-
1421
+
1212
1422
  <ItemGroup>
1213
1423
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1214
1424
  </ItemGroup>
@@ -1235,7 +1445,7 @@ public partial class UpdateWorkerTests
1235
1445
  <PropertyGroup>
1236
1446
  <TargetFramework>netstandard2.0</TargetFramework>
1237
1447
  </PropertyGroup>
1238
-
1448
+
1239
1449
  <ItemGroup>
1240
1450
  <PackageReference Include="Newtonsoft.Json" />
1241
1451
  </ItemGroup>
@@ -1251,7 +1461,7 @@ public partial class UpdateWorkerTests
1251
1461
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1252
1462
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1253
1463
  </PropertyGroup>
1254
-
1464
+
1255
1465
  <ItemGroup>
1256
1466
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1257
1467
  </ItemGroup>
@@ -1272,7 +1482,7 @@ public partial class UpdateWorkerTests
1272
1482
  <PropertyGroup>
1273
1483
  <TargetFramework>netstandard2.0</TargetFramework>
1274
1484
  </PropertyGroup>
1275
-
1485
+
1276
1486
  <ItemGroup>
1277
1487
  <PackageReference Include="Newtonsoft.Json" />
1278
1488
  </ItemGroup>
@@ -1288,7 +1498,7 @@ public partial class UpdateWorkerTests
1288
1498
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1289
1499
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1290
1500
  </PropertyGroup>
1291
-
1501
+
1292
1502
  <ItemGroup>
1293
1503
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1294
1504
  </ItemGroup>
@@ -1564,6 +1774,35 @@ public partial class UpdateWorkerTests
1564
1774
  """);
1565
1775
  }
1566
1776
 
1777
+ [Fact]
1778
+ public async Task UpdateVersionAttribute_InProjectFile_WhereTargetFrameworksIsSelfReferential()
1779
+ {
1780
+ // update Newtonsoft.Json from 9.0.1 to 13.0.1
1781
+ await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
1782
+ projectContents: """
1783
+ <Project Sdk="Microsoft.NET.Sdk">
1784
+ <PropertyGroup>
1785
+ <TargetFrameworks Condition="!$(TargetFrameworks.Contains('net472'))">$(TargetFrameworks);net472</TargetFrameworks>
1786
+ <TargetFrameworks Condition="!$(TargetFrameworks.Contains('netstandard2.0'))">$(TargetFrameworks);netstandard2.0</TargetFrameworks>
1787
+ </PropertyGroup>
1788
+ <ItemGroup>
1789
+ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
1790
+ </ItemGroup>
1791
+ </Project>
1792
+ """,
1793
+ expectedProjectContents: """
1794
+ <Project Sdk="Microsoft.NET.Sdk">
1795
+ <PropertyGroup>
1796
+ <TargetFrameworks Condition="!$(TargetFrameworks.Contains('net472'))">$(TargetFrameworks);net472</TargetFrameworks>
1797
+ <TargetFrameworks Condition="!$(TargetFrameworks.Contains('netstandard2.0'))">$(TargetFrameworks);netstandard2.0</TargetFrameworks>
1798
+ </PropertyGroup>
1799
+ <ItemGroup>
1800
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1801
+ </ItemGroup>
1802
+ </Project>
1803
+ """);
1804
+ }
1805
+
1567
1806
  [Fact]
1568
1807
  public async Task UpdateOfNonExistantPackageDoesNothingEvenIfTransitiveDependencyIsPresent()
1569
1808
  {
@@ -1597,13 +1836,13 @@ public partial class UpdateWorkerTests
1597
1836
  await TestUpdateForProject("Microsoft.VisualStudio.Sdk.TestFramework.Xunit", "17.2.7", "17.6.16",
1598
1837
  projectContents: """
1599
1838
  <Project Sdk="Microsoft.NET.Sdk">
1600
-
1839
+
1601
1840
  <PropertyGroup>
1602
1841
  <TargetFramework>$(PreferredTargetFramework)</TargetFramework>
1603
1842
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1604
1843
  <RootNamespace />
1605
1844
  </PropertyGroup>
1606
-
1845
+
1607
1846
  <ItemGroup>
1608
1847
  <PackageReference Include="Microsoft.NET.Test.Sdk" />
1609
1848
  <PackageReference Include="Microsoft.VisualStudio.Sdk.TestFramework" />
@@ -1645,13 +1884,13 @@ public partial class UpdateWorkerTests
1645
1884
  ],
1646
1885
  expectedProjectContents: """
1647
1886
  <Project Sdk="Microsoft.NET.Sdk">
1648
-
1887
+
1649
1888
  <PropertyGroup>
1650
1889
  <TargetFramework>$(PreferredTargetFramework)</TargetFramework>
1651
1890
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1652
1891
  <RootNamespace />
1653
1892
  </PropertyGroup>
1654
-
1893
+
1655
1894
  <ItemGroup>
1656
1895
  <PackageReference Include="Microsoft.NET.Test.Sdk" />
1657
1896
  <PackageReference Include="Microsoft.VisualStudio.Sdk.TestFramework" />
@@ -1700,11 +1939,11 @@ public partial class UpdateWorkerTests
1700
1939
  // initial
1701
1940
  projectContents: """
1702
1941
  <Project Sdk="Microsoft.NET.Sdk">
1703
-
1942
+
1704
1943
  <PropertyGroup>
1705
1944
  <TargetFramework>net5.0</TargetFramework>
1706
1945
  </PropertyGroup>
1707
-
1946
+
1708
1947
  <ItemGroup>
1709
1948
  <PackageReference Include="Mongo2Go" />
1710
1949
  </ItemGroup>
@@ -1728,11 +1967,11 @@ public partial class UpdateWorkerTests
1728
1967
  // expected
1729
1968
  expectedProjectContents: """
1730
1969
  <Project Sdk="Microsoft.NET.Sdk">
1731
-
1970
+
1732
1971
  <PropertyGroup>
1733
1972
  <TargetFramework>net5.0</TargetFramework>
1734
1973
  </PropertyGroup>
1735
-
1974
+
1736
1975
  <ItemGroup>
1737
1976
  <PackageReference Include="Mongo2Go" />
1738
1977
  <PackageReference Include="System.Text.Json" />
@@ -1764,12 +2003,12 @@ public partial class UpdateWorkerTests
1764
2003
  // initial
1765
2004
  projectContents: """
1766
2005
  <Project Sdk="Microsoft.NET.Sdk">
1767
-
2006
+
1768
2007
  <PropertyGroup>
1769
2008
  <NoWarn>$(NoWarn);NETSDK1138</NoWarn>
1770
2009
  <TargetFramework>net5.0</TargetFramework>
1771
2010
  </PropertyGroup>
1772
-
2011
+
1773
2012
  <ItemGroup>
1774
2013
  <PackageReference Include="Mongo2Go" />
1775
2014
  </ItemGroup>
@@ -1794,12 +2033,12 @@ public partial class UpdateWorkerTests
1794
2033
  // expected
1795
2034
  expectedProjectContents: """
1796
2035
  <Project Sdk="Microsoft.NET.Sdk">
1797
-
2036
+
1798
2037
  <PropertyGroup>
1799
2038
  <NoWarn>$(NoWarn);NETSDK1138</NoWarn>
1800
2039
  <TargetFramework>net5.0</TargetFramework>
1801
2040
  </PropertyGroup>
1802
-
2041
+
1803
2042
  <ItemGroup>
1804
2043
  <PackageReference Include="Mongo2Go" />
1805
2044
  </ItemGroup>
@@ -2207,5 +2446,38 @@ public partial class UpdateWorkerTests
2207
2446
  """
2208
2447
  );
2209
2448
  }
2449
+
2450
+ [Fact]
2451
+ public async Task NoChange_IfThereAreIncoherentVersions()
2452
+ {
2453
+ // Make sure we don't update if there are incoherent versions
2454
+ await TestNoChangeforProject("Microsoft.EntityFrameworkCore.SqlServer", "2.1.0", "2.2.0",
2455
+ projectContents: """
2456
+ <Project Sdk="Microsoft.NET.Sdk">
2457
+ <PropertyGroup>
2458
+ <TargetFramework>netcoreapp2.1</TargetFramework>
2459
+ </PropertyGroup>
2460
+ <ItemGroup>
2461
+ <PackageReference Include="Microsoft.Extensions.Primitives" Version="2.2.0" />
2462
+ <PackageReference Include="Microsoft.Extensions.Options" Version="2.2.0" />
2463
+ <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
2464
+ <PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
2465
+ <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
2466
+ <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" />
2467
+ <PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="2.2.0" />
2468
+ <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="2.2.0" />
2469
+ <PackageReference Include="Microsoft.Extensions.Configuration" Version="2.2.0" />
2470
+ <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.2.0" />
2471
+ <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="2.2.0" />
2472
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.0" />
2473
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers" Version="2.2.0" />
2474
+ <PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="2.2.0" />
2475
+ <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.0" />
2476
+ <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.0" />
2477
+ <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.1.0" />
2478
+ </ItemGroup>
2479
+ </Project>
2480
+ """);
2481
+ }
2210
2482
  }
2211
2483
  }