2017-03-22 update 1 Downgrade to .NET Standard 1.3

This commit is contained in:
parallelbgls
2017-03-22 13:35:33 +08:00
parent a0597a5a16
commit 849c4359bf
5 changed files with 9 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework> <TargetFramework>netstandard1.3</TargetFramework>
<AssemblyName>Modbus.Net</AssemblyName> <AssemblyName>Modbus.Net</AssemblyName>
<RootNamespace>Modbus.Net</RootNamespace> <RootNamespace>Modbus.Net</RootNamespace>
<PackageId>Modbus.Net</PackageId> <PackageId>Modbus.Net</PackageId>

View File

@@ -47,7 +47,7 @@ namespace Modbus.Net
} }
//自动寻找存在的协议并将其加载 //自动寻找存在的协议并将其加载
var protocalUnit = var protocalUnit =
Assembly.Load(type.GetTypeInfo().Assembly.GetName()).CreateInstance(protocalName) as ProtocalUnit; Activator.CreateInstance(type.GetTypeInfo().Assembly.GetType(protocalName)) as ProtocalUnit;
if (protocalUnit == null) throw new InvalidCastException("没有相应的协议内容"); if (protocalUnit == null) throw new InvalidCastException("没有相应的协议内容");
protocalUnit.Endian = Endian; protocalUnit.Endian = Endian;
Register(protocalUnit); Register(protocalUnit);

View File

@@ -1,4 +1,5 @@
using System.Reflection; using System;
using System.Reflection;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Modbus.Net namespace Modbus.Net
@@ -112,7 +113,7 @@ namespace Modbus.Net
{ {
//自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"BytesExtend"。 //自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"BytesExtend"。
var bytesExtend = var bytesExtend =
Assembly.Load(GetType().GetTypeInfo().Assembly.GetName()).CreateInstance(GetType().FullName + "BytesExtend") as Activator.CreateInstance(GetType().GetTypeInfo().Assembly.GetType(GetType().FullName + "BytesExtend")) as
IProtocalLinkerBytesExtend; IProtocalLinkerBytesExtend;
return bytesExtend?.BytesExtend(content); return bytesExtend?.BytesExtend(content);
} }
@@ -126,7 +127,7 @@ namespace Modbus.Net
{ {
//自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"BytesExtend"。 //自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"BytesExtend"。
var bytesExtend = var bytesExtend =
Assembly.Load(GetType().GetTypeInfo().Assembly.GetName()).CreateInstance(GetType().FullName + "BytesExtend") as Activator.CreateInstance(GetType().GetTypeInfo().Assembly.GetType(GetType().FullName + "BytesExtend")) as
IProtocalLinkerBytesExtend; IProtocalLinkerBytesExtend;
return bytesExtend?.BytesDecact(content); return bytesExtend?.BytesDecact(content);
} }

View File

@@ -116,7 +116,7 @@ namespace Modbus.Net
/// </summary> /// </summary>
private void NotifyThreadPoolOfPendingWork() private void NotifyThreadPoolOfPendingWork()
{ {
#if NET45 #if NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462
ThreadPool.UnsafeQueueUserWorkItem(_ => ThreadPool.UnsafeQueueUserWorkItem(_ =>
#else #else
ThreadPool.QueueUserWorkItem(_ => ThreadPool.QueueUserWorkItem(_ =>

View File

@@ -20,8 +20,8 @@ There are also "Modbus.Net.Siemens" that can communicate to Siemens S7-200, S7-2
Platform Supported Platform Supported
------------------- -------------------
* Visual Studio 2017 * Visual Studio 2017
* .Net Framework 4.5 * .NET Framework 4.5
* .Net Standard 1.5 * .NET Standard 1.3
##RoadMap ##RoadMap