tanghai 10 лет назад
Родитель
Сommit
01ee31767d
35 измененных файлов с 84 добавлено и 103 удалено
  1. 1 1
      CSharp/App/Editor/Editor.csproj
  2. 15 15
      CSharp/App/Editor/app.config
  3. 1 1
      CSharp/App/Infrastructure/Infrastructure.csproj
  4. 1 1
      CSharp/App/Infrastructure/app.config
  5. 1 1
      CSharp/App/Modules/BehaviorTreeModule/AllTreeView.xaml.cs
  6. 1 1
      CSharp/App/Modules/BehaviorTreeModule/BehaviorTreeModule.csproj
  7. 8 8
      CSharp/App/Modules/BehaviorTreeModule/app.config
  8. 1 1
      CSharp/Exe/Profile/App.config
  9. 1 1
      CSharp/Exe/Profile/Profile.csproj
  10. 1 1
      CSharp/Game/Controller/Controller.csproj
  11. 1 1
      CSharp/Game/Model/ACategory.cs
  12. 1 1
      CSharp/Game/Model/Actor.cs
  13. 4 4
      CSharp/Game/Model/Component/BehaviorTreeComponent.cs
  14. 2 4
      CSharp/Game/Model/Component/BuffComponent.cs
  15. 3 3
      CSharp/Game/Model/Component/ConfigComponent.cs
  16. 8 11
      CSharp/Game/Model/Component/EventComponent.cs
  17. 1 1
      CSharp/Game/Model/Component/FactoryComponent.cs
  18. 3 8
      CSharp/Game/Model/Component/MessageComponent.cs
  19. 1 2
      CSharp/Game/Model/Component/NetworkComponent.cs
  20. 1 1
      CSharp/Game/Model/Model.csproj
  21. 3 9
      CSharp/Platform/Common/Base/Entity.cs
  22. 1 1
      CSharp/Platform/Common/Common.csproj
  23. 1 1
      CSharp/Platform/Common/Helper/LoaderHelper.cs
  24. 1 2
      CSharp/Platform/Common/Helper/StringHelper.cs
  25. 1 2
      CSharp/Platform/TNet/TBuffer.cs
  26. 1 1
      CSharp/Platform/TNet/TNet.csproj
  27. 1 1
      CSharp/Platform/TNet/TService.cs
  28. 5 5
      CSharp/Platform/TNet/TSocket.cs
  29. 1 1
      CSharp/Platform/UNet/Library.cs
  30. 1 1
      CSharp/Platform/UNet/UNet.csproj
  31. 1 1
      CSharp/Test/ModelTest/ModelTest.csproj
  32. 1 1
      CSharp/Test/TNetTest/TNetTest.csproj
  33. 1 1
      CSharp/Test/UNetTest/UNetTest.csproj
  34. 1 1
      CSharp/ThirdParty/Nuget/Nuget.csproj
  35. 8 8
      CSharp/ThirdParty/Nuget/app.config

+ 1 - 1
CSharp/App/Editor/Editor.csproj

@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>App.Editor</RootNamespace>
     <AssemblyName>Editor</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <TargetFrameworkProfile>
     </TargetFrameworkProfile>
     <FileAlignment>512</FileAlignment>

+ 15 - 15
CSharp/App/Editor/app.config

@@ -1,37 +1,37 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-6.6.4.0" newVersion="6.6.4.0" />
+        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-6.6.4.0" newVersion="6.6.4.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
+        <assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
   <startup>
-    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
+    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
   </startup>
   <appSettings>
-    <add key="NodePath" value="D:\Source\SLOL\Program\Unity\Assets\Resources\Config\" />
+    <add key="NodePath" value="D:\Source\SLOL\Program\Unity\Assets\Resources\Config\"/>
   </appSettings>
 </configuration>

+ 1 - 1
CSharp/App/Infrastructure/Infrastructure.csproj

@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>App.Infrastructure</RootNamespace>
     <AssemblyName>Infrastructure</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\CSharp\</SolutionDir>
     <RestorePackages>true</RestorePackages>

+ 1 - 1
CSharp/App/Infrastructure/app.config

@@ -16,4 +16,4 @@
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>

+ 1 - 1
CSharp/App/Modules/BehaviorTreeModule/AllTreeView.xaml.cs

@@ -83,7 +83,7 @@ namespace Modules.BehaviorTreeModule
 			cfg.AppSettings.Settings["NodePath"].Value = path;
 			cfg.Save();
 			ConfigurationManager.AppSettings["NodePath"] = path;
-			Application.Current.MainWindow.Title = string.Format("行为树编辑器 当前工作目录[{0}]", ConfigurationManager.AppSettings["NodePath"]);
+			Application.Current.MainWindow.Title = $"行为树编辑器 当前工作目录[{ConfigurationManager.AppSettings["NodePath"]}]";
 		}
 
 		private void MenuItem_Remove(object sender, RoutedEventArgs e)

+ 1 - 1
CSharp/App/Modules/BehaviorTreeModule/BehaviorTreeModule.csproj

@@ -10,7 +10,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Modules.BehaviorTreeModule</RootNamespace>
     <AssemblyName>BehaviorTreeModule</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <Utf8Output>true</Utf8Output>
     <ExpressionBlendVersion>4.0.20621.0</ExpressionBlendVersion>

+ 8 - 8
CSharp/App/Modules/BehaviorTreeModule/app.config

@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>

+ 1 - 1
CSharp/Exe/Profile/App.config

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
     <startup> 
-        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
+        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
     </startup>
 </configuration>

+ 1 - 1
CSharp/Exe/Profile/Profile.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Profile</RootNamespace>
     <AssemblyName>Profile</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Game/Controller/Controller.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Controller</RootNamespace>
     <AssemblyName>Controller</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Game/Model/ACategory.cs

@@ -18,7 +18,7 @@ namespace Model
 
 			if (!Directory.Exists(path))
 			{
-				throw new Exception(string.Format("not found config path: {0}", path));
+				throw new Exception($"not found config path: {path}");
 			}
 
 			foreach (string file in Directory.GetFiles(path))

+ 1 - 1
CSharp/Game/Model/Actor.cs

@@ -32,7 +32,7 @@ namespace Model
 				}
 				catch (Exception e)
 				{
-					Log.Trace(string.Format(e.ToString()));
+					Log.Trace(e.ToString());
 				}
 			}
 		}

+ 4 - 4
CSharp/Game/Model/Component/BehaviorTreeComponent.cs

@@ -29,7 +29,7 @@ namespace Model
 				Type classType = type;
 				if (this.dictionary.ContainsKey(attribute.Type))
 				{
-					throw new GameException(string.Format("已经存在同类节点: {0}", attribute.Type));
+					throw new GameException($"已经存在同类节点: {attribute.Type}");
 				}
 				this.dictionary.Add(attribute.Type, config => (Node)Activator.CreateInstance(classType, config));
 			}
@@ -51,7 +51,7 @@ namespace Model
 				BehaviorTree behaviorTree;
 				if (!this.behaviorTrees.TryGetValue(id, out behaviorTree))
 				{
-					throw new GameException(string.Format("无法找到行为树: {0}", id));
+					throw new GameException($"无法找到行为树: {id}");
 				}
 				return behaviorTree;
 			}
@@ -59,10 +59,10 @@ namespace Model
 
 		private Node CreateOneNode(NodeConfig proto)
 		{
-			NodeType nodeType = (NodeType)proto.Type;
+			NodeType nodeType = proto.Type;
 			if (!this.dictionary.ContainsKey(nodeType))
 			{
-				throw new KeyNotFoundException(string.Format("NodeType没有定义该节点: {0}", nodeType));
+				throw new KeyNotFoundException($"NodeType没有定义该节点: {nodeType}");
 			}
 			return this.dictionary[nodeType](proto);
 		}

+ 2 - 4
CSharp/Game/Model/Component/BuffComponent.cs

@@ -49,14 +49,12 @@ namespace Model
 		{
 			if (this.buffs.Contains(buff))
 			{
-				throw new ArgumentException(string.Format("already exist same buff, Id: {0} ConfigId: {1}",
-						buff.Id, buff.Config.Id));
+				throw new ArgumentException($"already exist same buff, Id: {buff.Id} ConfigId: {buff.Config.Id}");
 			}
 
 			if (this.idBuff.ContainsKey(buff.Id))
 			{
-				throw new ArgumentException(string.Format("already exist same buff, Id: {0} ConfigId: {1}",
-						buff.Id, buff.Config.Id));
+				throw new ArgumentException($"already exist same buff, Id: {buff.Id} ConfigId: {buff.Config.Id}");
 			}
 
 			Env env = new Env();

+ 3 - 3
CSharp/Game/Model/Component/ConfigComponent.cs

@@ -34,7 +34,7 @@ namespace Model
 				ICategory iCategory = obj as ICategory;
 				if (iCategory == null)
 				{
-					throw new Exception(string.Format("class: {0} not inherit from ACategory", type.Name));
+					throw new Exception($"class: {type.Name} not inherit from ACategory");
 				}
 				iCategory.BeginInit();
 				iCategory.EndInit();
@@ -49,7 +49,7 @@ namespace Model
 			ICategory configCategory;
 			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
-				throw new KeyNotFoundException(string.Format("ConfigComponent not found key: {0}", type.FullName));
+				throw new KeyNotFoundException($"ConfigComponent not found key: {type.FullName}");
 			}
 			return ((ACategory<T>) configCategory)[id];
 		}
@@ -60,7 +60,7 @@ namespace Model
 			ICategory configCategory;
 			if (!this.allConfig.TryGetValue(type, out configCategory))
 			{
-				throw new KeyNotFoundException(string.Format("ConfigComponent not found key: {0}", type.FullName));
+				throw new KeyNotFoundException($"ConfigComponent not found key: {type.FullName}");
 			}
 			return ((ACategory<T>) configCategory).GetAll();
 		}

+ 8 - 11
CSharp/Game/Model/Component/EventComponent.cs

@@ -36,8 +36,7 @@ namespace Model
 				object obj = Activator.CreateInstance(t);
 				if (obj == null)
 				{
-					throw new Exception(string.Format("event not inherit IEvent or IEventAsync interface: {0}",
-							obj.GetType().FullName));
+					throw new Exception($"event not inherit IEvent or IEventAsync interface: {obj.GetType().FullName}");
 				}
 				if (!this.allEvents.ContainsKey(aEventAttribute.Type))
 				{
@@ -62,7 +61,7 @@ namespace Model
 					AEvent iEvent = obj as AEvent;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent", type));
+						throw new GameException($"event type: {type} is not IEvent");
 					}
 					iEvent.Run();
 					await iEvent.RunAsync();
@@ -89,7 +88,7 @@ namespace Model
 					AEvent<A> iEvent = obj as AEvent<A>;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent<{1}>", type, typeof(A).Name));
+						throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}>");
 					}
 					iEvent.Run(a);
 					await iEvent.RunAsync(a);
@@ -116,7 +115,7 @@ namespace Model
 					AEvent<A, B> iEvent = obj as AEvent<A, B>;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}>", type, typeof(A).Name, typeof(B).Name));
+						throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}>");
 					}
 					iEvent.Run(a, b);
 					await iEvent.RunAsync(a, b);
@@ -143,8 +142,7 @@ namespace Model
 					AEvent<A, B, C> iEvent = obj as AEvent<A, B, C>;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}>", type,
-							typeof(A).Name, typeof(B).Name, typeof(C).Name));
+						throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}>");
 					}
 					iEvent.Run(a, b, c);
 					await iEvent.RunAsync(a, b, c);
@@ -171,8 +169,7 @@ namespace Model
 					AEvent<A, B, C, D> iEvent = obj as AEvent<A, B, C, D>;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}, {4}>", type,
-							typeof(A).Name, typeof(B).Name, typeof(C).Name, typeof(D).Name));
+						throw new GameException($"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}>");
 					}
 					iEvent.Run(a, b, c, d);
 					await iEvent.RunAsync(a, b, c, d);
@@ -199,8 +196,8 @@ namespace Model
 					AEvent<A, B, C, D, E> iEvent = obj as AEvent<A, B, C, D, E>;
 					if (iEvent == null)
 					{
-						throw new GameException(string.Format("event type: {0} is not IEvent<{1}, {2}, {3}, {4}, {5}>", type,
-							typeof(A).Name, typeof(B).Name, typeof(C).Name, typeof(D).Name, typeof(E).Name));
+						throw new GameException(
+								$"event type: {type} is not IEvent<{typeof (A).Name}, {typeof (B).Name}, {typeof (C).Name}, {typeof (D).Name}, {typeof (E).Name}>");
 					}
 					iEvent.Run(a, b, c, d, e);
 					await iEvent.RunAsync(a, b, c, d, e);

+ 1 - 1
CSharp/Game/Model/Component/FactoryComponent.cs

@@ -32,7 +32,7 @@ namespace Model
 				var iFactory = obj as IFactory<T>;
 				if (iFactory == null)
 				{
-					throw new Exception(string.Format("class: {0} not inherit from IFactory", type.Name));
+					throw new Exception($"class: {type.Name} not inherit from IFactory");
 				}
 
 				this.allConfig[attribute.Type] = iFactory;

+ 3 - 8
CSharp/Game/Model/Component/MessageComponent.cs

@@ -37,14 +37,9 @@ namespace Model
 				object obj = Activator.CreateInstance(t);
 
 				IRegister iRegister = obj as IRegister;
-				if (iRegister != null)
-				{
-					iRegister.Register();
-				}
+				iRegister?.Register();
 
-				throw new Exception(
-					string.Format("message handler not inherit IRegister interface: {0}", 
-						obj.GetType().FullName));
+				throw new Exception($"message handler not inherit IRegister interface: {obj.GetType().FullName}");
 			}
 		}
 
@@ -72,7 +67,7 @@ namespace Model
 			{
 				return await funcAsync(messageBytes);
 			}
-			throw new GameException(string.Format("not found opcode handler: {0}", opcode));
+			throw new GameException($"not found opcode handler: {opcode}");
 		}
 	}
 }

+ 1 - 2
CSharp/Game/Model/Component/NetworkComponent.cs

@@ -179,8 +179,7 @@ namespace Model
 				switch (status)
 				{
 					case RpcResponseStatus.Timeout:
-						tcs.SetException(new Exception(
-								string.Format("rpc timeout {0} {1}", opcode, MongoHelper.ToJson(request))));
+						tcs.SetException(new Exception($"rpc timeout {opcode} {MongoHelper.ToJson(request)}"));
 						return;
 					case RpcResponseStatus.Exception:
 						BinaryFormatter formatter = new BinaryFormatter(null, new StreamingContext(StreamingContextStates.All));

+ 1 - 1
CSharp/Game/Model/Model.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Model</RootNamespace>
     <AssemblyName>Model</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 3 - 9
CSharp/Platform/Common/Base/Entity.cs

@@ -34,9 +34,7 @@ namespace Common.Base
 
 			if (this.componentDict.ContainsKey(component.GetComponentType()))
 			{
-				throw new Exception(
-						string.Format("AddComponent, component already exist, id: {0}, component: {1}", this.Id,
-								typeof (K).Name));
+				throw new Exception($"AddComponent, component already exist, id: {this.Id}, component: {typeof (K).Name}");
 			}
 
 			if (this.components == null)
@@ -53,9 +51,7 @@ namespace Common.Base
 		{
 			if (this.componentDict.ContainsKey(component.GetComponentType()))
 			{
-				throw new Exception(
-						string.Format("AddComponent, component already exist, id: {0}, component: {1}", this.Id,
-								component.GetComponentType().Name));
+				throw new Exception($"AddComponent, component already exist, id: {this.Id}, component: {component.GetComponentType().Name}");
 			}
 
 			if (this.components == null)
@@ -71,9 +67,7 @@ namespace Common.Base
 			Component<T> component;
 			if (!this.componentDict.TryGetValue(typeof (K), out component))
 			{
-				throw new Exception(
-						string.Format("RemoveComponent, component not exist, id: {0}, component: {1}", this.Id,
-								typeof (K).Name));
+				throw new Exception($"RemoveComponent, component not exist, id: {this.Id}, component: {typeof (K).Name}");
 			}
 
 			this.components.Remove(component);

+ 1 - 1
CSharp/Platform/Common/Common.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Common</RootNamespace>
     <AssemblyName>Common</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Platform/Common/Helper/LoaderHelper.cs

@@ -10,7 +10,7 @@ namespace Common.Helper
 		{
 			if (!File.Exists(path))
 			{
-				throw new Exception(string.Format("not found path, path: {0}", path));
+				throw new Exception($"not found path, path: {path}");
 			}
 			byte[] buffer = File.ReadAllBytes(path);
 			Assembly assembly = Assembly.Load(buffer);

+ 1 - 2
CSharp/Platform/Common/Helper/StringHelper.cs

@@ -23,8 +23,7 @@ namespace Common.Helper
 		{
 			if (hexString.Length % 2 != 0)
 			{
-				throw new ArgumentException(String.Format(CultureInfo.InvariantCulture,
-						"The binary key cannot have an odd number of digits: {0}", hexString));
+				throw new ArgumentException($"The binary key cannot have an odd number of digits: {hexString}");
 			}
 
 			var hexAsBytes = new byte[hexString.Length / 2];

+ 1 - 2
CSharp/Platform/TNet/TBuffer.cs

@@ -68,8 +68,7 @@ namespace TNet
 		{
 			if (this.Count < buffer.Length || buffer.Length == 0)
 			{
-				throw new Exception(string.Format("bufferList size < n, bufferList: {0} buffer length: {1}",
-						this.Count, buffer.Length));
+				throw new Exception($"bufferList size < n, bufferList: {this.Count} buffer length: {buffer.Length}");
 			}
 			int alreadyCopyCount = 0;
 			while (alreadyCopyCount < buffer.Length)

+ 1 - 1
CSharp/Platform/TNet/TNet.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>TNet</RootNamespace>
     <AssemblyName>TNet</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Platform/TNet/TService.cs

@@ -86,7 +86,7 @@ namespace TNet
 		{
 			if (this.acceptor == null)
 			{
-				throw new Exception(string.Format("service construct must use host and port param"));
+				throw new Exception("service construct must use host and port param");
 			}
 			TSocket socket = new TSocket(this.poller);
 			await this.acceptor.AcceptAsync(socket);

+ 5 - 5
CSharp/Platform/TNet/TSocket.cs

@@ -126,7 +126,7 @@ namespace TNet
 			e.UserToken = null;
 			if (e.SocketError != SocketError.Success)
 			{
-				tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError)));
+				tcs.SetException(new Exception($"socket error: {e.SocketError}"));
 				return;
 			}
 			tcs.SetResult(true);
@@ -150,7 +150,7 @@ namespace TNet
 			e.UserToken = null;
 			if (e.SocketError != SocketError.Success)
 			{
-				tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError)));
+				tcs.SetException(new Exception($"socket error: {e.SocketError}"));
 				return;
 			}
 			tcs.SetResult(true);
@@ -174,7 +174,7 @@ namespace TNet
 			e.UserToken = null;
 			if (e.SocketError != SocketError.Success)
 			{
-				tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError)));
+				tcs.SetException(new Exception($"socket error: {e.SocketError}"));
 				return;
 			}
 			tcs.SetResult(e.BytesTransferred);
@@ -198,7 +198,7 @@ namespace TNet
 			e.UserToken = null;
 			if (e.SocketError != SocketError.Success)
 			{
-				tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError)));
+				tcs.SetException(new Exception($"socket error: {e.SocketError}"));
 				return;
 			}
 			tcs.SetResult(e.BytesTransferred);
@@ -221,7 +221,7 @@ namespace TNet
 			e.UserToken = null;
 			if (e.SocketError != SocketError.Success)
 			{
-				tcs.SetException(new Exception(string.Format("socket error: {0}", e.SocketError)));
+				tcs.SetException(new Exception($"socket error: {e.SocketError}"));
 				return;
 			}
 			tcs.SetResult(true);

+ 1 - 1
CSharp/Platform/UNet/Library.cs

@@ -7,7 +7,7 @@
 			int ret = NativeMethods.ENetInitialize();
 			if (ret < 0)
 			{
-				throw new UException(string.Format("Initialization failed, ret: {0}", ret));
+				throw new UException($"Initialization failed, ret: {ret}");
 			}
 		}
 

+ 1 - 1
CSharp/Platform/UNet/UNet.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UNet</RootNamespace>
     <AssemblyName>UNet</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Test/ModelTest/ModelTest.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>ModelTest</RootNamespace>
     <AssemblyName>ModelTest</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Test/TNetTest/TNetTest.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>TNetTest</RootNamespace>
     <AssemblyName>TNetTest</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/Test/UNetTest/UNetTest.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>UNetTest</RootNamespace>
     <AssemblyName>UNetTest</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <TargetFrameworkProfile />
   </PropertyGroup>

+ 1 - 1
CSharp/ThirdParty/Nuget/Nuget.csproj

@@ -9,7 +9,7 @@
     <AppDesignerFolder>Properties</AppDesignerFolder>
     <RootNamespace>Nuget</RootNamespace>
     <AssemblyName>Nuget</AssemblyName>
-    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
     <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
     <RestorePackages>true</RestorePackages>

+ 8 - 8
CSharp/ThirdParty/Nuget/app.config

@@ -1,19 +1,19 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <configuration>
   <runtime>
     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.ServiceLocation" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.3.0.0" newVersion="1.3.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.PubSubEvents" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
       </dependentAssembly>
       <dependentAssembly>
-        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral" />
-        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0" />
+        <assemblyIdentity name="Microsoft.Practices.Prism.SharedInterfaces" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
+        <bindingRedirect oldVersion="0.0.0.0-1.1.1.0" newVersion="1.1.1.0"/>
       </dependentAssembly>
     </assemblyBinding>
   </runtime>
-<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" /></startup></configuration>
+<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>