dependabot-nuget 0.258.0 → 0.260.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +2 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +255 -191
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +63 -35
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +107 -14
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +9 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +18 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +6 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.DotNetToolsJson.cs +6 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +6 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +11 -21
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +95 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +204 -62
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +64 -45
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/MockNuGetPackage.cs +419 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/NuGetUpdater.Core.Test.csproj +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +7 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +77 -19
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DirsProj.cs +120 -91
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs +132 -97
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs +93 -75
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Mixed.cs +45 -42
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1089 -956
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +1624 -1291
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +296 -293
- data/helpers/lib/NuGetUpdater/global.json +6 -0
- data/lib/dependabot/nuget/file_parser.rb +4 -5
- data/lib/dependabot/nuget/file_updater.rb +1 -1
- data/lib/dependabot/nuget/update_checker/dependency_finder.rb +7 -2
- data/lib/dependabot/nuget/update_checker/property_updater.rb +1 -0
- data/lib/dependabot/nuget/update_checker/version_finder.rb +2 -3
- data/lib/dependabot/nuget/update_checker.rb +1 -0
- metadata +8 -5
data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs
CHANGED
@@ -9,120 +9,140 @@ public partial class UpdateWorkerTests
|
|
9
9
|
[Fact]
|
10
10
|
public async Task UpdateSingleDependencyInPackagesConfig()
|
11
11
|
{
|
12
|
-
// update
|
13
|
-
await TestUpdateForProject("
|
12
|
+
// update Some.Package from 7.0.1 to 13.0.1
|
13
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
14
|
+
packages:
|
15
|
+
[
|
16
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
17
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
18
|
+
],
|
14
19
|
// existing
|
15
20
|
projectContents: """
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
21
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
22
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
23
|
+
<PropertyGroup>
|
24
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
25
|
+
</PropertyGroup>
|
26
|
+
<ItemGroup>
|
27
|
+
<None Include="packages.config" />
|
28
|
+
</ItemGroup>
|
29
|
+
<ItemGroup>
|
30
|
+
<Reference Include="Some.Package, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
|
31
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
32
|
+
<Private>True</Private>
|
33
|
+
</Reference>
|
34
|
+
</ItemGroup>
|
35
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
36
|
+
</Project>
|
37
|
+
""",
|
33
38
|
packagesConfigContents: """
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
39
|
+
<packages>
|
40
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
41
|
+
</packages>
|
42
|
+
""",
|
38
43
|
// expected
|
39
44
|
expectedProjectContents: """
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
45
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
46
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
47
|
+
<PropertyGroup>
|
48
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
49
|
+
</PropertyGroup>
|
50
|
+
<ItemGroup>
|
51
|
+
<None Include="packages.config" />
|
52
|
+
</ItemGroup>
|
53
|
+
<ItemGroup>
|
54
|
+
<Reference Include="Some.Package">
|
55
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
56
|
+
<Private>True</Private>
|
57
|
+
</Reference>
|
58
|
+
</ItemGroup>
|
59
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
60
|
+
</Project>
|
61
|
+
""",
|
57
62
|
expectedPackagesConfigContents: """
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
+
<?xml version="1.0" encoding="utf-8"?>
|
64
|
+
<packages>
|
65
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
66
|
+
</packages>
|
67
|
+
"""
|
68
|
+
);
|
63
69
|
}
|
64
70
|
|
65
71
|
[Fact]
|
66
72
|
public async Task UpdateSingleDependencyInPackagesConfig_ReferenceHasNoAssemblyVersion()
|
67
73
|
{
|
68
|
-
// update
|
69
|
-
await TestUpdateForProject("
|
74
|
+
// update Some.Package from 7.0.1 to 13.0.1
|
75
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
76
|
+
packages:
|
77
|
+
[
|
78
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
79
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
80
|
+
],
|
70
81
|
// existing
|
71
82
|
projectContents: """
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
84
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
85
|
+
<PropertyGroup>
|
86
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
87
|
+
</PropertyGroup>
|
88
|
+
<ItemGroup>
|
89
|
+
<None Include="packages.config" />
|
90
|
+
</ItemGroup>
|
91
|
+
<ItemGroup>
|
92
|
+
<Reference Include="Some.Package">
|
93
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
94
|
+
<Private>True</Private>
|
95
|
+
</Reference>
|
96
|
+
</ItemGroup>
|
97
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
98
|
+
</Project>
|
99
|
+
""",
|
89
100
|
packagesConfigContents: """
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
101
|
+
<packages>
|
102
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
103
|
+
</packages>
|
104
|
+
""",
|
94
105
|
// expected
|
95
106
|
expectedProjectContents: """
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
107
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
108
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
109
|
+
<PropertyGroup>
|
110
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
111
|
+
</PropertyGroup>
|
112
|
+
<ItemGroup>
|
113
|
+
<None Include="packages.config" />
|
114
|
+
</ItemGroup>
|
115
|
+
<ItemGroup>
|
116
|
+
<Reference Include="Some.Package">
|
117
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
118
|
+
<Private>True</Private>
|
119
|
+
</Reference>
|
120
|
+
</ItemGroup>
|
121
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
122
|
+
</Project>
|
123
|
+
""",
|
113
124
|
expectedPackagesConfigContents: """
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
125
|
+
<?xml version="1.0" encoding="utf-8"?>
|
126
|
+
<packages>
|
127
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
128
|
+
</packages>
|
129
|
+
"""
|
130
|
+
);
|
119
131
|
}
|
120
132
|
|
121
133
|
[Fact]
|
122
134
|
public async Task UpdateSingleDependencyInPackagesConfig_SpecifiedDependencyHasNoPackagesPath()
|
123
135
|
{
|
124
|
-
// update
|
125
|
-
await TestUpdateForProject("
|
136
|
+
// update Package.With.No.Assembly from 1.0.0
|
137
|
+
await TestUpdateForProject("Package.With.No.Assembly", "1.0.0", "1.1.0",
|
138
|
+
packages:
|
139
|
+
[
|
140
|
+
// this package has no `lib` directory, but it's still valid because it has a `content` directory
|
141
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.0.0", Files: [("content/some-content.txt", [])]),
|
142
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.1.0", Files: [("content/some-content.txt", [])]),
|
143
|
+
// this is a regular package that's not being updated
|
144
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "1.0.0", "net46"),
|
145
|
+
],
|
126
146
|
// existing
|
127
147
|
projectContents: """
|
128
148
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
@@ -134,8 +154,8 @@ public partial class UpdateWorkerTests
|
|
134
154
|
<None Include="packages.config" />
|
135
155
|
</ItemGroup>
|
136
156
|
<ItemGroup>
|
137
|
-
<Reference Include="
|
138
|
-
<HintPath>packages\
|
157
|
+
<Reference Include="Some.Package">
|
158
|
+
<HintPath>packages\Some.Package.1.0.0\lib\net46\Some.Package.dll</HintPath>
|
139
159
|
<Private>True</Private>
|
140
160
|
</Reference>
|
141
161
|
</ItemGroup>
|
@@ -144,8 +164,8 @@ public partial class UpdateWorkerTests
|
|
144
164
|
""",
|
145
165
|
packagesConfigContents: """
|
146
166
|
<packages>
|
147
|
-
<package id="
|
148
|
-
<package id="
|
167
|
+
<package id="Package.With.No.Assembly" version="1.0.0" targetFramework="net46" />
|
168
|
+
<package id="Some.Package" version="1.0.0" targetFramework="net46" />
|
149
169
|
</packages>
|
150
170
|
""",
|
151
171
|
// expected
|
@@ -159,8 +179,8 @@ public partial class UpdateWorkerTests
|
|
159
179
|
<None Include="packages.config" />
|
160
180
|
</ItemGroup>
|
161
181
|
<ItemGroup>
|
162
|
-
<Reference Include="
|
163
|
-
<HintPath>packages\
|
182
|
+
<Reference Include="Some.Package">
|
183
|
+
<HintPath>packages\Some.Package.1.0.0\lib\net46\Some.Package.dll</HintPath>
|
164
184
|
<Private>True</Private>
|
165
185
|
</Reference>
|
166
186
|
</ItemGroup>
|
@@ -170,8 +190,8 @@ public partial class UpdateWorkerTests
|
|
170
190
|
expectedPackagesConfigContents: """
|
171
191
|
<?xml version="1.0" encoding="utf-8"?>
|
172
192
|
<packages>
|
173
|
-
<package id="
|
174
|
-
<package id="
|
193
|
+
<package id="Package.With.No.Assembly" version="1.1.0" targetFramework="net46" />
|
194
|
+
<package id="Some.Package" version="1.0.0" targetFramework="net46" />
|
175
195
|
</packages>
|
176
196
|
"""
|
177
197
|
);
|
@@ -180,8 +200,14 @@ public partial class UpdateWorkerTests
|
|
180
200
|
[Fact]
|
181
201
|
public async Task UpdateSingleDependencyInPackagesConfig_NoPackagesPathCanBeFound()
|
182
202
|
{
|
183
|
-
// update
|
184
|
-
await TestUpdateForProject("
|
203
|
+
// update Package.With.No.Assembly from 1.0.0 to 1.0.0
|
204
|
+
await TestUpdateForProject("Package.With.No.Assembly", "1.0.0", "1.1.0",
|
205
|
+
packages:
|
206
|
+
[
|
207
|
+
// this package has no `lib` directory, but it's still valid because it has a `content` directory
|
208
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.0.0", Files: [("content/some-content.txt", [])]),
|
209
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.1.0", Files: [("content/some-content.txt", [])]),
|
210
|
+
],
|
185
211
|
// existing
|
186
212
|
projectContents: """
|
187
213
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
@@ -197,7 +223,7 @@ public partial class UpdateWorkerTests
|
|
197
223
|
""",
|
198
224
|
packagesConfigContents: """
|
199
225
|
<packages>
|
200
|
-
<package id="
|
226
|
+
<package id="Package.With.No.Assembly" version="1.0.0" targetFramework="net45" />
|
201
227
|
</packages>
|
202
228
|
""",
|
203
229
|
// expected
|
@@ -216,219 +242,299 @@ public partial class UpdateWorkerTests
|
|
216
242
|
expectedPackagesConfigContents: """
|
217
243
|
<?xml version="1.0" encoding="utf-8"?>
|
218
244
|
<packages>
|
219
|
-
<package id="
|
245
|
+
<package id="Package.With.No.Assembly" version="1.1.0" targetFramework="net45" />
|
220
246
|
</packages>
|
221
|
-
"""
|
247
|
+
"""
|
248
|
+
);
|
222
249
|
}
|
223
250
|
|
224
251
|
[Fact]
|
225
|
-
public async Task
|
252
|
+
public async Task UpdateDependency_NoAssembliesAndContentDirectoryDiffersByCase()
|
226
253
|
{
|
227
|
-
// update
|
228
|
-
await TestUpdateForProject("
|
254
|
+
// update Package.With.No.Assembly from 1.0.0 to 1.0.0
|
255
|
+
await TestUpdateForProject("Package.With.No.Assembly", "1.0.0", "1.1.0",
|
256
|
+
packages:
|
257
|
+
[
|
258
|
+
// this package is expected to have a directory named `content`, but here it differs by case as `Content`
|
259
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.0.0", Files: [("Content/some-content.txt", [])]),
|
260
|
+
new MockNuGetPackage("Package.With.No.Assembly", "1.1.0", Files: [("Content/some-content.txt", [])]),
|
261
|
+
],
|
229
262
|
// existing
|
230
263
|
projectContents: """
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
<Private>True</Private>
|
243
|
-
</Reference>
|
244
|
-
</ItemGroup>
|
245
|
-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
246
|
-
</Project>
|
247
|
-
""",
|
264
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
265
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
266
|
+
<PropertyGroup>
|
267
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
268
|
+
</PropertyGroup>
|
269
|
+
<ItemGroup>
|
270
|
+
<None Include="packages.config" />
|
271
|
+
</ItemGroup>
|
272
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
273
|
+
</Project>
|
274
|
+
""",
|
248
275
|
packagesConfigContents: """
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
276
|
+
<packages>
|
277
|
+
<package id="Package.With.No.Assembly" version="1.0.0" targetFramework="net45" />
|
278
|
+
</packages>
|
279
|
+
""",
|
253
280
|
// expected
|
254
281
|
expectedProjectContents: """
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
<Private>True</Private>
|
267
|
-
</Reference>
|
268
|
-
</ItemGroup>
|
269
|
-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
270
|
-
</Project>
|
271
|
-
""",
|
282
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
283
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
284
|
+
<PropertyGroup>
|
285
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
286
|
+
</PropertyGroup>
|
287
|
+
<ItemGroup>
|
288
|
+
<None Include="packages.config" />
|
289
|
+
</ItemGroup>
|
290
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
291
|
+
</Project>
|
292
|
+
""",
|
272
293
|
expectedPackagesConfigContents: """
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
294
|
+
<?xml version="1.0" encoding="utf-8"?>
|
295
|
+
<packages>
|
296
|
+
<package id="Package.With.No.Assembly" version="1.1.0" targetFramework="net45" />
|
297
|
+
</packages>
|
298
|
+
"""
|
299
|
+
);
|
278
300
|
}
|
279
301
|
|
280
302
|
[Fact]
|
281
|
-
public async Task
|
303
|
+
public async Task UpdateSingleDependencyInPackagesConfigButNotToLatest()
|
282
304
|
{
|
283
|
-
// update
|
284
|
-
await TestUpdateForProject("
|
305
|
+
// update Some.Package from 7.0.1 to 9.0.1, purposefully not updating all the way to the newest
|
306
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "9.0.1",
|
307
|
+
packages:
|
308
|
+
[
|
309
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
310
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "9.0.1", "net45"),
|
311
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
312
|
+
],
|
285
313
|
// existing
|
286
314
|
projectContents: """
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<
|
302
|
-
|
303
|
-
|
304
|
-
</ItemGroup>
|
305
|
-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
306
|
-
</Project>
|
307
|
-
""",
|
315
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
316
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
317
|
+
<PropertyGroup>
|
318
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
319
|
+
</PropertyGroup>
|
320
|
+
<ItemGroup>
|
321
|
+
<None Include="packages.config" />
|
322
|
+
</ItemGroup>
|
323
|
+
<ItemGroup>
|
324
|
+
<Reference Include="Some.Package">
|
325
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
326
|
+
<Private>True</Private>
|
327
|
+
</Reference>
|
328
|
+
</ItemGroup>
|
329
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
330
|
+
</Project>
|
331
|
+
""",
|
308
332
|
packagesConfigContents: """
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
""",
|
333
|
+
<packages>
|
334
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
335
|
+
</packages>
|
336
|
+
""",
|
314
337
|
// expected
|
315
338
|
expectedProjectContents: """
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
<
|
331
|
-
|
332
|
-
|
333
|
-
</ItemGroup>
|
334
|
-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
335
|
-
</Project>
|
336
|
-
""",
|
339
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
340
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
341
|
+
<PropertyGroup>
|
342
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
343
|
+
</PropertyGroup>
|
344
|
+
<ItemGroup>
|
345
|
+
<None Include="packages.config" />
|
346
|
+
</ItemGroup>
|
347
|
+
<ItemGroup>
|
348
|
+
<Reference Include="Some.Package">
|
349
|
+
<HintPath>packages\Some.Package.9.0.1\lib\net45\Some.Package.dll</HintPath>
|
350
|
+
<Private>True</Private>
|
351
|
+
</Reference>
|
352
|
+
</ItemGroup>
|
353
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
354
|
+
</Project>
|
355
|
+
""",
|
337
356
|
expectedPackagesConfigContents: """
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
357
|
+
<?xml version="1.0" encoding="utf-8"?>
|
358
|
+
<packages>
|
359
|
+
<package id="Some.Package" version="9.0.1" targetFramework="net45" />
|
360
|
+
</packages>
|
361
|
+
"""
|
362
|
+
);
|
363
|
+
}
|
364
|
+
|
365
|
+
[Fact]
|
366
|
+
public async Task UpdateSpecifiedVersionInPackagesConfigButNotOthers()
|
367
|
+
{
|
368
|
+
// update Some.Package from 7.0.1 to 13.0.1, but leave Some.Unrelated.Package alone
|
369
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
370
|
+
packages:
|
371
|
+
[
|
372
|
+
// this package is upgraded
|
373
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
374
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
375
|
+
// this package is not upgraded
|
376
|
+
MockNuGetPackage.CreateSimplePackage("Some.Unrelated.Package", "1.0.0", "net45"),
|
377
|
+
MockNuGetPackage.CreateSimplePackage("Some.Unrelated.Package", "1.1.0", "net45"),
|
378
|
+
],
|
379
|
+
// existing
|
380
|
+
projectContents: """
|
381
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
382
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
383
|
+
<PropertyGroup>
|
384
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
385
|
+
</PropertyGroup>
|
386
|
+
<ItemGroup>
|
387
|
+
<None Include="packages.config" />
|
388
|
+
</ItemGroup>
|
389
|
+
<ItemGroup>
|
390
|
+
<Reference Include="Some.Package">
|
391
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
392
|
+
<Private>True</Private>
|
393
|
+
</Reference>
|
394
|
+
<Reference Include="Some.Unrelated.Package">
|
395
|
+
<HintPath>packages\Some.Unrelated.Package.1.0.0\lib\net45\Some.Unrelated.Package.dll</HintPath>
|
396
|
+
<Private>True</Private>
|
397
|
+
</Reference>
|
398
|
+
</ItemGroup>
|
399
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
400
|
+
</Project>
|
401
|
+
""",
|
402
|
+
packagesConfigContents: """
|
403
|
+
<packages>
|
404
|
+
<package id="Some.Unrelated.Package" version="1.0.0" targetFramework="net45" />
|
405
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
406
|
+
</packages>
|
407
|
+
""",
|
408
|
+
// expected
|
409
|
+
expectedProjectContents: """
|
410
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
411
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
412
|
+
<PropertyGroup>
|
413
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
414
|
+
</PropertyGroup>
|
415
|
+
<ItemGroup>
|
416
|
+
<None Include="packages.config" />
|
417
|
+
</ItemGroup>
|
418
|
+
<ItemGroup>
|
419
|
+
<Reference Include="Some.Package">
|
420
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
421
|
+
<Private>True</Private>
|
422
|
+
</Reference>
|
423
|
+
<Reference Include="Some.Unrelated.Package">
|
424
|
+
<HintPath>packages\Some.Unrelated.Package.1.0.0\lib\net45\Some.Unrelated.Package.dll</HintPath>
|
425
|
+
<Private>True</Private>
|
426
|
+
</Reference>
|
427
|
+
</ItemGroup>
|
428
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
429
|
+
</Project>
|
430
|
+
""",
|
431
|
+
expectedPackagesConfigContents: """
|
432
|
+
<?xml version="1.0" encoding="utf-8"?>
|
433
|
+
<packages>
|
434
|
+
<package id="Some.Unrelated.Package" version="1.0.0" targetFramework="net45" />
|
435
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
436
|
+
</packages>
|
437
|
+
"""
|
438
|
+
);
|
344
439
|
}
|
345
440
|
|
346
441
|
[Fact]
|
347
442
|
public async Task UpdatePackagesConfigWithNonStandardLocationOfPackagesDirectory()
|
348
443
|
{
|
349
|
-
// update
|
350
|
-
await TestUpdateForProject("
|
444
|
+
// update Some.Package from 7.0.1 to 13.0.1 with the actual assembly in a non-standard location
|
445
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
446
|
+
packages:
|
447
|
+
[
|
448
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
449
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
450
|
+
],
|
351
451
|
// existing
|
352
452
|
projectContents: """
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
453
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
454
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
455
|
+
<PropertyGroup>
|
456
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
457
|
+
</PropertyGroup>
|
458
|
+
<ItemGroup>
|
459
|
+
<None Include="packages.config" />
|
460
|
+
</ItemGroup>
|
461
|
+
<ItemGroup>
|
462
|
+
<Reference Include="Some.Package">
|
463
|
+
<HintPath>some-non-standard-location\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
464
|
+
<Private>True</Private>
|
465
|
+
</Reference>
|
466
|
+
</ItemGroup>
|
467
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
468
|
+
</Project>
|
469
|
+
""",
|
370
470
|
packagesConfigContents: """
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
471
|
+
<packages>
|
472
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
473
|
+
</packages>
|
474
|
+
""",
|
375
475
|
// expected
|
376
476
|
expectedProjectContents: """
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
477
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
478
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
479
|
+
<PropertyGroup>
|
480
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
481
|
+
</PropertyGroup>
|
482
|
+
<ItemGroup>
|
483
|
+
<None Include="packages.config" />
|
484
|
+
</ItemGroup>
|
485
|
+
<ItemGroup>
|
486
|
+
<Reference Include="Some.Package">
|
487
|
+
<HintPath>some-non-standard-location\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
488
|
+
<Private>True</Private>
|
489
|
+
</Reference>
|
490
|
+
</ItemGroup>
|
491
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
492
|
+
</Project>
|
493
|
+
""",
|
394
494
|
expectedPackagesConfigContents: """
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
495
|
+
<?xml version="1.0" encoding="utf-8"?>
|
496
|
+
<packages>
|
497
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
498
|
+
</packages>
|
499
|
+
"""
|
500
|
+
);
|
400
501
|
}
|
401
502
|
|
402
503
|
[Fact]
|
403
504
|
public async Task UpdateBindingRedirectInAppConfig()
|
404
505
|
{
|
405
|
-
await TestUpdateForProject("
|
506
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
507
|
+
packages:
|
508
|
+
[
|
509
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "7.0.1", "net45", "7.0.0.0"),
|
510
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "13.0.1", "net45", "13.0.0.0"),
|
511
|
+
],
|
406
512
|
projectContents: """
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
513
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
514
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
515
|
+
<PropertyGroup>
|
516
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
517
|
+
</PropertyGroup>
|
518
|
+
<ItemGroup>
|
519
|
+
<None Include="packages.config" />
|
520
|
+
</ItemGroup>
|
521
|
+
<ItemGroup>
|
522
|
+
<None Include="app.config" />
|
523
|
+
</ItemGroup>
|
524
|
+
<ItemGroup>
|
525
|
+
<Reference Include="Some.Package, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null">
|
526
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
527
|
+
<Private>True</Private>
|
528
|
+
</Reference>
|
529
|
+
</ItemGroup>
|
530
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
531
|
+
</Project>
|
532
|
+
""",
|
427
533
|
packagesConfigContents: """
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
534
|
+
<packages>
|
535
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
536
|
+
</packages>
|
537
|
+
""",
|
432
538
|
additionalFiles:
|
433
539
|
[
|
434
540
|
("app.config", """
|
@@ -436,7 +542,7 @@ public partial class UpdateWorkerTests
|
|
436
542
|
<runtime>
|
437
543
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
438
544
|
<dependentAssembly>
|
439
|
-
<assemblyIdentity name="
|
545
|
+
<assemblyIdentity name="Some.Package" publicKeyToken="null" culture="neutral" />
|
440
546
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
441
547
|
</dependentAssembly>
|
442
548
|
</assemblyBinding>
|
@@ -445,32 +551,32 @@ public partial class UpdateWorkerTests
|
|
445
551
|
""")
|
446
552
|
],
|
447
553
|
expectedProjectContents: """
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
554
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
555
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
556
|
+
<PropertyGroup>
|
557
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
558
|
+
</PropertyGroup>
|
559
|
+
<ItemGroup>
|
560
|
+
<None Include="packages.config" />
|
561
|
+
</ItemGroup>
|
562
|
+
<ItemGroup>
|
563
|
+
<None Include="app.config" />
|
564
|
+
</ItemGroup>
|
565
|
+
<ItemGroup>
|
566
|
+
<Reference Include="Some.Package, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null">
|
567
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
568
|
+
<Private>True</Private>
|
569
|
+
</Reference>
|
570
|
+
</ItemGroup>
|
571
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
572
|
+
</Project>
|
573
|
+
""",
|
468
574
|
expectedPackagesConfigContents: """
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
575
|
+
<?xml version="1.0" encoding="utf-8"?>
|
576
|
+
<packages>
|
577
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
578
|
+
</packages>
|
579
|
+
""",
|
474
580
|
additionalFilesExpected:
|
475
581
|
[
|
476
582
|
("app.config", """
|
@@ -478,104 +584,110 @@ public partial class UpdateWorkerTests
|
|
478
584
|
<runtime>
|
479
585
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
480
586
|
<dependentAssembly>
|
481
|
-
<assemblyIdentity name="
|
587
|
+
<assemblyIdentity name="Some.Package" publicKeyToken="null" culture="neutral" />
|
482
588
|
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
483
589
|
</dependentAssembly>
|
484
590
|
</assemblyBinding>
|
485
591
|
</runtime>
|
486
592
|
</configuration>
|
487
593
|
""")
|
488
|
-
]
|
594
|
+
]
|
595
|
+
);
|
489
596
|
}
|
490
597
|
|
491
598
|
[Fact]
|
492
599
|
public async Task UpdateBindingRedirectInWebConfig()
|
493
600
|
{
|
494
|
-
await TestUpdateForProject("
|
601
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
602
|
+
packages:
|
603
|
+
[
|
604
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "7.0.1", "net45", "7.0.0.0"),
|
605
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "13.0.1", "net45", "13.0.0.0"),
|
606
|
+
],
|
495
607
|
projectContents: """
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
608
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
609
|
+
<PropertyGroup>
|
610
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
611
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
612
|
+
<ProductVersion>
|
613
|
+
</ProductVersion>
|
614
|
+
<SchemaVersion>2.0</SchemaVersion>
|
615
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
616
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
617
|
+
<OutputType>Library</OutputType>
|
618
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
619
|
+
<RootNamespace>TestProject</RootNamespace>
|
620
|
+
<AssemblyName>TestProject</AssemblyName>
|
621
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
622
|
+
</PropertyGroup>
|
623
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
624
|
+
<DebugSymbols>true</DebugSymbols>
|
625
|
+
<DebugType>full</DebugType>
|
626
|
+
<Optimize>false</Optimize>
|
627
|
+
<OutputPath>bin\</OutputPath>
|
628
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
629
|
+
<ErrorReport>prompt</ErrorReport>
|
630
|
+
<WarningLevel>4</WarningLevel>
|
631
|
+
</PropertyGroup>
|
632
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
633
|
+
<DebugType>pdbonly</DebugType>
|
634
|
+
<Optimize>true</Optimize>
|
635
|
+
<OutputPath>bin\</OutputPath>
|
636
|
+
<DefineConstants>TRACE</DefineConstants>
|
637
|
+
<ErrorReport>prompt</ErrorReport>
|
638
|
+
<WarningLevel>4</WarningLevel>
|
639
|
+
</PropertyGroup>
|
640
|
+
<ItemGroup>
|
641
|
+
<Reference Include="Microsoft.CSharp" />
|
642
|
+
<Reference Include="Some.Package, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null">
|
643
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
644
|
+
<Private>True</Private>
|
645
|
+
</Reference>
|
646
|
+
<Reference Include="System.Web.DynamicData" />
|
647
|
+
<Reference Include="System.Web.Entity" />
|
648
|
+
<Reference Include="System.Web.ApplicationServices" />
|
649
|
+
<Reference Include="System" />
|
650
|
+
<Reference Include="System.Data" />
|
651
|
+
<Reference Include="System.Core" />
|
652
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
653
|
+
<Reference Include="System.Web.Extensions" />
|
654
|
+
<Reference Include="System.Xml.Linq" />
|
655
|
+
<Reference Include="System.Drawing" />
|
656
|
+
<Reference Include="System.Web" />
|
657
|
+
<Reference Include="System.Xml" />
|
658
|
+
<Reference Include="System.Configuration" />
|
659
|
+
<Reference Include="System.Web.Services" />
|
660
|
+
<Reference Include="System.EnterpriseServices" />
|
661
|
+
</ItemGroup>
|
662
|
+
<ItemGroup>
|
663
|
+
<None Include="packages.config" />
|
664
|
+
<Content Include="web.config" />
|
665
|
+
<Content Include="web.Debug.config">
|
666
|
+
<DependentUpon>web.config</DependentUpon>
|
667
|
+
</Content>
|
668
|
+
<Content Include="web.Release.config">
|
669
|
+
<DependentUpon>web.config</DependentUpon>
|
670
|
+
</Content>
|
671
|
+
</ItemGroup>
|
672
|
+
<ItemGroup>
|
673
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
674
|
+
</ItemGroup>
|
675
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
676
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
677
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
678
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
679
|
+
<Target Name="BeforeBuild">
|
680
|
+
</Target>
|
681
|
+
<Target Name="AfterBuild">
|
682
|
+
</Target>
|
683
|
+
-->
|
684
|
+
</Project>
|
685
|
+
""",
|
574
686
|
packagesConfigContents: """
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
687
|
+
<packages>
|
688
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
689
|
+
</packages>
|
690
|
+
""",
|
579
691
|
additionalFiles:
|
580
692
|
[
|
581
693
|
("web.config", """
|
@@ -583,7 +695,7 @@ public partial class UpdateWorkerTests
|
|
583
695
|
<runtime>
|
584
696
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
585
697
|
<dependentAssembly>
|
586
|
-
<assemblyIdentity name="
|
698
|
+
<assemblyIdentity name="Some.Package" publicKeyToken="null" culture="neutral" />
|
587
699
|
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
|
588
700
|
</dependentAssembly>
|
589
701
|
</assemblyBinding>
|
@@ -592,90 +704,90 @@ public partial class UpdateWorkerTests
|
|
592
704
|
""")
|
593
705
|
],
|
594
706
|
expectedProjectContents: """
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
707
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
708
|
+
<PropertyGroup>
|
709
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
710
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
711
|
+
<ProductVersion>
|
712
|
+
</ProductVersion>
|
713
|
+
<SchemaVersion>2.0</SchemaVersion>
|
714
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
715
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
716
|
+
<OutputType>Library</OutputType>
|
717
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
718
|
+
<RootNamespace>TestProject</RootNamespace>
|
719
|
+
<AssemblyName>TestProject</AssemblyName>
|
720
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
721
|
+
</PropertyGroup>
|
722
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
723
|
+
<DebugSymbols>true</DebugSymbols>
|
724
|
+
<DebugType>full</DebugType>
|
725
|
+
<Optimize>false</Optimize>
|
726
|
+
<OutputPath>bin\</OutputPath>
|
727
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
728
|
+
<ErrorReport>prompt</ErrorReport>
|
729
|
+
<WarningLevel>4</WarningLevel>
|
730
|
+
</PropertyGroup>
|
731
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
732
|
+
<DebugType>pdbonly</DebugType>
|
733
|
+
<Optimize>true</Optimize>
|
734
|
+
<OutputPath>bin\</OutputPath>
|
735
|
+
<DefineConstants>TRACE</DefineConstants>
|
736
|
+
<ErrorReport>prompt</ErrorReport>
|
737
|
+
<WarningLevel>4</WarningLevel>
|
738
|
+
</PropertyGroup>
|
739
|
+
<ItemGroup>
|
740
|
+
<Reference Include="Microsoft.CSharp" />
|
741
|
+
<Reference Include="Some.Package, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null">
|
742
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
743
|
+
<Private>True</Private>
|
744
|
+
</Reference>
|
745
|
+
<Reference Include="System.Web.DynamicData" />
|
746
|
+
<Reference Include="System.Web.Entity" />
|
747
|
+
<Reference Include="System.Web.ApplicationServices" />
|
748
|
+
<Reference Include="System" />
|
749
|
+
<Reference Include="System.Data" />
|
750
|
+
<Reference Include="System.Core" />
|
751
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
752
|
+
<Reference Include="System.Web.Extensions" />
|
753
|
+
<Reference Include="System.Xml.Linq" />
|
754
|
+
<Reference Include="System.Drawing" />
|
755
|
+
<Reference Include="System.Web" />
|
756
|
+
<Reference Include="System.Xml" />
|
757
|
+
<Reference Include="System.Configuration" />
|
758
|
+
<Reference Include="System.Web.Services" />
|
759
|
+
<Reference Include="System.EnterpriseServices" />
|
760
|
+
</ItemGroup>
|
761
|
+
<ItemGroup>
|
762
|
+
<None Include="packages.config" />
|
763
|
+
<Content Include="web.config" />
|
764
|
+
<Content Include="web.Debug.config">
|
765
|
+
<DependentUpon>web.config</DependentUpon>
|
766
|
+
</Content>
|
767
|
+
<Content Include="web.Release.config">
|
768
|
+
<DependentUpon>web.config</DependentUpon>
|
769
|
+
</Content>
|
770
|
+
</ItemGroup>
|
771
|
+
<ItemGroup>
|
772
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
773
|
+
</ItemGroup>
|
774
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
775
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
776
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
777
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
778
|
+
<Target Name="BeforeBuild">
|
779
|
+
</Target>
|
780
|
+
<Target Name="AfterBuild">
|
781
|
+
</Target>
|
782
|
+
-->
|
783
|
+
</Project>
|
784
|
+
""",
|
673
785
|
expectedPackagesConfigContents: """
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
786
|
+
<?xml version="1.0" encoding="utf-8"?>
|
787
|
+
<packages>
|
788
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
789
|
+
</packages>
|
790
|
+
""",
|
679
791
|
additionalFilesExpected:
|
680
792
|
[
|
681
793
|
("web.config", """
|
@@ -683,104 +795,110 @@ public partial class UpdateWorkerTests
|
|
683
795
|
<runtime>
|
684
796
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
685
797
|
<dependentAssembly>
|
686
|
-
<assemblyIdentity name="
|
798
|
+
<assemblyIdentity name="Some.Package" publicKeyToken="null" culture="neutral" />
|
687
799
|
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
688
800
|
</dependentAssembly>
|
689
801
|
</assemblyBinding>
|
690
802
|
</runtime>
|
691
803
|
</configuration>
|
692
804
|
""")
|
693
|
-
]
|
805
|
+
]
|
806
|
+
);
|
694
807
|
}
|
695
808
|
|
696
809
|
[Fact]
|
697
810
|
public async Task AddsBindingRedirectInWebConfig()
|
698
811
|
{
|
699
|
-
await TestUpdateForProject("
|
812
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
813
|
+
packages:
|
814
|
+
[
|
815
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "7.0.1", "net45", "7.0.0.0"),
|
816
|
+
MockNuGetPackage.CreatePackageWithAssembly("Some.Package", "13.0.1", "net45", "13.0.0.0"),
|
817
|
+
],
|
700
818
|
projectContents: """
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
819
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
820
|
+
<PropertyGroup>
|
821
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
822
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
823
|
+
<ProductVersion>
|
824
|
+
</ProductVersion>
|
825
|
+
<SchemaVersion>2.0</SchemaVersion>
|
826
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
827
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
828
|
+
<OutputType>Library</OutputType>
|
829
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
830
|
+
<RootNamespace>TestProject</RootNamespace>
|
831
|
+
<AssemblyName>TestProject</AssemblyName>
|
832
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
833
|
+
</PropertyGroup>
|
834
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
835
|
+
<DebugSymbols>true</DebugSymbols>
|
836
|
+
<DebugType>full</DebugType>
|
837
|
+
<Optimize>false</Optimize>
|
838
|
+
<OutputPath>bin\</OutputPath>
|
839
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
840
|
+
<ErrorReport>prompt</ErrorReport>
|
841
|
+
<WarningLevel>4</WarningLevel>
|
842
|
+
</PropertyGroup>
|
843
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
844
|
+
<DebugType>pdbonly</DebugType>
|
845
|
+
<Optimize>true</Optimize>
|
846
|
+
<OutputPath>bin\</OutputPath>
|
847
|
+
<DefineConstants>TRACE</DefineConstants>
|
848
|
+
<ErrorReport>prompt</ErrorReport>
|
849
|
+
<WarningLevel>4</WarningLevel>
|
850
|
+
</PropertyGroup>
|
851
|
+
<ItemGroup>
|
852
|
+
<Reference Include="Microsoft.CSharp" />
|
853
|
+
<Reference Include="Some.Package, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null">
|
854
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
855
|
+
<Private>True</Private>
|
856
|
+
</Reference>
|
857
|
+
<Reference Include="System.Web.DynamicData" />
|
858
|
+
<Reference Include="System.Web.Entity" />
|
859
|
+
<Reference Include="System.Web.ApplicationServices" />
|
860
|
+
<Reference Include="System" />
|
861
|
+
<Reference Include="System.Data" />
|
862
|
+
<Reference Include="System.Core" />
|
863
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
864
|
+
<Reference Include="System.Web.Extensions" />
|
865
|
+
<Reference Include="System.Xml.Linq" />
|
866
|
+
<Reference Include="System.Drawing" />
|
867
|
+
<Reference Include="System.Web" />
|
868
|
+
<Reference Include="System.Xml" />
|
869
|
+
<Reference Include="System.Configuration" />
|
870
|
+
<Reference Include="System.Web.Services" />
|
871
|
+
<Reference Include="System.EnterpriseServices" />
|
872
|
+
</ItemGroup>
|
873
|
+
<ItemGroup>
|
874
|
+
<None Include="packages.config" />
|
875
|
+
<Content Include="web.config" />
|
876
|
+
<Content Include="web.Debug.config">
|
877
|
+
<DependentUpon>web.config</DependentUpon>
|
878
|
+
</Content>
|
879
|
+
<Content Include="web.Release.config">
|
880
|
+
<DependentUpon>web.config</DependentUpon>
|
881
|
+
</Content>
|
882
|
+
</ItemGroup>
|
883
|
+
<ItemGroup>
|
884
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
885
|
+
</ItemGroup>
|
886
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
887
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
888
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
889
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
890
|
+
<Target Name="BeforeBuild">
|
891
|
+
</Target>
|
892
|
+
<Target Name="AfterBuild">
|
893
|
+
</Target>
|
894
|
+
-->
|
895
|
+
</Project>
|
896
|
+
""",
|
779
897
|
packagesConfigContents: """
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
898
|
+
<packages>
|
899
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
900
|
+
</packages>
|
901
|
+
""",
|
784
902
|
additionalFiles:
|
785
903
|
[
|
786
904
|
("web.config", """
|
@@ -791,90 +909,90 @@ public partial class UpdateWorkerTests
|
|
791
909
|
""")
|
792
910
|
],
|
793
911
|
expectedProjectContents: """
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
847
|
-
|
848
|
-
|
849
|
-
|
850
|
-
|
851
|
-
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
912
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
913
|
+
<PropertyGroup>
|
914
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
915
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
916
|
+
<ProductVersion>
|
917
|
+
</ProductVersion>
|
918
|
+
<SchemaVersion>2.0</SchemaVersion>
|
919
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
920
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
921
|
+
<OutputType>Library</OutputType>
|
922
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
923
|
+
<RootNamespace>TestProject</RootNamespace>
|
924
|
+
<AssemblyName>TestProject</AssemblyName>
|
925
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
926
|
+
</PropertyGroup>
|
927
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
928
|
+
<DebugSymbols>true</DebugSymbols>
|
929
|
+
<DebugType>full</DebugType>
|
930
|
+
<Optimize>false</Optimize>
|
931
|
+
<OutputPath>bin\</OutputPath>
|
932
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
933
|
+
<ErrorReport>prompt</ErrorReport>
|
934
|
+
<WarningLevel>4</WarningLevel>
|
935
|
+
</PropertyGroup>
|
936
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
937
|
+
<DebugType>pdbonly</DebugType>
|
938
|
+
<Optimize>true</Optimize>
|
939
|
+
<OutputPath>bin\</OutputPath>
|
940
|
+
<DefineConstants>TRACE</DefineConstants>
|
941
|
+
<ErrorReport>prompt</ErrorReport>
|
942
|
+
<WarningLevel>4</WarningLevel>
|
943
|
+
</PropertyGroup>
|
944
|
+
<ItemGroup>
|
945
|
+
<Reference Include="Microsoft.CSharp" />
|
946
|
+
<Reference Include="Some.Package, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null">
|
947
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
948
|
+
<Private>True</Private>
|
949
|
+
</Reference>
|
950
|
+
<Reference Include="System.Web.DynamicData" />
|
951
|
+
<Reference Include="System.Web.Entity" />
|
952
|
+
<Reference Include="System.Web.ApplicationServices" />
|
953
|
+
<Reference Include="System" />
|
954
|
+
<Reference Include="System.Data" />
|
955
|
+
<Reference Include="System.Core" />
|
956
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
957
|
+
<Reference Include="System.Web.Extensions" />
|
958
|
+
<Reference Include="System.Xml.Linq" />
|
959
|
+
<Reference Include="System.Drawing" />
|
960
|
+
<Reference Include="System.Web" />
|
961
|
+
<Reference Include="System.Xml" />
|
962
|
+
<Reference Include="System.Configuration" />
|
963
|
+
<Reference Include="System.Web.Services" />
|
964
|
+
<Reference Include="System.EnterpriseServices" />
|
965
|
+
</ItemGroup>
|
966
|
+
<ItemGroup>
|
967
|
+
<None Include="packages.config" />
|
968
|
+
<Content Include="web.config" />
|
969
|
+
<Content Include="web.Debug.config">
|
970
|
+
<DependentUpon>web.config</DependentUpon>
|
971
|
+
</Content>
|
972
|
+
<Content Include="web.Release.config">
|
973
|
+
<DependentUpon>web.config</DependentUpon>
|
974
|
+
</Content>
|
975
|
+
</ItemGroup>
|
976
|
+
<ItemGroup>
|
977
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
978
|
+
</ItemGroup>
|
979
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
980
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
981
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
982
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
983
|
+
<Target Name="BeforeBuild">
|
984
|
+
</Target>
|
985
|
+
<Target Name="AfterBuild">
|
986
|
+
</Target>
|
987
|
+
-->
|
988
|
+
</Project>
|
989
|
+
""",
|
872
990
|
expectedPackagesConfigContents: """
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
991
|
+
<?xml version="1.0" encoding="utf-8"?>
|
992
|
+
<packages>
|
993
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
994
|
+
</packages>
|
995
|
+
""",
|
878
996
|
additionalFilesExpected:
|
879
997
|
[
|
880
998
|
("web.config", """
|
@@ -882,345 +1000,358 @@ public partial class UpdateWorkerTests
|
|
882
1000
|
<runtime>
|
883
1001
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
884
1002
|
<dependentAssembly>
|
885
|
-
<assemblyIdentity name="
|
1003
|
+
<assemblyIdentity name="Some.Package" publicKeyToken="null" culture="neutral" />
|
886
1004
|
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
|
887
1005
|
</dependentAssembly>
|
888
1006
|
</assemblyBinding>
|
889
1007
|
</runtime>
|
890
1008
|
</configuration>
|
891
1009
|
""")
|
892
|
-
]
|
1010
|
+
]
|
1011
|
+
);
|
893
1012
|
}
|
894
1013
|
|
895
1014
|
[Fact]
|
896
1015
|
public async Task PackagesConfigUpdateCanHappenEvenWithMismatchedVersionNumbers()
|
897
1016
|
{
|
898
1017
|
// `packages.config` reports `7.0.1` and that's what we want to update, but the project file has a mismatch that's corrected
|
899
|
-
await TestUpdateForProject("
|
1018
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
1019
|
+
packages:
|
1020
|
+
[
|
1021
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
1022
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
1023
|
+
],
|
900
1024
|
projectContents: """
|
901
|
-
|
902
|
-
|
903
|
-
|
904
|
-
|
905
|
-
|
906
|
-
|
907
|
-
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
949
|
-
|
950
|
-
|
951
|
-
|
952
|
-
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
|
966
|
-
|
967
|
-
|
968
|
-
|
969
|
-
|
970
|
-
|
971
|
-
|
1025
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
1026
|
+
<PropertyGroup>
|
1027
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
1028
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
1029
|
+
<ProductVersion>
|
1030
|
+
</ProductVersion>
|
1031
|
+
<SchemaVersion>2.0</SchemaVersion>
|
1032
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
1033
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
1034
|
+
<OutputType>Library</OutputType>
|
1035
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
1036
|
+
<RootNamespace>TestProject</RootNamespace>
|
1037
|
+
<AssemblyName>TestProject</AssemblyName>
|
1038
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
1039
|
+
</PropertyGroup>
|
1040
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
1041
|
+
<DebugSymbols>true</DebugSymbols>
|
1042
|
+
<DebugType>full</DebugType>
|
1043
|
+
<Optimize>false</Optimize>
|
1044
|
+
<OutputPath>bin\</OutputPath>
|
1045
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
1046
|
+
<ErrorReport>prompt</ErrorReport>
|
1047
|
+
<WarningLevel>4</WarningLevel>
|
1048
|
+
</PropertyGroup>
|
1049
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
1050
|
+
<DebugType>pdbonly</DebugType>
|
1051
|
+
<Optimize>true</Optimize>
|
1052
|
+
<OutputPath>bin\</OutputPath>
|
1053
|
+
<DefineConstants>TRACE</DefineConstants>
|
1054
|
+
<ErrorReport>prompt</ErrorReport>
|
1055
|
+
<WarningLevel>4</WarningLevel>
|
1056
|
+
</PropertyGroup>
|
1057
|
+
<ItemGroup>
|
1058
|
+
<Reference Include="Microsoft.CSharp" />
|
1059
|
+
<Reference Include="Some.Package, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed">
|
1060
|
+
<HintPath>packages\Some.Package.6.0.8\lib\net45\Some.Package.dll</HintPath>
|
1061
|
+
<Private>True</Private>
|
1062
|
+
</Reference>
|
1063
|
+
<Reference Include="System.Web.DynamicData" />
|
1064
|
+
<Reference Include="System.Web.Entity" />
|
1065
|
+
<Reference Include="System.Web.ApplicationServices" />
|
1066
|
+
<Reference Include="System" />
|
1067
|
+
<Reference Include="System.Data" />
|
1068
|
+
<Reference Include="System.Core" />
|
1069
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
1070
|
+
<Reference Include="System.Web.Extensions" />
|
1071
|
+
<Reference Include="System.Xml.Linq" />
|
1072
|
+
<Reference Include="System.Drawing" />
|
1073
|
+
<Reference Include="System.Web" />
|
1074
|
+
<Reference Include="System.Xml" />
|
1075
|
+
<Reference Include="System.Configuration" />
|
1076
|
+
<Reference Include="System.Web.Services" />
|
1077
|
+
<Reference Include="System.EnterpriseServices" />
|
1078
|
+
</ItemGroup>
|
1079
|
+
<ItemGroup>
|
1080
|
+
<None Include="packages.config" />
|
1081
|
+
</ItemGroup>
|
1082
|
+
<ItemGroup>
|
1083
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
1084
|
+
</ItemGroup>
|
1085
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
1086
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
1087
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
1088
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
1089
|
+
<Target Name="BeforeBuild">
|
1090
|
+
</Target>
|
1091
|
+
<Target Name="AfterBuild">
|
1092
|
+
</Target>
|
1093
|
+
-->
|
1094
|
+
</Project>
|
1095
|
+
""",
|
972
1096
|
packagesConfigContents: """
|
973
|
-
|
974
|
-
|
975
|
-
|
976
|
-
|
1097
|
+
<packages>
|
1098
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
1099
|
+
</packages>
|
1100
|
+
""",
|
977
1101
|
expectedProjectContents: """
|
978
|
-
|
979
|
-
|
980
|
-
|
981
|
-
|
982
|
-
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
|
988
|
-
|
989
|
-
|
990
|
-
|
991
|
-
|
992
|
-
|
993
|
-
|
994
|
-
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1000
|
-
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1016
|
-
|
1017
|
-
|
1018
|
-
|
1019
|
-
|
1020
|
-
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1102
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
1103
|
+
<PropertyGroup>
|
1104
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
1105
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
1106
|
+
<ProductVersion>
|
1107
|
+
</ProductVersion>
|
1108
|
+
<SchemaVersion>2.0</SchemaVersion>
|
1109
|
+
<ProjectGuid>ac83fc79-b637-445b-acb0-9be238ad077f</ProjectGuid>
|
1110
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
1111
|
+
<OutputType>Library</OutputType>
|
1112
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
1113
|
+
<RootNamespace>TestProject</RootNamespace>
|
1114
|
+
<AssemblyName>TestProject</AssemblyName>
|
1115
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
1116
|
+
</PropertyGroup>
|
1117
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
1118
|
+
<DebugSymbols>true</DebugSymbols>
|
1119
|
+
<DebugType>full</DebugType>
|
1120
|
+
<Optimize>false</Optimize>
|
1121
|
+
<OutputPath>bin\</OutputPath>
|
1122
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
1123
|
+
<ErrorReport>prompt</ErrorReport>
|
1124
|
+
<WarningLevel>4</WarningLevel>
|
1125
|
+
</PropertyGroup>
|
1126
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
1127
|
+
<DebugType>pdbonly</DebugType>
|
1128
|
+
<Optimize>true</Optimize>
|
1129
|
+
<OutputPath>bin\</OutputPath>
|
1130
|
+
<DefineConstants>TRACE</DefineConstants>
|
1131
|
+
<ErrorReport>prompt</ErrorReport>
|
1132
|
+
<WarningLevel>4</WarningLevel>
|
1133
|
+
</PropertyGroup>
|
1134
|
+
<ItemGroup>
|
1135
|
+
<Reference Include="Microsoft.CSharp" />
|
1136
|
+
<Reference Include="Some.Package">
|
1137
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
1138
|
+
<Private>True</Private>
|
1139
|
+
</Reference>
|
1140
|
+
<Reference Include="System.Web.DynamicData" />
|
1141
|
+
<Reference Include="System.Web.Entity" />
|
1142
|
+
<Reference Include="System.Web.ApplicationServices" />
|
1143
|
+
<Reference Include="System" />
|
1144
|
+
<Reference Include="System.Data" />
|
1145
|
+
<Reference Include="System.Core" />
|
1146
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
1147
|
+
<Reference Include="System.Web.Extensions" />
|
1148
|
+
<Reference Include="System.Xml.Linq" />
|
1149
|
+
<Reference Include="System.Drawing" />
|
1150
|
+
<Reference Include="System.Web" />
|
1151
|
+
<Reference Include="System.Xml" />
|
1152
|
+
<Reference Include="System.Configuration" />
|
1153
|
+
<Reference Include="System.Web.Services" />
|
1154
|
+
<Reference Include="System.EnterpriseServices" />
|
1155
|
+
</ItemGroup>
|
1156
|
+
<ItemGroup>
|
1157
|
+
<None Include="packages.config" />
|
1158
|
+
</ItemGroup>
|
1159
|
+
<ItemGroup>
|
1160
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
1161
|
+
</ItemGroup>
|
1162
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
1163
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
1164
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
1165
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
1166
|
+
<Target Name="BeforeBuild">
|
1167
|
+
</Target>
|
1168
|
+
<Target Name="AfterBuild">
|
1169
|
+
</Target>
|
1170
|
+
-->
|
1171
|
+
</Project>
|
1172
|
+
""",
|
1049
1173
|
expectedPackagesConfigContents: """
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1174
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1175
|
+
<packages>
|
1176
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
1177
|
+
</packages>
|
1178
|
+
"""
|
1179
|
+
);
|
1055
1180
|
}
|
1056
1181
|
|
1057
1182
|
[Fact]
|
1058
1183
|
public async Task PackagesConfigUpdateIsNotThwartedBy_VSToolsPath_PropertyBeingSetInUserCode()
|
1059
1184
|
{
|
1060
|
-
await TestUpdateForProject("
|
1185
|
+
await TestUpdateForProject("Some.Package", "7.0.1", "13.0.1",
|
1186
|
+
packages:
|
1187
|
+
[
|
1188
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
1189
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "13.0.1", "net45"),
|
1190
|
+
],
|
1061
1191
|
projectContents: """
|
1062
|
-
|
1063
|
-
|
1064
|
-
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
|
1072
|
-
|
1073
|
-
|
1074
|
-
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
|
1080
|
-
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
1111
|
-
|
1112
|
-
|
1113
|
-
|
1114
|
-
|
1115
|
-
|
1116
|
-
|
1117
|
-
|
1118
|
-
|
1119
|
-
|
1120
|
-
|
1121
|
-
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1192
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
1193
|
+
<PropertyGroup>
|
1194
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
1195
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
1196
|
+
<ProductVersion>
|
1197
|
+
</ProductVersion>
|
1198
|
+
<SchemaVersion>2.0</SchemaVersion>
|
1199
|
+
<ProjectGuid>68ed3303-52a0-47b8-a687-3abbb07530da</ProjectGuid>
|
1200
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
1201
|
+
<OutputType>Library</OutputType>
|
1202
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
1203
|
+
<RootNamespace>TestProject</RootNamespace>
|
1204
|
+
<AssemblyName>TestProject</AssemblyName>
|
1205
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
1206
|
+
</PropertyGroup>
|
1207
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
1208
|
+
<DebugSymbols>true</DebugSymbols>
|
1209
|
+
<DebugType>full</DebugType>
|
1210
|
+
<Optimize>false</Optimize>
|
1211
|
+
<OutputPath>bin\</OutputPath>
|
1212
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
1213
|
+
<ErrorReport>prompt</ErrorReport>
|
1214
|
+
<WarningLevel>4</WarningLevel>
|
1215
|
+
</PropertyGroup>
|
1216
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
1217
|
+
<DebugType>pdbonly</DebugType>
|
1218
|
+
<Optimize>true</Optimize>
|
1219
|
+
<OutputPath>bin\</OutputPath>
|
1220
|
+
<DefineConstants>TRACE</DefineConstants>
|
1221
|
+
<ErrorReport>prompt</ErrorReport>
|
1222
|
+
<WarningLevel>4</WarningLevel>
|
1223
|
+
</PropertyGroup>
|
1224
|
+
<ItemGroup>
|
1225
|
+
<Reference Include="Microsoft.CSharp" />
|
1226
|
+
<Reference Include="Some.Package">
|
1227
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
1228
|
+
<Private>True</Private>
|
1229
|
+
</Reference>
|
1230
|
+
<Reference Include="System.Web.DynamicData" />
|
1231
|
+
<Reference Include="System.Web.Entity" />
|
1232
|
+
<Reference Include="System.Web.ApplicationServices" />
|
1233
|
+
<Reference Include="System" />
|
1234
|
+
<Reference Include="System.Data" />
|
1235
|
+
<Reference Include="System.Core" />
|
1236
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
1237
|
+
<Reference Include="System.Web.Extensions" />
|
1238
|
+
<Reference Include="System.Xml.Linq" />
|
1239
|
+
<Reference Include="System.Drawing" />
|
1240
|
+
<Reference Include="System.Web" />
|
1241
|
+
<Reference Include="System.Xml" />
|
1242
|
+
<Reference Include="System.Configuration" />
|
1243
|
+
<Reference Include="System.Web.Services" />
|
1244
|
+
<Reference Include="System.EnterpriseServices" />
|
1245
|
+
</ItemGroup>
|
1246
|
+
<ItemGroup>
|
1247
|
+
<None Include="packages.config" />
|
1248
|
+
</ItemGroup>
|
1249
|
+
<ItemGroup>
|
1250
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
1251
|
+
</ItemGroup>
|
1252
|
+
<PropertyGroup>
|
1253
|
+
<!-- some project files set this property which makes the Microsoft.WebApplication.targets import a few lines down always fail -->
|
1254
|
+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">C:\some\path\that\does\not\exist</VSToolsPath>
|
1255
|
+
</PropertyGroup>
|
1256
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
1257
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
1258
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
1259
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
1260
|
+
<Target Name="BeforeBuild">
|
1261
|
+
</Target>
|
1262
|
+
<Target Name="AfterBuild">
|
1263
|
+
</Target>
|
1264
|
+
-->
|
1265
|
+
</Project>
|
1266
|
+
""",
|
1137
1267
|
packagesConfigContents: """
|
1138
|
-
|
1139
|
-
|
1140
|
-
|
1141
|
-
|
1268
|
+
<packages>
|
1269
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
1270
|
+
</packages>
|
1271
|
+
""",
|
1142
1272
|
expectedProjectContents: """
|
1143
|
-
|
1144
|
-
|
1145
|
-
|
1146
|
-
|
1147
|
-
|
1148
|
-
|
1149
|
-
|
1150
|
-
|
1151
|
-
|
1152
|
-
|
1153
|
-
|
1154
|
-
|
1155
|
-
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1171
|
-
|
1172
|
-
|
1173
|
-
|
1174
|
-
|
1175
|
-
|
1176
|
-
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1180
|
-
|
1181
|
-
|
1182
|
-
|
1183
|
-
|
1184
|
-
|
1185
|
-
|
1186
|
-
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
|
1216
|
-
|
1217
|
-
|
1273
|
+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
1274
|
+
<PropertyGroup>
|
1275
|
+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
1276
|
+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
1277
|
+
<ProductVersion>
|
1278
|
+
</ProductVersion>
|
1279
|
+
<SchemaVersion>2.0</SchemaVersion>
|
1280
|
+
<ProjectGuid>68ed3303-52a0-47b8-a687-3abbb07530da</ProjectGuid>
|
1281
|
+
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
1282
|
+
<OutputType>Library</OutputType>
|
1283
|
+
<AppDesignerFolder>Properties</AppDesignerFolder>
|
1284
|
+
<RootNamespace>TestProject</RootNamespace>
|
1285
|
+
<AssemblyName>TestProject</AssemblyName>
|
1286
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
1287
|
+
</PropertyGroup>
|
1288
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
1289
|
+
<DebugSymbols>true</DebugSymbols>
|
1290
|
+
<DebugType>full</DebugType>
|
1291
|
+
<Optimize>false</Optimize>
|
1292
|
+
<OutputPath>bin\</OutputPath>
|
1293
|
+
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
1294
|
+
<ErrorReport>prompt</ErrorReport>
|
1295
|
+
<WarningLevel>4</WarningLevel>
|
1296
|
+
</PropertyGroup>
|
1297
|
+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
1298
|
+
<DebugType>pdbonly</DebugType>
|
1299
|
+
<Optimize>true</Optimize>
|
1300
|
+
<OutputPath>bin\</OutputPath>
|
1301
|
+
<DefineConstants>TRACE</DefineConstants>
|
1302
|
+
<ErrorReport>prompt</ErrorReport>
|
1303
|
+
<WarningLevel>4</WarningLevel>
|
1304
|
+
</PropertyGroup>
|
1305
|
+
<ItemGroup>
|
1306
|
+
<Reference Include="Microsoft.CSharp" />
|
1307
|
+
<Reference Include="Some.Package">
|
1308
|
+
<HintPath>packages\Some.Package.13.0.1\lib\net45\Some.Package.dll</HintPath>
|
1309
|
+
<Private>True</Private>
|
1310
|
+
</Reference>
|
1311
|
+
<Reference Include="System.Web.DynamicData" />
|
1312
|
+
<Reference Include="System.Web.Entity" />
|
1313
|
+
<Reference Include="System.Web.ApplicationServices" />
|
1314
|
+
<Reference Include="System" />
|
1315
|
+
<Reference Include="System.Data" />
|
1316
|
+
<Reference Include="System.Core" />
|
1317
|
+
<Reference Include="System.Data.DataSetExtensions" />
|
1318
|
+
<Reference Include="System.Web.Extensions" />
|
1319
|
+
<Reference Include="System.Xml.Linq" />
|
1320
|
+
<Reference Include="System.Drawing" />
|
1321
|
+
<Reference Include="System.Web" />
|
1322
|
+
<Reference Include="System.Xml" />
|
1323
|
+
<Reference Include="System.Configuration" />
|
1324
|
+
<Reference Include="System.Web.Services" />
|
1325
|
+
<Reference Include="System.EnterpriseServices" />
|
1326
|
+
</ItemGroup>
|
1327
|
+
<ItemGroup>
|
1328
|
+
<None Include="packages.config" />
|
1329
|
+
</ItemGroup>
|
1330
|
+
<ItemGroup>
|
1331
|
+
<Compile Include="Properties\AssemblyInfo.cs" />
|
1332
|
+
</ItemGroup>
|
1333
|
+
<PropertyGroup>
|
1334
|
+
<!-- some project files set this property which makes the Microsoft.WebApplication.targets import a few lines down always fail -->
|
1335
|
+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">C:\some\path\that\does\not\exist</VSToolsPath>
|
1336
|
+
</PropertyGroup>
|
1337
|
+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
1338
|
+
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
1339
|
+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
1340
|
+
Other similar extension points exist, see Microsoft.Common.targets.
|
1341
|
+
<Target Name="BeforeBuild">
|
1342
|
+
</Target>
|
1343
|
+
<Target Name="AfterBuild">
|
1344
|
+
</Target>
|
1345
|
+
-->
|
1346
|
+
</Project>
|
1347
|
+
""",
|
1218
1348
|
expectedPackagesConfigContents: """
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1349
|
+
<?xml version="1.0" encoding="utf-8"?>
|
1350
|
+
<packages>
|
1351
|
+
<package id="Some.Package" version="13.0.1" targetFramework="net45" />
|
1352
|
+
</packages>
|
1353
|
+
"""
|
1354
|
+
);
|
1224
1355
|
}
|
1225
1356
|
|
1226
1357
|
[Fact]
|
@@ -1298,7 +1429,8 @@ public partial class UpdateWorkerTests
|
|
1298
1429
|
string expectedProjectContents,
|
1299
1430
|
string expectedPackagesConfigContents,
|
1300
1431
|
(string Path, string Content)[]? additionalFiles = null,
|
1301
|
-
(string Path, string Content)[]? additionalFilesExpected = null
|
1432
|
+
(string Path, string Content)[]? additionalFilesExpected = null,
|
1433
|
+
MockNuGetPackage[]? packages = null)
|
1302
1434
|
{
|
1303
1435
|
var realizedAdditionalFiles = new List<(string Path, string Content)>
|
1304
1436
|
{
|
@@ -1325,7 +1457,8 @@ public partial class UpdateWorkerTests
|
|
1325
1457
|
projectContents,
|
1326
1458
|
expectedProjectContents,
|
1327
1459
|
additionalFiles: realizedAdditionalFiles.ToArray(),
|
1328
|
-
additionalFilesExpected: realizedAdditionalFilesExpected.ToArray()
|
1460
|
+
additionalFilesExpected: realizedAdditionalFilesExpected.ToArray(),
|
1461
|
+
packages: packages);
|
1329
1462
|
}
|
1330
1463
|
}
|
1331
1464
|
}
|