Error starting Gurux.DLMS.AMI (Guid.Parse)

3 posts / 0 new
Last post
abu3bdullah
Error starting Gurux.DLMS.AMI (Guid.Parse)

I have the following error starting DLMS.AMI with all default values for appsetting.json

RestAddress: http://localhost:64881
Database type: SQLite
Connecting: Data Source=:memory:
Creating tables.
Service started: http://localhost:64881
Reader trace level is Verbose
Listener trace level is Verbose
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter 'input')
at System.Guid.Parse(String input)
at Gurux.DLMS.AMI.Reader.ReaderService..ctor(ILogger`1 logger, IOptions`1 optionsAccessor, IHostApplicationLifetime applicationLifetime) in C:\vsts-agent\_work\6\s\Gurux.DLMS.AMI\Reader\ReaderService.cs:line 76

abu3bdullah

Here the constructor of the ReaderService Class, requires 3 arguments:
ReaderService(ILogger<ReaderService> logger, IOptions<ReaderOptions> optionsAccessor, IHostApplicationLifetime applicationLifetime)

But when adding the service "ReaderService" to the host, nothing is passed:
services.AddHostedService<ReaderService>();

This line is missing from last version of "Startup.cs":
services.Configure<ReaderOptions>(Configuration.GetSection("Reader"));

Regards

Kurumi
Kurumi's picture

Hi,

Thank you for this info. You are right on this. The open source version is now fixed.

BR,
Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi