RobotecAI / ros2cs

A C# (.Net) implementation of ros2 client library (rcl), enabling communication between ros2 ecosystem and C#/.Net applications such as Unity3D
Apache License 2.0
89 stars 22 forks source link

Support for NetFramework WPF application #23

Closed visi20 closed 1 year ago

visi20 commented 2 years ago

Hi,

Thank you for this tool. I am building the client library to use in Windows 10 OS platform for ROS2 Foxy. I noticed the build is using netcore and not netstandard for building. Is it possible to build the libraries using netstandard and use the dll's in my WPF project?

I tried changing the target framework to netstandart2.0 instead of netcoreapp3.1 and build

set(CSHARP_TARGET_FRAMEWORK "netstandard2.0")
find_package(DotNETExtra REQUIRED)

But when I refer the ros2cs_core, ros2cs_common, std_msgs_assembly in my C# project, I get the following exception

Unhandled exception occurred:System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Runtime, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

I think the System.Runtime, Version=4.2.2.0 is a referring to .NETCoreApp.

During the client library build process, is it possible to refer the System.XXXX dll's targeting to netstandard? If yes, could could give a suggestion.

Thanks.

Br, Visi