Skip to main content
Home
for DLMS smart meters
Open source solutions for DLMS smart metering

Main navigation

  • Home
  • Products
  • About us
  • Open Source
  • Community
  • Forum
  • Downloads
User account menu
  • Log in

Breadcrumb

  1. Home
  2. Forums
  3. Gurux.DLMS For .NET Core Failed To Initialize Net Connection

Gurux.DLMS for .NET Core failed to initialize net connection

Forum Rules

Before commenting read Forum rules

Don't comment the topic if you have a new question.

You can create a new topic selecting correct category from Gurux Forum and then create a new topic selecting "New Topic" from the top left.

By khun_panya , 3 August, 2018
Forums
Gurux.DLMS

Hi. Great to see Gurux.DLMS now available for .NET Core.
But I can't get it to work right now.

I made a simple .NET Core console app using VS2017.
Get the Gurux.Common, Gurux.DLMS and Gurux.Net via NuGet.
And use a slightly modification of GXDLMSReader taken from the client example for .NET Framework.
Here is my code

================
var Manufacturers = new GXManufacturerCollection();
GXManufacturerCollection.ReadManufacturerSettings(Manufacturers);
var man = Manufacturers.FindByIdentification("lgz");

var dlms = new Gurux.DLMS.Secure.GXDLMSSecureClient();
dlms.CustomObisCodes = man.ObisCodes;

var media = new Gurux.Net.GXNet(Gurux.Net.NetworkType.Tcp, "192.168.0.120", 6001);
media.Open();

var reader = new GXDLMSReader(dlms, media, TraceLevel.Info);
reader.InitializeConnection();
reader.GetAssociationView(false);

if (reader != null)
{
reader.Close();
}
================

The code above works perfectly for .NET Framework.
But for .NET core, it stuck at the line InitializeConnection.
Here is the error detail

System.Net.Sockets.SocketException
HResult=0x80004005
Message=A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied
Source=Gurux.Net
StackTrace:
at Gurux.Net.GXNet.Send(Object data, String receiver)

Any suggestion or any client example for .NET Core specifically?
Thanks.

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Gurux.DLMS for .NET Core failed to initialize net connection

Hi,

This is tested in Windows and it works without problems. What operating system you are using?

BR,

Mikko

khun_panya

7 years 10 months ago

In reply to Gurux.DLMS for .NET Core failed to initialize net connection by Kurumi

It is Windows 10 Pro

It is Windows 10 Pro build 1709.
I'd placed a sample project for further investigation here if you like
https://1drv.ms/u/s!AnPKv5Tv5gkOlrxVct1llMmE61WKVg

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Gurux.DLMS for .NET Core failed to initialize net connection§

Hi,

Can you connect with GXDLMSDirector? Check your IP address and port number.

BR,
Mikko

khun_panya

7 years 10 months ago

In reply to Gurux.DLMS for .NET Core failed to initialize net connection§ by Kurumi

Yes

I can use GXDLMSDirector to read the meter. IP and port is correct.
The same code in .NET Framework also works fine.
Has problem only when use .NET Core.
No matter I run VS2017 (15.7.3) as admin or normal user.

Profile picture for user Kurumi

Kurumi

7 years 10 months ago

Gurux.DLMS for .NET Core failed to initialize net connection

Hi,
We made one change to Gurux.Net component.
Update version to 8.1.1808.701.

Let me know if you still have problems.

BR,
Mikko

khun_panya

7 years 10 months ago

In reply to Gurux.DLMS for .NET Core failed to initialize net connection by Kurumi

Splendid!

The updated version works perfectly.
Thanks to you guys.

  • Create new account
  • Reset your password

Hire Us!

Latest Releases

  • Tue, 06/09/2026 - 11:16
    gurux.dlms.java 4.0.95
  • Tue, 06/09/2026 - 10:03
    Gurux.DLMS.Python 1.0.199
  • Mon, 06/08/2026 - 13:39
    gurux.dlms.cpp 9.0.2606.0801
  • Mon, 06/01/2026 - 10:15
    gurux.dlms.cpp 9.0.2606.0101
  • Thu, 05/28/2026 - 16:06
    gurux.dlms.java 4.0.94

New forum topics

  • Error reading L&G Meter
  • Pass a TCP Client to GXNet
  • Australian EDMI Mk10D (Essential Energy area)
  • Strange mix of data notificiation vs get response
  • DLMS Connection
More

Who's new

  • Tuanhgg
  • Adel
  • charnon
  • Paddles
  • Miguel Ángel
RSS feed
Privacy FAQ GXDN Issues Contact
Follow Gurux on Twitter Follow Gurux on Linkedin