Skip to content

Commit 18974e7

Browse files
committed
upgrade .NET Core 3.0
1 parent ed70df5 commit 18974e7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+952
-137
lines changed

Common/ConfigurationExtension.cs

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -231,59 +231,59 @@ public static Configuration GetCurrentConfiguration(this ConfigurationElement co
231231
return (Configuration)configProperty.GetValue(configElement, null);
232232
}
233233

234-
#if !NETSTANDARD2_0
235-
private static void ResetConfigurationForMono(AppDomain appDomain, string configFilePath)
236-
{
237-
appDomain.SetupInformation.ConfigurationFile = configFilePath;
238-
239-
var configSystem = typeof(ConfigurationManager)
240-
.GetField("configSystem", BindingFlags.Static | BindingFlags.NonPublic)
241-
.GetValue(null);
242-
243-
// clear previous state
244-
typeof(ConfigurationManager)
245-
.Assembly.GetTypes()
246-
.Where(x => x.FullName == "System.Configuration.ClientConfigurationSystem")
247-
.First()
248-
.GetField("cfg", BindingFlags.Instance | BindingFlags.NonPublic)
249-
.SetValue(configSystem, null);
250-
}
251-
252-
private static void ResetConfigurationForDotNet(AppDomain appDomain, string configFilePath)
253-
{
254-
appDomain.SetData("APP_CONFIG_FILE", configFilePath);
255-
256-
// clear previous state
257-
BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Static;
258-
259-
typeof(ConfigurationManager)
260-
.GetField("s_initState", flags)
261-
.SetValue(null, 0);
262-
263-
typeof(ConfigurationManager)
264-
.GetField("s_configSystem", flags)
265-
.SetValue(null, null);
266-
267-
typeof(ConfigurationManager)
268-
.Assembly.GetTypes()
269-
.Where(x => x.FullName == "System.Configuration.ClientConfigPaths")
270-
.First()
271-
.GetField("s_current", flags)
272-
.SetValue(null, null);
273-
}
274-
275-
/// <summary>
276-
/// Reset application's configuration to a another config file
277-
/// </summary>
278-
/// <param name="appDomain">the assosiated AppDomain</param>
279-
/// <param name="configFilePath">the config file path want to reset to</param>
280-
public static void ResetConfiguration(this AppDomain appDomain, string configFilePath)
281-
{
282-
if (Platform.IsMono)
283-
ResetConfigurationForMono(appDomain, configFilePath);
284-
else
285-
ResetConfigurationForDotNet(appDomain, configFilePath);
286-
}
287-
#endif
234+
//#if !NETSTANDARD2_0
235+
//private static void ResetConfigurationForMono(AppDomain appDomain, string configFilePath)
236+
//{
237+
// appDomain.SetupInformation.ConfigurationFile = configFilePath;
238+
239+
// var configSystem = typeof(ConfigurationManager)
240+
// .GetField("configSystem", BindingFlags.Static | BindingFlags.NonPublic)
241+
// .GetValue(null);
242+
243+
// // clear previous state
244+
// typeof(ConfigurationManager)
245+
// .Assembly.GetTypes()
246+
// .Where(x => x.FullName == "System.Configuration.ClientConfigurationSystem")
247+
// .First()
248+
// .GetField("cfg", BindingFlags.Instance | BindingFlags.NonPublic)
249+
// .SetValue(configSystem, null);
250+
//}
251+
252+
//private static void ResetConfigurationForDotNet(AppDomain appDomain, string configFilePath)
253+
//{
254+
// appDomain.SetData("APP_CONFIG_FILE", configFilePath);
255+
256+
// // clear previous state
257+
// BindingFlags flags = BindingFlags.NonPublic | BindingFlags.Static;
258+
259+
// typeof(ConfigurationManager)
260+
// .GetField("s_initState", flags)
261+
// .SetValue(null, 0);
262+
263+
// typeof(ConfigurationManager)
264+
// .GetField("s_configSystem", flags)
265+
// .SetValue(null, null);
266+
267+
// typeof(ConfigurationManager)
268+
// .Assembly.GetTypes()
269+
// .Where(x => x.FullName == "System.Configuration.ClientConfigPaths")
270+
// .First()
271+
// .GetField("s_current", flags)
272+
// .SetValue(null, null);
273+
//}
274+
275+
///// <summary>
276+
///// Reset application's configuration to a another config file
277+
///// </summary>
278+
///// <param name="appDomain">the assosiated AppDomain</param>
279+
///// <param name="configFilePath">the config file path want to reset to</param>
280+
//public static void ResetConfiguration(this AppDomain appDomain, string configFilePath)
281+
//{
282+
// if (Platform.IsMono)
283+
// ResetConfigurationForMono(appDomain, configFilePath);
284+
// else
285+
// ResetConfigurationForDotNet(appDomain, configFilePath);
286+
//}
287+
//#endif
288288
}
289289
}

Common/SuperSocket.Common.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netstandard2.0</TargetFramework>
4+
<TargetFramework>netstandard2.1</TargetFramework>
5+
<Version>1.0.1</Version>
56
</PropertyGroup>
67

78
<ItemGroup>
8-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" />
9+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
910
</ItemGroup>
1011

1112
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Repository.Port=42742;
2+
Repository.Address=127.0.0.1;
3+
Application.Name=SuperSocket.SocketEngine;
4+
SolutionName=SuperSocket.SocketEngine;
5+
StateStorageClassName=LiveRecorder;
6+
AuthorizationToken=;
7+
Release=;
8+
BacklogSize=1000;
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)