dependabot-nuget 0.244.0 → 0.246.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (23) 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 +68 -18
  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 +385 -81
  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/native_helpers.rb +21 -12
  17. data/lib/dependabot/nuget/nuget_client.rb +8 -13
  18. data/lib/dependabot/nuget/update_checker/dependency_finder.rb +23 -13
  19. data/lib/dependabot/nuget/update_checker/nupkg_fetcher.rb +75 -11
  20. data/lib/dependabot/nuget/update_checker/repository_finder.rb +4 -10
  21. data/lib/dependabot/nuget/update_checker.rb +2 -3
  22. metadata +7 -7
  23. 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,14 +42,256 @@ public partial class UpdateWorkerTests
42
42
  <PropertyGroup>
43
43
  <TargetFramework>{tfm}</TargetFramework>
44
44
  </PropertyGroup>
45
-
45
+
46
+ <ItemGroup>
47
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
48
+ </ItemGroup>
49
+ </Project>
50
+ """);
51
+ }
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>
46
157
  <ItemGroup>
47
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" />
48
191
  </ItemGroup>
49
192
  </Project>
50
193
  """);
51
194
  }
52
195
 
196
+ [Fact]
197
+ public async Task UpdateVersionAttribute_InProjectFile_ForPackageReferenceInclude_Windows()
198
+ {
199
+ // update Newtonsoft.Json from 9.0.1 to 13.0.1
200
+ await TestUpdateForProject("Newtonsoft.Json", "9.0.1", "13.0.1",
201
+ // initial
202
+ projectContents: $"""
203
+ <Project Sdk="Microsoft.NET.Sdk">
204
+ <PropertyGroup>
205
+ <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
206
+ <RuntimeIdentifier>win-x64</RuntimeIdentifier>
207
+ </PropertyGroup>
208
+
209
+ <ItemGroup>
210
+ <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
211
+ </ItemGroup>
212
+ </Project>
213
+ """,
214
+ // expected
215
+ expectedProjectContents: $"""
216
+ <Project Sdk="Microsoft.NET.Sdk">
217
+ <PropertyGroup>
218
+ <TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
219
+ <RuntimeIdentifier>win-x64</RuntimeIdentifier>
220
+ </PropertyGroup>
221
+
222
+ <ItemGroup>
223
+ <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
224
+ </ItemGroup>
225
+ </Project>
226
+ """);
227
+ }
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
+ }
53
295
 
54
296
  [Theory]
55
297
  [InlineData("$(NewtonsoftJsonVersion")]
@@ -81,7 +323,7 @@ public partial class UpdateWorkerTests
81
323
  var privateNugetContent = """
82
324
  <?xml version="1.0" encoding="utf-8"?>
83
325
  <configuration>
84
-
326
+
85
327
  <packageSources>
86
328
  <clear />
87
329
  <add key="nuget_PrivateFeed" value="https://api.nuget.org/v3/index.json" />
@@ -168,7 +410,7 @@ public partial class UpdateWorkerTests
168
410
  <PropertyGroup>
169
411
  <TargetFramework>net6.0</TargetFramework>
170
412
  </PropertyGroup>
171
-
413
+
172
414
  <ItemGroup>
173
415
  <PackageReference Include="Newtonsoft.Json" Version="[9.0.1]" />
174
416
  </ItemGroup>
@@ -180,7 +422,7 @@ public partial class UpdateWorkerTests
180
422
  <PropertyGroup>
181
423
  <TargetFramework>net6.0</TargetFramework>
182
424
  </PropertyGroup>
183
-
425
+
184
426
  <ItemGroup>
185
427
  <PackageReference Include="Newtonsoft.Json" Version="[13.0.1]" />
186
428
  </ItemGroup>
@@ -196,11 +438,11 @@ public partial class UpdateWorkerTests
196
438
  // initial
197
439
  projectContents: """
198
440
  <Project Sdk="Microsoft.NET.Sdk">
199
-
441
+
200
442
  <PropertyGroup>
201
443
  <TargetFramework>netcoreapp3.1</TargetFramework>
202
444
  </PropertyGroup>
203
-
445
+
204
446
  <ItemGroup>
205
447
  <PackageReference Include="Mongo2Go" Version="3.1.3" />
206
448
  </ItemGroup>
@@ -210,11 +452,11 @@ public partial class UpdateWorkerTests
210
452
  // expected
211
453
  expectedProjectContents: """
212
454
  <Project Sdk="Microsoft.NET.Sdk">
213
-
455
+
214
456
  <PropertyGroup>
215
457
  <TargetFramework>netcoreapp3.1</TargetFramework>
216
458
  </PropertyGroup>
217
-
459
+
218
460
  <ItemGroup>
219
461
  <PackageReference Include="Mongo2Go" Version="3.1.3" />
220
462
  <PackageReference Include="System.Text.Json" Version="5.0.2" />
@@ -235,7 +477,7 @@ public partial class UpdateWorkerTests
235
477
  <PropertyGroup>
236
478
  <TargetFramework>netstandard2.0</TargetFramework>
237
479
  </PropertyGroup>
238
-
480
+
239
481
  <ItemGroup>
240
482
  <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.0">
241
483
  <PrivateAssets>all</PrivateAssets>
@@ -250,7 +492,7 @@ public partial class UpdateWorkerTests
250
492
  <PropertyGroup>
251
493
  <TargetFramework>netstandard2.0</TargetFramework>
252
494
  </PropertyGroup>
253
-
495
+
254
496
  <ItemGroup>
255
497
  <PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4">
256
498
  <PrivateAssets>all</PrivateAssets>
@@ -272,7 +514,7 @@ public partial class UpdateWorkerTests
272
514
  <PropertyGroup>
273
515
  <TargetFramework>netstandard2.0</TargetFramework>
274
516
  </PropertyGroup>
275
-
517
+
276
518
  <ItemGroup>
277
519
  <PackageReference Include="Newtonsoft.JSON" Version="9.0.1" />
278
520
  <PackageReference Update="Newtonsoft.Json" Version="9.0.1" />
@@ -285,7 +527,7 @@ public partial class UpdateWorkerTests
285
527
  <PropertyGroup>
286
528
  <TargetFramework>netstandard2.0</TargetFramework>
287
529
  </PropertyGroup>
288
-
530
+
289
531
  <ItemGroup>
290
532
  <PackageReference Include="Newtonsoft.JSON" Version="13.0.1" />
291
533
  <PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
@@ -305,7 +547,7 @@ public partial class UpdateWorkerTests
305
547
  <PropertyGroup>
306
548
  <TargetFramework>netstandard2.0</TargetFramework>
307
549
  </PropertyGroup>
308
-
550
+
309
551
  <ItemGroup>
310
552
  <PackageReference Include="Newtonsoft.Json" />
311
553
  <PackageReference Update="Newtonsoft.Json" Version="9.0.1" />
@@ -318,7 +560,7 @@ public partial class UpdateWorkerTests
318
560
  <PropertyGroup>
319
561
  <TargetFramework>netstandard2.0</TargetFramework>
320
562
  </PropertyGroup>
321
-
563
+
322
564
  <ItemGroup>
323
565
  <PackageReference Include="Newtonsoft.Json" />
324
566
  <PackageReference Update="Newtonsoft.Json" Version="13.0.1" />
@@ -338,7 +580,7 @@ public partial class UpdateWorkerTests
338
580
  <PropertyGroup>
339
581
  <TargetFramework>netstandard2.0</TargetFramework>
340
582
  </PropertyGroup>
341
-
583
+
342
584
  <ItemGroup>
343
585
  <PackageReference Include="Newtonsoft.Json" />
344
586
  </ItemGroup>
@@ -351,7 +593,7 @@ public partial class UpdateWorkerTests
351
593
  <PropertyGroup>
352
594
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
353
595
  </PropertyGroup>
354
-
596
+
355
597
  <ItemGroup>
356
598
  <PackageVersion Include="Newtonsoft.Json" Version="9.0.1" />
357
599
  </ItemGroup>
@@ -364,7 +606,7 @@ public partial class UpdateWorkerTests
364
606
  <PropertyGroup>
365
607
  <TargetFramework>netstandard2.0</TargetFramework>
366
608
  </PropertyGroup>
367
-
609
+
368
610
  <ItemGroup>
369
611
  <PackageReference Include="Newtonsoft.Json" />
370
612
  </ItemGroup>
@@ -377,7 +619,7 @@ public partial class UpdateWorkerTests
377
619
  <PropertyGroup>
378
620
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
379
621
  </PropertyGroup>
380
-
622
+
381
623
  <ItemGroup>
382
624
  <PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
383
625
  </ItemGroup>
@@ -397,7 +639,7 @@ public partial class UpdateWorkerTests
397
639
  <PropertyGroup>
398
640
  <TargetFramework>netstandard2.0</TargetFramework>
399
641
  </PropertyGroup>
400
-
642
+
401
643
  <ItemGroup>
402
644
  <PackageReference Include="Newtonsoft.Json" />
403
645
  </ItemGroup>
@@ -410,7 +652,7 @@ public partial class UpdateWorkerTests
410
652
  <PropertyGroup>
411
653
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
412
654
  </PropertyGroup>
413
-
655
+
414
656
  <ItemGroup>
415
657
  <PackageVersion Include="Newtonsoft.Json" Version="[9.0.1]" />
416
658
  </ItemGroup>
@@ -423,7 +665,7 @@ public partial class UpdateWorkerTests
423
665
  <PropertyGroup>
424
666
  <TargetFramework>netstandard2.0</TargetFramework>
425
667
  </PropertyGroup>
426
-
668
+
427
669
  <ItemGroup>
428
670
  <PackageReference Include="Newtonsoft.Json" />
429
671
  </ItemGroup>
@@ -436,7 +678,7 @@ public partial class UpdateWorkerTests
436
678
  <PropertyGroup>
437
679
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
438
680
  </PropertyGroup>
439
-
681
+
440
682
  <ItemGroup>
441
683
  <PackageVersion Include="Newtonsoft.Json" Version="[13.0.1]" />
442
684
  </ItemGroup>
@@ -456,7 +698,7 @@ public partial class UpdateWorkerTests
456
698
  <TargetFramework>netstandard2.0</TargetFramework>
457
699
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
458
700
  </PropertyGroup>
459
-
701
+
460
702
  <ItemGroup>
461
703
  <PackageReference Include="Newtonsoft.Json" Version="[$(NewtonsoftJsonPackageVersion)]" />
462
704
  </ItemGroup>
@@ -469,7 +711,7 @@ public partial class UpdateWorkerTests
469
711
  <TargetFramework>netstandard2.0</TargetFramework>
470
712
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
471
713
  </PropertyGroup>
472
-
714
+
473
715
  <ItemGroup>
474
716
  <PackageReference Include="Newtonsoft.Json" Version="[$(NewtonsoftJsonPackageVersion)]" />
475
717
  </ItemGroup>
@@ -488,7 +730,7 @@ public partial class UpdateWorkerTests
488
730
  <TargetFramework>netstandard2.0</TargetFramework>
489
731
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
490
732
  </PropertyGroup>
491
-
733
+
492
734
  <ItemGroup>
493
735
  <PackageReference Include="Newtonsoft.Json" Version="$(newtonsoftjsonpackageversion)" />
494
736
  </ItemGroup>
@@ -501,7 +743,7 @@ public partial class UpdateWorkerTests
501
743
  <TargetFramework>netstandard2.0</TargetFramework>
502
744
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
503
745
  </PropertyGroup>
504
-
746
+
505
747
  <ItemGroup>
506
748
  <PackageReference Include="Newtonsoft.Json" Version="$(newtonsoftjsonpackageversion)" />
507
749
  </ItemGroup>
@@ -520,7 +762,7 @@ public partial class UpdateWorkerTests
520
762
  <TargetFramework>netstandard2.0</TargetFramework>
521
763
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
522
764
  </PropertyGroup>
523
-
765
+
524
766
  <ItemGroup>
525
767
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
526
768
  </ItemGroup>
@@ -533,7 +775,7 @@ public partial class UpdateWorkerTests
533
775
  <TargetFramework>netstandard2.0</TargetFramework>
534
776
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
535
777
  </PropertyGroup>
536
-
778
+
537
779
  <ItemGroup>
538
780
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
539
781
  </ItemGroup>
@@ -552,7 +794,7 @@ public partial class UpdateWorkerTests
552
794
  <TargetFramework>netstandard2.0</TargetFramework>
553
795
  <NewtonsoftJsonPackageVersion>[9.0.1]</NewtonsoftJsonPackageVersion>
554
796
  </PropertyGroup>
555
-
797
+
556
798
  <ItemGroup>
557
799
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
558
800
  </ItemGroup>
@@ -565,7 +807,7 @@ public partial class UpdateWorkerTests
565
807
  <TargetFramework>netstandard2.0</TargetFramework>
566
808
  <NewtonsoftJsonPackageVersion>[13.0.1]</NewtonsoftJsonPackageVersion>
567
809
  </PropertyGroup>
568
-
810
+
569
811
  <ItemGroup>
570
812
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
571
813
  </ItemGroup>
@@ -584,7 +826,7 @@ public partial class UpdateWorkerTests
584
826
  <TargetFramework>netstandard2.0</TargetFramework>
585
827
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
586
828
  </PropertyGroup>
587
-
829
+
588
830
  <ItemGroup>
589
831
  <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
590
832
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -598,7 +840,7 @@ public partial class UpdateWorkerTests
598
840
  <TargetFramework>netstandard2.0</TargetFramework>
599
841
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
600
842
  </PropertyGroup>
601
-
843
+
602
844
  <ItemGroup>
603
845
  <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
604
846
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -618,7 +860,7 @@ public partial class UpdateWorkerTests
618
860
  <TargetFramework>netstandard2.0</TargetFramework>
619
861
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
620
862
  </PropertyGroup>
621
-
863
+
622
864
  <ItemGroup>
623
865
  <PackageReference Include="Newtonsoft.Json" />
624
866
  <PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -632,7 +874,7 @@ public partial class UpdateWorkerTests
632
874
  <TargetFramework>netstandard2.0</TargetFramework>
633
875
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
634
876
  </PropertyGroup>
635
-
877
+
636
878
  <ItemGroup>
637
879
  <PackageReference Include="Newtonsoft.Json" />
638
880
  <PackageReference Update="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
@@ -652,7 +894,7 @@ public partial class UpdateWorkerTests
652
894
  <PropertyGroup>
653
895
  <TargetFramework>netstandard2.0</TargetFramework>
654
896
  </PropertyGroup>
655
-
897
+
656
898
  <ItemGroup>
657
899
  <PackageReference Include="Newtonsoft.Json" />
658
900
  </ItemGroup>
@@ -666,7 +908,7 @@ public partial class UpdateWorkerTests
666
908
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
667
909
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
668
910
  </PropertyGroup>
669
-
911
+
670
912
  <ItemGroup>
671
913
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
672
914
  </ItemGroup>
@@ -679,7 +921,7 @@ public partial class UpdateWorkerTests
679
921
  <PropertyGroup>
680
922
  <TargetFramework>netstandard2.0</TargetFramework>
681
923
  </PropertyGroup>
682
-
924
+
683
925
  <ItemGroup>
684
926
  <PackageReference Include="Newtonsoft.Json" />
685
927
  </ItemGroup>
@@ -693,7 +935,7 @@ public partial class UpdateWorkerTests
693
935
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
694
936
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
695
937
  </PropertyGroup>
696
-
938
+
697
939
  <ItemGroup>
698
940
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
699
941
  </ItemGroup>
@@ -713,7 +955,7 @@ public partial class UpdateWorkerTests
713
955
  <PropertyGroup>
714
956
  <TargetFramework>netstandard2.0</TargetFramework>
715
957
  </PropertyGroup>
716
-
958
+
717
959
  <ItemGroup>
718
960
  <PackageReference Include="Newtonsoft.Json" />
719
961
  </ItemGroup>
@@ -727,7 +969,7 @@ public partial class UpdateWorkerTests
727
969
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
728
970
  <NewtonsoftJsonPackageVersion>[9.0.1]</NewtonsoftJsonPackageVersion>
729
971
  </PropertyGroup>
730
-
972
+
731
973
  <ItemGroup>
732
974
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
733
975
  </ItemGroup>
@@ -740,7 +982,7 @@ public partial class UpdateWorkerTests
740
982
  <PropertyGroup>
741
983
  <TargetFramework>netstandard2.0</TargetFramework>
742
984
  </PropertyGroup>
743
-
985
+
744
986
  <ItemGroup>
745
987
  <PackageReference Include="Newtonsoft.Json" />
746
988
  </ItemGroup>
@@ -754,7 +996,7 @@ public partial class UpdateWorkerTests
754
996
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
755
997
  <NewtonsoftJsonPackageVersion>[13.0.1]</NewtonsoftJsonPackageVersion>
756
998
  </PropertyGroup>
757
-
999
+
758
1000
  <ItemGroup>
759
1001
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
760
1002
  </ItemGroup>
@@ -774,7 +1016,7 @@ public partial class UpdateWorkerTests
774
1016
  <PropertyGroup>
775
1017
  <TargetFramework>netstandard2.0</TargetFramework>
776
1018
  </PropertyGroup>
777
-
1019
+
778
1020
  <ItemGroup>
779
1021
  <PackageReference Include="Newtonsoft.Json" VersionOverride="9.0.1" />
780
1022
  </ItemGroup>
@@ -788,7 +1030,7 @@ public partial class UpdateWorkerTests
788
1030
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
789
1031
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
790
1032
  </PropertyGroup>
791
-
1033
+
792
1034
  <ItemGroup>
793
1035
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
794
1036
  </ItemGroup>
@@ -801,7 +1043,7 @@ public partial class UpdateWorkerTests
801
1043
  <PropertyGroup>
802
1044
  <TargetFramework>netstandard2.0</TargetFramework>
803
1045
  </PropertyGroup>
804
-
1046
+
805
1047
  <ItemGroup>
806
1048
  <PackageReference Include="Newtonsoft.Json" VersionOverride="13.0.1" />
807
1049
  </ItemGroup>
@@ -815,7 +1057,7 @@ public partial class UpdateWorkerTests
815
1057
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
816
1058
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
817
1059
  </PropertyGroup>
818
-
1060
+
819
1061
  <ItemGroup>
820
1062
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
821
1063
  </ItemGroup>
@@ -844,7 +1086,7 @@ public partial class UpdateWorkerTests
844
1086
  <PropertyGroup>
845
1087
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
846
1088
  </PropertyGroup>
847
-
1089
+
848
1090
  <ItemGroup>
849
1091
  <GlobalPackageReference Include="Newtonsoft.Json" Version="9.0.1" />
850
1092
  </ItemGroup>
@@ -866,7 +1108,7 @@ public partial class UpdateWorkerTests
866
1108
  <PropertyGroup>
867
1109
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
868
1110
  </PropertyGroup>
869
-
1111
+
870
1112
  <ItemGroup>
871
1113
  <GlobalPackageReference Include="Newtonsoft.Json" Version="13.0.1" />
872
1114
  </ItemGroup>
@@ -896,7 +1138,7 @@ public partial class UpdateWorkerTests
896
1138
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
897
1139
  <NewtonsoftJsonPackageVersion>9.0.1</NewtonsoftJsonPackageVersion>
898
1140
  </PropertyGroup>
899
-
1141
+
900
1142
  <ItemGroup>
901
1143
  <GlobalPackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
902
1144
  </ItemGroup>
@@ -919,7 +1161,7 @@ public partial class UpdateWorkerTests
919
1161
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
920
1162
  <NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
921
1163
  </PropertyGroup>
922
-
1164
+
923
1165
  <ItemGroup>
924
1166
  <GlobalPackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
925
1167
  </ItemGroup>
@@ -938,7 +1180,7 @@ public partial class UpdateWorkerTests
938
1180
  <PropertyGroup>
939
1181
  <TargetFramework>netstandard2.0</TargetFramework>
940
1182
  </PropertyGroup>
941
-
1183
+
942
1184
  <ItemGroup>
943
1185
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
944
1186
  </ItemGroup>
@@ -961,7 +1203,7 @@ public partial class UpdateWorkerTests
961
1203
  <PropertyGroup>
962
1204
  <TargetFramework>netstandard2.0</TargetFramework>
963
1205
  </PropertyGroup>
964
-
1206
+
965
1207
  <ItemGroup>
966
1208
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
967
1209
  </ItemGroup>
@@ -988,11 +1230,11 @@ public partial class UpdateWorkerTests
988
1230
  projectContents: """
989
1231
  <Project Sdk="Microsoft.NET.Sdk">
990
1232
  <Import Project="my-properties.props" />
991
-
1233
+
992
1234
  <PropertyGroup>
993
1235
  <TargetFramework>netstandard2.0</TargetFramework>
994
1236
  </PropertyGroup>
995
-
1237
+
996
1238
  <ItemGroup>
997
1239
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
998
1240
  </ItemGroup>
@@ -1013,11 +1255,11 @@ public partial class UpdateWorkerTests
1013
1255
  expectedProjectContents: """
1014
1256
  <Project Sdk="Microsoft.NET.Sdk">
1015
1257
  <Import Project="my-properties.props" />
1016
-
1258
+
1017
1259
  <PropertyGroup>
1018
1260
  <TargetFramework>netstandard2.0</TargetFramework>
1019
1261
  </PropertyGroup>
1020
-
1262
+
1021
1263
  <ItemGroup>
1022
1264
  <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1023
1265
  </ItemGroup>
@@ -1047,7 +1289,7 @@ public partial class UpdateWorkerTests
1047
1289
  <PropertyGroup>
1048
1290
  <TargetFramework>netstandard2.0</TargetFramework>
1049
1291
  </PropertyGroup>
1050
-
1292
+
1051
1293
  <ItemGroup>
1052
1294
  <PackageReference Include="Newtonsoft.Json" />
1053
1295
  </ItemGroup>
@@ -1062,7 +1304,7 @@ public partial class UpdateWorkerTests
1062
1304
  <PropertyGroup>
1063
1305
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1064
1306
  </PropertyGroup>
1065
-
1307
+
1066
1308
  <ItemGroup>
1067
1309
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1068
1310
  </ItemGroup>
@@ -1082,7 +1324,7 @@ public partial class UpdateWorkerTests
1082
1324
  <PropertyGroup>
1083
1325
  <TargetFramework>netstandard2.0</TargetFramework>
1084
1326
  </PropertyGroup>
1085
-
1327
+
1086
1328
  <ItemGroup>
1087
1329
  <PackageReference Include="Newtonsoft.Json" />
1088
1330
  </ItemGroup>
@@ -1097,7 +1339,7 @@ public partial class UpdateWorkerTests
1097
1339
  <PropertyGroup>
1098
1340
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1099
1341
  </PropertyGroup>
1100
-
1342
+
1101
1343
  <ItemGroup>
1102
1344
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1103
1345
  </ItemGroup>
@@ -1124,7 +1366,7 @@ public partial class UpdateWorkerTests
1124
1366
  <PropertyGroup>
1125
1367
  <TargetFramework>netstandard2.0</TargetFramework>
1126
1368
  </PropertyGroup>
1127
-
1369
+
1128
1370
  <ItemGroup>
1129
1371
  <PackageReference Include="Newtonsoft.Json" />
1130
1372
  </ItemGroup>
@@ -1140,7 +1382,7 @@ public partial class UpdateWorkerTests
1140
1382
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1141
1383
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1142
1384
  </PropertyGroup>
1143
-
1385
+
1144
1386
  <ItemGroup>
1145
1387
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1146
1388
  </ItemGroup>
@@ -1160,7 +1402,7 @@ public partial class UpdateWorkerTests
1160
1402
  <PropertyGroup>
1161
1403
  <TargetFramework>netstandard2.0</TargetFramework>
1162
1404
  </PropertyGroup>
1163
-
1405
+
1164
1406
  <ItemGroup>
1165
1407
  <PackageReference Include="Newtonsoft.Json" />
1166
1408
  </ItemGroup>
@@ -1176,7 +1418,7 @@ public partial class UpdateWorkerTests
1176
1418
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1177
1419
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1178
1420
  </PropertyGroup>
1179
-
1421
+
1180
1422
  <ItemGroup>
1181
1423
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1182
1424
  </ItemGroup>
@@ -1203,7 +1445,7 @@ public partial class UpdateWorkerTests
1203
1445
  <PropertyGroup>
1204
1446
  <TargetFramework>netstandard2.0</TargetFramework>
1205
1447
  </PropertyGroup>
1206
-
1448
+
1207
1449
  <ItemGroup>
1208
1450
  <PackageReference Include="Newtonsoft.Json" />
1209
1451
  </ItemGroup>
@@ -1219,7 +1461,7 @@ public partial class UpdateWorkerTests
1219
1461
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1220
1462
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1221
1463
  </PropertyGroup>
1222
-
1464
+
1223
1465
  <ItemGroup>
1224
1466
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1225
1467
  </ItemGroup>
@@ -1240,7 +1482,7 @@ public partial class UpdateWorkerTests
1240
1482
  <PropertyGroup>
1241
1483
  <TargetFramework>netstandard2.0</TargetFramework>
1242
1484
  </PropertyGroup>
1243
-
1485
+
1244
1486
  <ItemGroup>
1245
1487
  <PackageReference Include="Newtonsoft.Json" />
1246
1488
  </ItemGroup>
@@ -1256,7 +1498,7 @@ public partial class UpdateWorkerTests
1256
1498
  <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
1257
1499
  <NewtonsoftJsonPackageVersion>$(NewtonsoftJsonVersion)</NewtonsoftJsonPackageVersion>
1258
1500
  </PropertyGroup>
1259
-
1501
+
1260
1502
  <ItemGroup>
1261
1503
  <PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
1262
1504
  </ItemGroup>
@@ -1532,6 +1774,35 @@ public partial class UpdateWorkerTests
1532
1774
  """);
1533
1775
  }
1534
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
+
1535
1806
  [Fact]
1536
1807
  public async Task UpdateOfNonExistantPackageDoesNothingEvenIfTransitiveDependencyIsPresent()
1537
1808
  {
@@ -1565,13 +1836,13 @@ public partial class UpdateWorkerTests
1565
1836
  await TestUpdateForProject("Microsoft.VisualStudio.Sdk.TestFramework.Xunit", "17.2.7", "17.6.16",
1566
1837
  projectContents: """
1567
1838
  <Project Sdk="Microsoft.NET.Sdk">
1568
-
1839
+
1569
1840
  <PropertyGroup>
1570
1841
  <TargetFramework>$(PreferredTargetFramework)</TargetFramework>
1571
1842
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1572
1843
  <RootNamespace />
1573
1844
  </PropertyGroup>
1574
-
1845
+
1575
1846
  <ItemGroup>
1576
1847
  <PackageReference Include="Microsoft.NET.Test.Sdk" />
1577
1848
  <PackageReference Include="Microsoft.VisualStudio.Sdk.TestFramework" />
@@ -1613,13 +1884,13 @@ public partial class UpdateWorkerTests
1613
1884
  ],
1614
1885
  expectedProjectContents: """
1615
1886
  <Project Sdk="Microsoft.NET.Sdk">
1616
-
1887
+
1617
1888
  <PropertyGroup>
1618
1889
  <TargetFramework>$(PreferredTargetFramework)</TargetFramework>
1619
1890
  <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
1620
1891
  <RootNamespace />
1621
1892
  </PropertyGroup>
1622
-
1893
+
1623
1894
  <ItemGroup>
1624
1895
  <PackageReference Include="Microsoft.NET.Test.Sdk" />
1625
1896
  <PackageReference Include="Microsoft.VisualStudio.Sdk.TestFramework" />
@@ -1668,11 +1939,11 @@ public partial class UpdateWorkerTests
1668
1939
  // initial
1669
1940
  projectContents: """
1670
1941
  <Project Sdk="Microsoft.NET.Sdk">
1671
-
1942
+
1672
1943
  <PropertyGroup>
1673
1944
  <TargetFramework>net5.0</TargetFramework>
1674
1945
  </PropertyGroup>
1675
-
1946
+
1676
1947
  <ItemGroup>
1677
1948
  <PackageReference Include="Mongo2Go" />
1678
1949
  </ItemGroup>
@@ -1696,11 +1967,11 @@ public partial class UpdateWorkerTests
1696
1967
  // expected
1697
1968
  expectedProjectContents: """
1698
1969
  <Project Sdk="Microsoft.NET.Sdk">
1699
-
1970
+
1700
1971
  <PropertyGroup>
1701
1972
  <TargetFramework>net5.0</TargetFramework>
1702
1973
  </PropertyGroup>
1703
-
1974
+
1704
1975
  <ItemGroup>
1705
1976
  <PackageReference Include="Mongo2Go" />
1706
1977
  <PackageReference Include="System.Text.Json" />
@@ -1732,12 +2003,12 @@ public partial class UpdateWorkerTests
1732
2003
  // initial
1733
2004
  projectContents: """
1734
2005
  <Project Sdk="Microsoft.NET.Sdk">
1735
-
2006
+
1736
2007
  <PropertyGroup>
1737
2008
  <NoWarn>$(NoWarn);NETSDK1138</NoWarn>
1738
2009
  <TargetFramework>net5.0</TargetFramework>
1739
2010
  </PropertyGroup>
1740
-
2011
+
1741
2012
  <ItemGroup>
1742
2013
  <PackageReference Include="Mongo2Go" />
1743
2014
  </ItemGroup>
@@ -1762,12 +2033,12 @@ public partial class UpdateWorkerTests
1762
2033
  // expected
1763
2034
  expectedProjectContents: """
1764
2035
  <Project Sdk="Microsoft.NET.Sdk">
1765
-
2036
+
1766
2037
  <PropertyGroup>
1767
2038
  <NoWarn>$(NoWarn);NETSDK1138</NoWarn>
1768
2039
  <TargetFramework>net5.0</TargetFramework>
1769
2040
  </PropertyGroup>
1770
-
2041
+
1771
2042
  <ItemGroup>
1772
2043
  <PackageReference Include="Mongo2Go" />
1773
2044
  </ItemGroup>
@@ -2175,5 +2446,38 @@ public partial class UpdateWorkerTests
2175
2446
  """
2176
2447
  );
2177
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
+ }
2178
2482
  }
2179
2483
  }