2017-03-22 update 1 Downgrade to .NET Standard 1.3
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard1.5</TargetFramework>
|
||||
<TargetFramework>netstandard1.3</TargetFramework>
|
||||
<AssemblyName>Modbus.Net</AssemblyName>
|
||||
<RootNamespace>Modbus.Net</RootNamespace>
|
||||
<PackageId>Modbus.Net</PackageId>
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Modbus.Net
|
||||
}
|
||||
//自动寻找存在的协议并将其加载
|
||||
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("没有相应的协议内容");
|
||||
protocalUnit.Endian = Endian;
|
||||
Register(protocalUnit);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Reflection;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Modbus.Net
|
||||
@@ -112,7 +113,7 @@ namespace Modbus.Net
|
||||
{
|
||||
//自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"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;
|
||||
return bytesExtend?.BytesExtend(content);
|
||||
}
|
||||
@@ -126,7 +127,7 @@ namespace Modbus.Net
|
||||
{
|
||||
//自动查找相应的协议放缩类,命令规则为——当前的实际类名(注意是继承后的)+"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;
|
||||
return bytesExtend?.BytesDecact(content);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Modbus.Net
|
||||
/// </summary>
|
||||
private void NotifyThreadPoolOfPendingWork()
|
||||
{
|
||||
#if NET45
|
||||
#if NET40 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462
|
||||
ThreadPool.UnsafeQueueUserWorkItem(_ =>
|
||||
#else
|
||||
ThreadPool.QueueUserWorkItem(_ =>
|
||||
|
||||
Reference in New Issue
Block a user