Skip to content

Commit

Permalink
update Newtonsoft.Json, fix obsolete methods
Browse files Browse the repository at this point in the history
  • Loading branch information
kentico-ericd committed Jan 16, 2024
1 parent 268dfaf commit 597bd22
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 13 deletions.
8 changes: 2 additions & 6 deletions KenticoInspector.Core/Helpers/DirectoryHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,14 @@ namespace KenticoInspector.Core.Helpers
{
public static class DirectoryHelper
{
private const string filePrefix = "file:\\";

/// <summary>
/// Gets the executing directory of the application.
/// </summary>
/// <returns>A string that contains the path of the executing directory, and does not end with a backslash (\).</returns>
public static string GetExecutingDirectory()
{
var assemblyPath = Assembly.GetExecutingAssembly().CodeBase;
var assemblyDirectory = Path.GetDirectoryName(assemblyPath);

return assemblyDirectory.Substring(filePrefix.Length);
var assemblyPath = Assembly.GetExecutingAssembly().Location;
return Path.GetDirectoryName(assemblyPath);
}
}
}
2 changes: 1 addition & 1 deletion KenticoInspector.Core/KenticoInspector.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<ItemGroup>
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions KenticoInspector.Core/Tokens/TokenExpressionResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.CompilerServices;
using System.Text.RegularExpressions;

namespace KenticoInspector.Core.Tokens
Expand Down Expand Up @@ -86,7 +86,7 @@ private static string ResolveTokenExpression(string tokenExpression, IDictionary
{
if (Regex.IsMatch(innerTokenExpression, pattern))
{
var expressionObject = FormatterServices.GetUninitializedObject(tokenExpressionType) as ITokenExpression;
var expressionObject = RuntimeHelpers.GetUninitializedObject(tokenExpressionType) as ITokenExpression;

resolvedExpression = expressionObject.Resolve(innerTokenExpression, tokenDictionary);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Dapper" Version="1.60.1" />
<PackageReference Include="Dapper.FluentMap" Version="1.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="YamlDotNet" Version="6.1.1" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="7.1.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Razor.Design" Version="2.2.0" PrivateAssets="All" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.6" />
<PackageReference Include="VueCliMiddleware" Version="2.2.0" />
Expand Down
2 changes: 1 addition & 1 deletion KenticoInspector.WebApplication/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
return ConfigureAutofac(services);
}

private IServiceProvider ConfigureAutofac(IServiceCollection services)
private AutofacServiceProvider ConfigureAutofac(IServiceCollection services)
{
var containerBuilder = new ContainerBuilder();

Expand Down

0 comments on commit 597bd22

Please sign in to comment.