From 5ffb1ce5d9b60e3b76ca230f2be521a4723028f0 Mon Sep 17 00:00:00 2001 From: Archi Date: Tue, 27 Jul 2021 17:26:26 +0200 Subject: [PATCH] Correct .NET 6.0 warnings --- ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs | 2 +- ArchiSteamFarm/IPC/Startup.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs index daf4444df..7d1cb0b55 100644 --- a/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs +++ b/ArchiSteamFarm.CustomPlugins.ExamplePlugin/CatAPI.cs @@ -50,7 +50,7 @@ namespace ArchiSteamFarm.CustomPlugins.ExamplePlugin { throw new InvalidOperationException(nameof(response.Content.Link)); } - return Uri.EscapeUriString(response.Content.Link); + return Uri.EscapeDataString(response.Content.Link); } #pragma warning disable CA1812 // False positive, the class is used during json deserialization diff --git a/ArchiSteamFarm/IPC/Startup.cs b/ArchiSteamFarm/IPC/Startup.cs index c918e8bc7..1ee981919 100644 --- a/ArchiSteamFarm/IPC/Startup.cs +++ b/ArchiSteamFarm/IPC/Startup.cs @@ -21,6 +21,7 @@ #if NETFRAMEWORK using ArchiSteamFarm.Compatibility; +using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Converters; using File = System.IO.File; using Path = System.IO.Path; @@ -43,7 +44,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; using Microsoft.AspNetCore.HttpOverrides; -using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Net.Http.Headers; @@ -323,10 +323,10 @@ namespace ArchiSteamFarm.IPC { mvc.AddControllersAsServices(); +#if NETFRAMEWORK // Use latest compatibility version for MVC mvc.SetCompatibilityVersion(CompatibilityVersion.Latest); -#if NETFRAMEWORK // Add standard formatters mvc.AddFormatterMappings();