Skip to content

Commit

Permalink
- test support AOT
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Nov 15, 2023
1 parent fd6c29f commit 865e6de
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 18 deletions.
30 changes: 15 additions & 15 deletions FreeRedis.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "console_net8_norman", "exam
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "console_net452_vs", "examples\console_net452_vs\console_net452_vs.csproj", "{7AC68251-83D4-423F-849C-04BD89F4BDFB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "console_net6_cluster_client_side_caching", "examples\console_net6_cluster_client_side_caching\console_net6_cluster_client_side_caching.csproj", "{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FreeRedis.DistributedCache", "src\FreeRedis.DistributedCache\FreeRedis.DistributedCache.csproj", "{B0B0B55E-4D41-4419-83FE-309F72699A3A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "console_net8_cluster_client_side_caching", "examples\console_net8_cluster_client_side_caching\console_net8_cluster_client_side_caching.csproj", "{1C4387AA-C4BD-4388-97D1-3A769439705D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -201,18 +201,6 @@ Global
{7AC68251-83D4-423F-849C-04BD89F4BDFB}.Release|x64.Build.0 = Release|Any CPU
{7AC68251-83D4-423F-849C-04BD89F4BDFB}.Release|x86.ActiveCfg = Release|Any CPU
{7AC68251-83D4-423F-849C-04BD89F4BDFB}.Release|x86.Build.0 = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|x64.ActiveCfg = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|x64.Build.0 = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|x86.ActiveCfg = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Debug|x86.Build.0 = Debug|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|Any CPU.Build.0 = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|x64.ActiveCfg = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|x64.Build.0 = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|x86.ActiveCfg = Release|Any CPU
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28}.Release|x86.Build.0 = Release|Any CPU
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -225,6 +213,18 @@ Global
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Release|x64.Build.0 = Release|Any CPU
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Release|x86.ActiveCfg = Release|Any CPU
{B0B0B55E-4D41-4419-83FE-309F72699A3A}.Release|x86.Build.0 = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|x64.ActiveCfg = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|x64.Build.0 = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|x86.ActiveCfg = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Debug|x86.Build.0 = Debug|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|Any CPU.Build.0 = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|x64.ActiveCfg = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|x64.Build.0 = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|x86.ActiveCfg = Release|Any CPU
{1C4387AA-C4BD-4388-97D1-3A769439705D}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -244,8 +244,8 @@ Global
{DA686F0B-E9F7-4AF1-AD2E-EE6EE0C24BB4} = {DD1426BF-F56F-49A8-9D4E-2BA0E3BEFC72}
{D6DF0DBA-F181-4F1C-B6AD-9D71A01A4431} = {DD1426BF-F56F-49A8-9D4E-2BA0E3BEFC72}
{7AC68251-83D4-423F-849C-04BD89F4BDFB} = {DD1426BF-F56F-49A8-9D4E-2BA0E3BEFC72}
{AFA6EB33-8DD2-41CE-B2EF-917406F47D28} = {DD1426BF-F56F-49A8-9D4E-2BA0E3BEFC72}
{B0B0B55E-4D41-4419-83FE-309F72699A3A} = {D8045351-59E4-45B9-81F5-D21CC0996344}
{1C4387AA-C4BD-4388-97D1-3A769439705D} = {DD1426BF-F56F-49A8-9D4E-2BA0E3BEFC72}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B36AD060-F6AE-49C7-A310-B58B8467CE69}
Expand Down
11 changes: 9 additions & 2 deletions examples/console_net8/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ class Program
{
static Lazy<RedisClient> _cliLazy = new Lazy<RedisClient>(() =>
{
//var r = new RedisClient("127.0.0.1:6379"); //redis 3.2 Single test
var r = new RedisClient("127.0.0.1:6379"); //redis 3.2 Single test
//r.Interceptors.Add(() => new ResetCommandAop());
//var r = new RedisClient("localhost:6379,database=9,password=123456"); //redis 3.2
//var r = new RedisClient("127.0.0.1:6379,database=1", "127.0.0.1:6379,database=1");
var r = new RedisClient(new ConnectionStringBuilder[] { "192.168.164.10:6381,password=123456,subscribleReadBytes=true" }); //redis 7.0 cluster
//var r = new RedisClient(new ConnectionStringBuilder[] { "192.168.164.10:6381,password=123456,subscribleReadBytes=true" }); //redis 7.0 cluster
r.Serialize = obj => JsonConvert.SerializeObject(obj);
r.Deserialize = (json, type) => JsonConvert.DeserializeObject(json, type);
r.Notice += (s, e) =>
Expand All @@ -41,14 +41,21 @@ class Program
return r;
});
static RedisClient cli => _cliLazy.Value;

//static StackExchange.Redis.ConnectionMultiplexer seredis = StackExchange.Redis.ConnectionMultiplexer.Connect("127.0.0.1:6379");
//static StackExchange.Redis.IDatabase sedb = seredis.GetDatabase(1);

static void Main(string[] args)
{

Console.WriteLine(typeof(GeoUnit).FromObject(null));
Console.WriteLine(typeof(GeoUnit).FromObject(""));
Console.WriteLine(typeof(GeoUnit).FromObject("ft"));
Console.WriteLine(Array.CreateInstance(typeof(GeoMember[]).GetElementType(), 0));
var redis = new RedisClient("127.0.0.1:6379,ssl=false");
redis.Get("xxx");

var result71 = cli.AclGetUser("sample");

void ondata(string channel, object data)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>Any CPU</Platform>
<PublishDir>bin\Release\net8.0\publish\</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
</PropertyGroup>
</Project>
7 changes: 6 additions & 1 deletion examples/console_net8/console_net8.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishAot>True</PublishAot>
</PropertyGroup>


<ItemGroup>
<RdXmlFile Include="rd.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="StackExchange.Redis" Version="2.2.4" />
Expand Down
6 changes: 6 additions & 0 deletions examples/console_net8/rd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Directives>
<Application>
<Assembly Name="FreeRedis" Dynamic="Required All">
</Assembly>
</Application>
</Directives>

0 comments on commit 865e6de

Please sign in to comment.