Skip to content

Commit fd74a5c

Browse files
authored
Fix failing build due to dependencies with severe vulnerabilities (#2824)
1 parent 287686c commit fd74a5c

17 files changed

Lines changed: 36 additions & 34 deletions

pipelines/common.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ steps:
1313
version: 3.x
1414

1515
- task: UseDotNet@2
16-
displayName: Use .NET Core sdk 2.0.x
16+
displayName: Use .NET Core sdk 2.1.x
1717
inputs:
18-
version: 2.0.x
18+
version: 2.1.x
1919

2020
- task: UseDotNet@2
2121
displayName: Use .NET Core sdk 5.x

samples/AspNetCoreODataSample.Web/AspNetCoreODataSample.Web.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
8+
<PackageReference Update="Microsoft.NETCore.App" Version="2.1.30" />
9+
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.30" />
910
</ItemGroup>
1011

1112
<ItemGroup>

test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ public async Task UnauthorizedResponseFromODataControllerIsSerializedAsODataErro
522522
}
523523
}
524524

525-
#if !NETCOREAPP2_0 && NETCORE
525+
#if !NETCOREAPP2_1 && NETCORE
526526
[Fact]
527527
public async Task ConflictResponseFromODataControllerIsSerializedAsODataError()
528528
{
@@ -930,7 +930,7 @@ public IActionResult Get()
930930
{
931931
return Unauthorized("Not authorized to access this resource.");
932932
}
933-
#if !NETCOREAPP2_0
933+
#if !NETCOREAPP2_1
934934
public IActionResult Patch([FromODataUri] int key, [FromBody] Customer customer)
935935
{
936936
return Conflict("Conflict during update.");

test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormattersTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
using Microsoft.AspNet.OData.Test.Common;
1919
using Microsoft.AspNetCore.Http;
2020
using Microsoft.AspNetCore.Mvc.Formatters;
21+
using Microsoft.AspNetCore.Mvc.Infrastructure;
22+
2123
#if NETCOREAPP3_1
2224
#else
23-
using Microsoft.AspNetCore.Mvc.Internal;
25+
using Microsoft.AspNetCore.Mvc.Internal;
2426
#endif
2527
using Microsoft.AspNetCore.Mvc.ModelBinding;
2628
using Microsoft.AspNetCore.WebUtilities;

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/EndpointRouteBuilderFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// </copyright>
66
//------------------------------------------------------------------------------
77

8-
#if !NETCOREAPP2_0
8+
#if !NETCOREAPP2_1
99
using System;
1010
using Microsoft.AspNet.OData.Common;
1111
using Microsoft.AspNet.OData.Extensions;

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/MockEndpointRouteBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// </copyright>
66
//------------------------------------------------------------------------------
77

8-
#if !NETCOREAPP2_0
8+
#if !NETCOREAPP2_1
99
using System;
1010
using System.Collections.Generic;
1111
using Microsoft.AspNetCore.Builder;

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/FormatterTestHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
using Microsoft.AspNetCore.Http;
1717
using Microsoft.AspNetCore.Mvc;
1818
using Microsoft.AspNetCore.Mvc.Formatters;
19-
#if NETCOREAPP2_0
19+
#if NETCOREAPP2_1
2020
using Microsoft.AspNetCore.Mvc.Internal;
2121
#endif
2222
using Microsoft.AspNetCore.Mvc.ModelBinding;

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataActionSelectorTestHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using Microsoft.AspNetCore.Mvc.ModelBinding;
1818
using System.Linq;
1919
using System.Text;
20-
#if NETCOREAPP2_0
20+
#if NETCOREAPP2_1
2121
using Microsoft.Extensions.DependencyInjection;
2222
using Microsoft.Extensions.Logging;
2323
using Microsoft.OData;
@@ -87,7 +87,7 @@ public static void SetupActionSelector(System.Type controllerType,
8787
as IReadOnlyList<ControllerActionDescriptor>;
8888
actionDescriptors = actionDescriptors.Where(a => a.ActionName == actionName).ToList();
8989
var serviceProvider = routeBuilder.ServiceProvider;
90-
#if NETCOREAPP2_0
90+
#if NETCOREAPP2_1
9191
var actionsProvider = serviceProvider.GetRequiredService<IActionDescriptorCollectionProvider>();
9292
var actionConstraintsProvider = serviceProvider.GetRequiredService<ActionConstraintCache>();
9393
var loggerFactory = serviceProvider.GetRequiredService<ILoggerFactory>();

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RoutingConfigurationFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
using Microsoft.AspNetCore.Mvc.Abstractions;
1818
using Microsoft.AspNetCore.Mvc.ApplicationParts;
1919
using Microsoft.AspNetCore.Mvc.Infrastructure;
20-
#if NETCOREAPP2_0
20+
#if NETCOREAPP2_1
2121
using Microsoft.AspNetCore.Builder.Internal;
2222
using Microsoft.AspNetCore.Mvc.Internal;
2323
#endif
@@ -81,7 +81,7 @@ public static IRouteBuilder Create()
8181
// Create a route build with a default path handler.
8282
IRouteBuilder routeBuilder = new RouteBuilder(appBuilder);
8383

84-
#if NETCOREAPP2_0
84+
#if NETCOREAPP2_1
8585
routeBuilder.DefaultHandler = new MvcRouteHandler(
8686
mockInvokerFactory.Object,
8787
mockActionSelector.Object,
@@ -207,7 +207,7 @@ public static IRouteBuilder CreateWithDisabledCaseInsensitiveRequestPropertyBind
207207
// Create a route build with a default path handler.
208208
IRouteBuilder routeBuilder = new RouteBuilder(appBuilder);
209209

210-
#if NETCOREAPP2_0
210+
#if NETCOREAPP2_1
211211
routeBuilder.DefaultHandler = new MvcRouteHandler(
212212
mockInvokerFactory.Object,
213213
mockActionSelector.Object,

test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ServerFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
using Microsoft.AspNetCore;
1616
using Microsoft.AspNetCore.Builder;
1717
using Microsoft.AspNetCore.Hosting;
18-
#if !NETCOREAPP2_0
18+
#if !NETCOREAPP2_1
1919
using Microsoft.AspNetCore.Http.Features;
2020
#endif
2121
using Microsoft.AspNetCore.Mvc;
@@ -44,7 +44,7 @@ public static TestServer Create(Type[] controllers, Action<IRouteBuilder> config
4444
IWebHostBuilder builder = WebHost.CreateDefaultBuilder();
4545
builder.ConfigureServices(services =>
4646
{
47-
#if NETCOREAPP2_0
47+
#if NETCOREAPP2_1
4848
services.AddMvc();
4949
#else
5050
services.AddMvc(options => options.EnableEndpointRouting = false)
@@ -57,7 +57,7 @@ public static TestServer Create(Type[] controllers, Action<IRouteBuilder> config
5757

5858
builder.Configure(app =>
5959
{
60-
#if !NETCOREAPP2_0
60+
#if !NETCOREAPP2_1
6161
app.Use(next => context =>
6262
{
6363
var body = context.Features.Get<IHttpBodyControlFeature>();

0 commit comments

Comments
 (0)