Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeAOT support for GarnetServer #74

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions libs/host/Configuration/ConfigProviders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

using System;
using System.IO;
using System.Text;
using System.Text.Json;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
Expand Down Expand Up @@ -108,19 +106,18 @@ public bool TryImportOptions(string path, IStreamProvider streamProvider, Option

public bool TryExportOptions(string path, IStreamProvider streamProvider, Options options, ILogger logger)
{
string jsonSettings;
byte[] jsonSettings;
try
{
jsonSettings = JsonSerializer.Serialize(options, new JsonSerializerOptions { WriteIndented = true });
jsonSettings = JsonSerializer.SerializeToUtf8Bytes(options, OptionsSerializerContext.Default.OptionsType);
}
catch (NotSupportedException e)
{
logger?.LogError(e, $"An error occurred while serializing config file (Path: {path}).");
return false;
}

var data = Encoding.ASCII.GetBytes(jsonSettings);
streamProvider.Write(path, data);
streamProvider.Write(path, jsonSettings);

return true;
}
Expand Down
2 changes: 2 additions & 0 deletions libs/host/Configuration/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Net;
Expand Down Expand Up @@ -438,6 +439,7 @@ internal sealed class Options
/// <param name="invalidOptions">List of invalid options</param>
/// <param name="logger">Logger</param>
/// <returns>True if all property values are valid</returns>
[RequiresUnreferencedCode("Calls System.ComponentModel.DataAnnotations.ValidationContext.ValidationContext(Object)")]
public bool IsValid(out List<string> invalidOptions, ILogger logger)
{
invalidOptions = new List<string>();
Expand Down
14 changes: 14 additions & 0 deletions libs/host/Configuration/OptionsSerializerContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System.Text.Json.Serialization;

namespace Garnet
{
/// <summary>
/// Json serializer context for Garnet configuration
/// </summary>
[JsonSerializable(typeof(Options), TypeInfoPropertyName = "OptionsType")]
[JsonSourceGenerationOptions(WriteIndented = true)]
internal partial class OptionsSerializerContext : JsonSerializerContext;
}
2 changes: 2 additions & 0 deletions libs/host/Configuration/Redis/RedisOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.

using System;
using System.Diagnostics.CodeAnalysis;

namespace Garnet
{
Expand Down Expand Up @@ -90,6 +91,7 @@ internal class RedisOptions
/// This is required in order to determine order of precedence when setting options from multiple sources
/// </summary>
/// <typeparam name="T">The underlying type of the option</typeparam>
[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicProperties)]
internal class Option<T>
{
public T Value { get; set; }
Expand Down
1 change: 1 addition & 0 deletions libs/host/Garnet.host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsAotCompatible>true</IsAotCompatible>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<SignAssembly>true</SignAssembly>
Expand Down
2 changes: 2 additions & 0 deletions libs/host/GarnetServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Threading;
using Garnet.cluster;
Expand Down Expand Up @@ -64,6 +65,7 @@
/// </summary>
/// <param name="commandLineArgs">Command line arguments</param>
/// <param name="loggerFactory">Logger factory</param>
[RequiresUnreferencedCode("Calls Garnet.Options.IsValid(out List<String>, ILogger)")]
public GarnetServer(string[] commandLineArgs, ILoggerFactory loggerFactory = null)
{
Trace.Listeners.Add(new ConsoleTraceListener());
Expand Down Expand Up @@ -94,7 +96,7 @@

// If no logger factory is given, set up main logger factory based on parsed configuration values,
// otherwise use given logger factory.
this.loggerFactory = loggerFactory ?? LoggerFactory.Create(builder =>

Check warning on line 99 in libs/host/GarnetServer.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

Using member 'Microsoft.Extensions.Logging.LoggerFactory.Create(Action<ILoggingBuilder>)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. LoggerFactory.Create uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.

Check warning on line 99 in libs/host/GarnetServer.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

Using member 'Microsoft.Extensions.Logging.LoggerFactory.Create(Action<ILoggingBuilder>)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. LoggerFactory.Create uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.

Check warning on line 99 in libs/host/GarnetServer.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

Using member 'Microsoft.Extensions.Logging.LoggerFactory.Create(Action<ILoggingBuilder>)' which has 'RequiresDynamicCodeAttribute' can break functionality when AOT compiling. LoggerFactory.Create uses Microsoft.Extensions.DependencyInjection, which may require generating code dynamically at runtime.
{
if (!serverSettings.DisableConsoleLogger.GetValueOrDefault())
{
Expand Down
2 changes: 2 additions & 0 deletions libs/host/ServerSettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text;
Expand Down Expand Up @@ -33,6 +34,7 @@ internal static class ServerSettingsManager
/// <param name="options">Options object containing parsed configuration settings</param>
/// <param name="invalidOptions">List of Options properties that did not pass validation</param>
/// <returns>True if parsing succeeded</returns>
[RequiresUnreferencedCode("Calls Garnet.Options.IsValid(out List<String>, ILogger)")]
internal static bool TryParseCommandLineArguments(string[] args, out Options options, out List<string> invalidOptions, ILogger logger = null)
{
if (logger == null)
Expand Down
5 changes: 5 additions & 0 deletions libs/server/ACL/CommandCategory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ public enum Flag : uint
Admin = 1 << 0
};

/// <summary>
/// Highest bit flag value
/// </summary>
internal static readonly Flag HighestFlag = Enum.GetValues<Flag>().Max();

/// <summary>
/// Map of category names to bit flag
/// </summary>
Expand Down
4 changes: 1 addition & 3 deletions libs/server/ACL/User.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

Expand Down Expand Up @@ -189,7 +187,7 @@ public string DescribeUser()
}

// Categories
var highestFlag = Enum.GetValues(typeof(CommandCategory.Flag)).Cast<int>().Max();
var highestFlag = (int)CommandCategory.HighestFlag;

for (int i = 0; i <= highestFlag; i++)
{
Expand Down
35 changes: 7 additions & 28 deletions libs/server/Custom/CustomCommandRegistration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// Licensed under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections.Immutable;

namespace Garnet.server.Custom
{
Expand Down Expand Up @@ -84,32 +83,12 @@ internal abstract class RegisterCustomCommandProviderBase : IRegisterCustomComma
/// <summary>
/// All supported custom command types
/// </summary>
public static Lazy<Type[]> SupportedCustomCommandBaseTypesLazy = new(() =>
{
var supportedTypes = new HashSet<Type>();
foreach (var type in typeof(RegisterCustomCommandProviderBase).Assembly.GetTypes().Where(t =>
typeof(RegisterCustomCommandProviderBase).IsAssignableFrom(t) && t.IsClass && !t.IsAbstract))
{
var baseType = type.BaseType;
while (baseType != null && baseType != typeof(RegisterCustomCommandProviderBase))
{
if (baseType.IsGenericType && baseType.GetGenericTypeDefinition() ==
typeof(RegisterCustomCommandProviderBase<,>))
{
var customCmdType = baseType.GetGenericArguments().FirstOrDefault();
if (customCmdType != null)
{
supportedTypes.Add(customCmdType);
break;
}
}

baseType = baseType.BaseType;
}
}

return supportedTypes.ToArray();
});
public static readonly ImmutableArray<Type> SupportedCustomCommandBaseTypes = ImmutableArray.Create(
[
typeof(CustomRawStringFunctions),
typeof(CustomObjectFactory),
typeof(CustomTransactionProcedure)
]);

public abstract void Register(CustomCommandManager customCommandManager);
}
Expand Down
1 change: 1 addition & 0 deletions libs/server/Garnet.server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsAotCompatible>true</IsAotCompatible>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<SignAssembly>true</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion libs/server/Metrics/Info/GarnetInfoMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace Garnet.server
{
class GarnetInfoMetrics
{
public static readonly InfoMetricsType[] defaultInfo = Enum.GetValues(typeof(InfoMetricsType)).Cast<InfoMetricsType>()
public static readonly InfoMetricsType[] defaultInfo = Enum.GetValues<InfoMetricsType>()
.Where(e => e switch
{
InfoMetricsType.STOREHASHTABLE => false,
Expand Down
6 changes: 2 additions & 4 deletions libs/server/Metrics/Latency/GarnetLatencyMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using Garnet.common;
using HdrHistogram;

Expand All @@ -15,11 +14,10 @@ namespace Garnet.server
/// </summary>
internal class GarnetLatencyMetrics
{
public static readonly LatencyMetricsType[] defaultLatencyTypes =
Enum.GetValues(typeof(LatencyMetricsType)).Cast<LatencyMetricsType>().ToArray();
public static readonly LatencyMetricsType[] defaultLatencyTypes = Enum.GetValues<LatencyMetricsType>();

// Whether each latency type in LatencyMetricsType enum is in ticks or is a directly reported value
static readonly bool[] defaultLatencyTypesTicks = new bool[6] { true, true, true, false, false, true };
static readonly bool[] defaultLatencyTypesTicks = [true, true, true, false, false, true];

public LatencyMetricsEntry[] metrics;

Expand Down
4 changes: 1 addition & 3 deletions libs/server/Metrics/Latency/GarnetLatencyMetricsSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT license.

using System;
using System.Linq;
using System.Runtime.CompilerServices;
using Garnet.common;

Expand All @@ -14,8 +13,7 @@ namespace Garnet.server
internal class GarnetLatencyMetricsSession
{
readonly GarnetServerMonitor monitor;
static readonly LatencyMetricsType[] defaultLatencyTypes =
Enum.GetValues(typeof(LatencyMetricsType)).Cast<LatencyMetricsType>().ToArray();
static readonly LatencyMetricsType[] defaultLatencyTypes = Enum.GetValues<LatencyMetricsType>();
int Version => (int)(monitor.monitor_iterations % 2);
public int PriorVersion => 1 - Version;
public LatencyMetricsEntrySession[] metrics;
Expand Down
2 changes: 1 addition & 1 deletion libs/server/Resp/ArrayCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,18 +263,18 @@
}

// Get types from loaded assemblies
var loadedTypes = loadedAssemblies.SelectMany(a => a.GetTypes()).Where(t =>

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.

Check warning on line 266 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

Using member 'System.Reflection.Assembly.GetTypes()' which has 'RequiresUnreferencedCodeAttribute' can break functionality when trimming application code. Types might be removed.
classInstances.ContainsKey(t.Name)).ToArray();

// Check that all types implement one of the supported custom command base classes
var supportedCustomCommandTypes = RegisterCustomCommandProviderBase.SupportedCustomCommandBaseTypesLazy.Value;
var supportedCustomCommandTypes = RegisterCustomCommandProviderBase.SupportedCustomCommandBaseTypes;
if (loadedTypes.Any(t => !supportedCustomCommandTypes.Any(st => st.IsAssignableFrom(t))))
{
return CmdStrings.RESP_ERROR_REGISTERCS_UNSUPPORTED_CLASS;
}

// Check that all types have empty constructors
if (loadedTypes.Any(t => t.GetConstructor(Type.EmptyTypes) == null))

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 277 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Type.GetConstructor(Type[])'. The parameter 't' of method 'lambda expression' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
{
return CmdStrings.RESP_ERROR_INSTANTIATING_CLASS;
}
Expand All @@ -282,7 +282,7 @@
// Instantiate types
foreach (var type in loadedTypes)
{
var instance = Activator.CreateInstance(type);

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (ubuntu-latest, net8.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net6.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.

Check warning on line 285 in libs/server/Resp/ArrayCommands.cs

View workflow job for this annotation

GitHub Actions / Garnet - Build and Test (windows-latest, net8.0)

'type' argument does not satisfy 'DynamicallyAccessedMemberTypes.PublicParameterlessConstructor' in call to 'System.Activator.CreateInstance(Type)'. The return value of method 'System.Collections.IEnumerator.Current.get' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.
classInstances[type.Name] = instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsAotCompatible>true</IsAotCompatible>
<RootNamespace>Tsavorite.devices</RootNamespace>
<AssemblyName>Tsavorite.devices.AzureStorageDevice</AssemblyName>
<ErrorReport>prompt</ErrorReport>
Expand Down
3 changes: 2 additions & 1 deletion main/GarnetServer/GarnetServer.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<IsAotCompatible>True</IsAotCompatible>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
Expand Down
Loading