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
91 stars 22 forks source link

The type or namespace name `NUnit' could not be found. Are you missing an assembly reference? #29

Closed tank104 closed 1 year ago

tank104 commented 2 years ago

I am building with Ubunutu 22.04 and ROS 2 Humble. I get the error below and can't build tests. Everything else is fine.

I have had no problems with Ubuntu 20.04 and ROS 2 Galactic before.

nuget package setup looks fine: ~/ros2cs$ dotnet nuget list source Registered Sources:

  1. nuget.org [Enabled] https://api.nuget.org/v3/index.json

Build FAILED.
Errors:

/home/andrew/ros2cs/build/ros2cs_tests/ros2cs_tests/ros2cs_tests_msbuild.csproj (default targets) ->
/usr/lib/mono/xbuild/14.0/bin/Microsoft.CSharp.targets (CoreCompile target) ->

    /home/andrew/ros2cs/src/ros2cs/ros2cs_tests/src/ClockTest.cs(16,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?
    /home/andrew/ros2cs/src/ros2cs/ros2cs_tests/src/CreateNodeTest.cs(16,7): error CS0246: The type or namespace name `NUnit' could not be found. Are you missing an assembly reference?
tank104 commented 2 years ago

For now I am moving back to a previous commit where .net 6 was used (not mono): https://github.com/RobotecAI/ros2cs/commit/e2b64e2d2ff0365f1cb463955ff16d8460e5125f

I would be curious to know why the move from .net6 (which is the future) to mono (which is really .net framework). From what I understand this seems a bit of a step backwarrds?

pijaro commented 2 years ago

Thank you for pointing out the issue with NUnit :+1: I will look into it.

As for the mono vs. net6, the decision to use mono for the latest release was dictated by the ros2-for-unity. There were numerous issues with the latest .net6 and Unity engine.

I'm also planning to add a build flag for switching between mono and .net6.

tank104 commented 2 years ago

Thanks @pijaro - having a build option for .net6 would be great!

I didn't realise the ros-for-unity connection so that makes sense too as to why you supported it.

pijaro commented 1 year ago

We will look into .net6 implementation in a near future :+1: