NModbus4.NetCore 4.0.0

dotnet add package NModbus4.NetCore --version 4.0.0
                    
NuGet\Install-Package NModbus4.NetCore -Version 4.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NModbus4.NetCore" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NModbus4.NetCore" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NModbus4.NetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NModbus4.NetCore --version 4.0.0
                    
#r "nuget: NModbus4.NetCore, 4.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NModbus4.NetCore@4.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NModbus4.NetCore&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NModbus4.NetCore&version=4.0.0
                    
Install as a Cake Tool

What is NModbus4.NetCore?

Very simply, it is NModbus4 build for .NET (NOT .NET Framework)<br/>

Ok, so what is NModbus4 in the first place?

Here is the definition of NModbus4

NModbus4 is a C# implementation of the Modbus protocol.

Here is a snippet from NModbus4 documentation

NModbus is a C# implementation of the Modbus protocol. Provides connectivity to Modbus slave compatible devices and applications. Supports serial ASCII, serial RTU, TCP, and UDP protocols. NModbus4 it's a fork of NModbus(https://code.google.com/p/nmodbus). NModbus4 differs from the original NModbus in following:

  1. removed USB support(FtdAdapter.dll)
  2. removed log4net dependency
  3. removed Unme.Common.dll dependency
  4. assembly renamed to NModbus4.dll
  5. target framework changed to .NET 4

Why NModbus4.NetCore?

Because

  1. The original library NModbus4 is not under active development, the last commit is dated 5 years ago <br/>
  2. There is a need to use NModbus4 with .NET projects, but NModbus4 support only .NET Framework (Not .NET) <br/>

What is the differences between NModbus4 and NModbus4.NetCore?

NModbus4.NetCore is a copy of NModbus4 with the following differences

  1. As mention earlier, The main difference is the Target Framework.
  2. NModbus4.NetCore supports the SerialPort out-of-the-box. <br/> NModbus4 needs some configuration to support SerialPort that (by Defining the Compile-time constant).
  3. Supporting .NET with this library does NOT mean expanding the NModbus4 <br/> I mean NModbus4.NetCore will work only with .NET. <br/> if you want to use this library with .NET Framework you are in the wrong place, go to the original library then.<br/> .NET Standard is NOT supported, .NET Framework is NOT supported, JUST .NET AND ONLY .NET

Nuget Package<br/>

https://www.nuget.org/packages/NModbus4.NetCore

Install-Package NModbus4.NetCore

or

dotnet add package NModbus4.NetCore

or

<PackageReference Include="NModbus4.NetCore" Version="1.2.0" />

Roadmap

The followings are the enhancement that I plan to add Add Coverage badge and Nuget badge

Contributaions

  1. PRs is more than Welcome.
  2. I do not care about the style of commit message <br/> just describe what you did in a meaningful way, in the style you like.
  3. You do not have to format the code.<br/> I am obsessive with formatting the code, and I will format the whole solution when merging any PR.
  4. Do not worry if you code with other style, I will change the style to accomodate mine <br/> So you do not have to worry about changing your current style.
  5. If you can help with the CI/CD operations, it is more than welcome, I do not have that much experience with that.
  6. Any PR which downgrade the TFM or changing the C# code to make it use older C# constructs will be rejected
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NModbus4.NetCore:

Package Downloads
ZJMaster.Infrastructure.Protocols

ZJMaster 工业协议实现(Modbus、MQTT等)

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0 5,015 10/22/2025
3.0.0 33,398 1/22/2023
2.0.1 14,063 11/20/2021
1.3.2 4,400 8/22/2021
1.2.0 1,720 11/13/2020
1.0.1 7,378 2/23/2020