Skip to content

fail to run rcldotnet_examples on win10 OS,throw System.ArgumentNullException #119

@cqulpj

Description

@cqulpj

my PC system is win10, the ros2 version is foxy, visual studio 2019, .net 3.1/6/7, first, every steps of build was ok, but when I try run the examples, it throw Exceptions, the error messages as follow:

PS C:\opt\ros_dotnet_ws> .\install\local_setup.ps1
PS C:\opt\ros_dotnet_ws> ros2 run rcldotnet_examples rcldotnet_talker

Unhandled Exception: System.TypeInitializationException: The type initializer for 'ROS2.RCLdotnetDelegates' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: ptr
at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
at ROS2.RCLdotnetDelegates..cctor() in C:\opt\ros_dotnet_ws\src\ros2_dotnet\ros2_dotnet\rcldotnet\RCLdotnet.cs:line 451
--- End of inner exception stack trace ---
at ROS2.RCLdotnet.Init() in C:\opt\ros_dotnet_ws\src\ros2_dotnet\ros2_dotnet\rcldotnet\RCLdotnet.cs:line 1399
at ConsoleApplication.RCLDotnetTalker.Main(String[] args) in C:\opt\ros_dotnet_ws\src\ros2_dotnet\ros2_dotnet\rcldotnet_examples\RCLDotnetTalker.cs:line 12

who can give me some suggestions, well regards.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions