Xamla / ROS.NET

ROS .NET Core Client Library
http://robotics.cs.uml.edu/
BSD 2-Clause "Simplified" License
16 stars 11 forks source link

ILogger deprecated for .NET core 3.1 - #9

Open antoabbot opened 4 years ago

antoabbot commented 4 years ago

I am successfully using your ROS port from .NET core 3.1, via Nuget, when run in a console Application

However, when I run the same from within an ASP.net core App, I get an error (Method not found) whenever the ROS static instance is declared. This is due to the ILogger interface being deprecated.

Method not found: 'Void Microsoft.Extensions.Logging.Console.ConsoleLoggerProvider..ctor(System.Func`3<System.String,Microsoft.Extensions.Logging.LogLevel,Boolean>, Boolean)'.

This occurs in any .NET core 3.1 ASP.NET core or related App that uses the Microsoft.AspnetCore.App (3.1.2) framework.

I see that the code is utilising the ILogger interface. I have pulled a local copy of the code to try fix but I cannot find the Uml.Robotis.Ros.Messages project seems to be missing.

andreaskoepf commented 4 years ago

The project Uml.Robotis.Ros.Messages source is generated by the the 'YAMLParser' tool from available msg, srv and action definition files (e.g. the basic set in the common_msgs folder).

I have personally not tried to execute it with .Net Core 3.1 but probably you can try to adapt the instructions from the project's README.md under ".NET Core 2.1 Build Instructions":

  1. cd YAMLParser
  2. dotnet run -f netcoreapp2.1 -- -m ../ -c Release -n Uml.Robotics.Ros.Messages -o ../Uml.Robotics.Ros.Messages
  3. cd ..
  4. dotnet build -f netcoreapp2.1 Uml.Robotics.Ros.sln

You can run the YAMLParser with --help or have a look at the command line options in the code Program.cs#L30-L37.

antoabbot commented 4 years ago

Thanks so much. I got that to work and it is working well within the micro services infrastructure

From: Andreas Köpf notifications@github.com Reply to: "Xamla/ROS.NET" reply@reply.github.com Date: Tuesday, 2 June 2020 at 17:49 To: "Xamla/ROS.NET" ROS.NET@noreply.github.com Cc: antoabbot ahabbot@gmail.com, Author author@noreply.github.com Subject: Re: [Xamla/ROS.NET] ILogger deprecated for .NET core 3.1 - (#9)

The project Uml.Robotis.Ros.Messages source is generated by the the 'YAMLParser' tool from available msg, srv and action definition files (e.g. the basic set in the common_msgshttps://github.com/Xamla/ROS.NET/tree/master/common_msgs folder).

I have personally not tried to execute it with .Net Core 3.1 but probably you can try to adapt the instructions from the project's README.mdhttps://github.com/Xamla/ROS.NET/blob/master/README.md#net-core-21-build-instructions under ".NET Core 2.1 Build Instructions":

  1. cd YAMLParser
  2. dotnet run -f netcoreapp2.1 -- -m ../ -c Release -n Uml.Robotics.Ros.Messages -o ../Uml.Robotics.Ros.Messages
  3. cd ..
  4. dotnet build -f netcoreapp2.1 Uml.Robotics.Ros.sln

You can run the YAMLParser with --help or have a look at the command line options in the code Program.cs#L30-L37https://github.com/Xamla/ROS.NET/blob/faf1d2e5ffb96f73ee7c7b285e95c3b11131fc75/YAMLParser/Program.cs#L30-L37%5D.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Xamla/ROS.NET/issues/9#issuecomment-637639640, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AD2OCJMV3PI7E2CG4UZP3YDRUUNRDANCNFSM4NQSTFBQ.