mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Fix build
This commit is contained in:
parent
8d0d80e086
commit
aaa05eb5ec
@ -61,7 +61,6 @@ namespace BTCPayServer.Hosting
|
||||
public static IServiceCollection AddBTCPayServer(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
#if NETCOREAPP21
|
||||
services.AddSingleton<IConfigureOptions<MvcJsonOptions>, MVCConfigureOptions>();
|
||||
services.AddSingleton<MvcNewtonsoftJsonOptions>();
|
||||
#else
|
||||
services.AddSingleton<MvcNewtonsoftJsonOptions>(o => o.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value);
|
||||
@ -334,14 +333,4 @@ namespace BTCPayServer.Hosting
|
||||
return app;
|
||||
}
|
||||
}
|
||||
|
||||
#if NETCOREAPP21
|
||||
class MVCConfigureOptions : IConfigureOptions<MvcJsonOptions>
|
||||
{
|
||||
public void Configure(MvcJsonOptions options)
|
||||
{
|
||||
new NBXplorer.Serializer(null).ConfigureSerializer(options.SerializerSettings);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -21,8 +21,6 @@ using BTCPayServer.HostedServices;
|
||||
|
||||
#if NETCOREAPP21
|
||||
using IHostApplicationLifetime = Microsoft.AspNetCore.Hosting.IApplicationLifetime;
|
||||
#else
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
#endif
|
||||
|
||||
namespace BTCPayServer.Payments.Bitcoin
|
||||
|
@ -18,7 +18,7 @@ using NBitpayClient;
|
||||
using NBitpayClient.Extensions;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using BTCPayServer.Logging;
|
||||
using Microsoft.AspNetCore.Http.Internal;
|
||||
|
||||
using Microsoft.AspNetCore.Authentication;
|
||||
using System.Text.Encodings.Web;
|
||||
using BTCPayServer.Data;
|
||||
@ -95,7 +95,7 @@ namespace BTCPayServer.Security.Bitpay
|
||||
|
||||
private async Task<(string StoreId, bool SuccessAuth)> CheckBitId(HttpContext httpContext, string sig, string id, List<Claim> claims)
|
||||
{
|
||||
httpContext.Request.EnableRewind();
|
||||
httpContext.Request.EnableBuffering();
|
||||
|
||||
string storeId = null;
|
||||
string body = string.Empty;
|
||||
|
@ -1,13 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Hosting.Internal;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
#if NETCOREAPP21
|
||||
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
||||
using Microsoft.AspNetCore.Hosting.Internal;
|
||||
#else
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
#endif
|
||||
@ -34,7 +34,11 @@ namespace BTCPayServer.Services
|
||||
|
||||
public LanguageService(IWebHostEnvironment environment)
|
||||
{
|
||||
#if NETCOREAPP21
|
||||
var path = (environment as HostingEnvironment)?.WebRootPath;
|
||||
#else
|
||||
var path = environment.WebRootPath;
|
||||
#endif
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
//test environment
|
||||
|
Loading…
Reference in New Issue
Block a user