4 Replies Latest reply on Oct 9, 2018 7:33 AM by ThomasT

    Example code for .NET Core


      I've been searching high and low for example code using .NET Core but haven't been able to find anything, is there anyone that have an example to share or could point me in the right direction?

        • 1. Re: Example code for .NET Core

          Whilst there are no examples specifically for .NET Core, the RealSense SDK 2.0 does have .NET Framework compatibility in the 'csharp' category of wrapper.  The main page for this wrapper has a C# example program, and links to several tutorial programs.


          librealsense/wrappers/csharp at master · IntelRealSense/librealsense · GitHub


          I believe that this is the first question that has been asked on this forum about .NET Core, so I'll post Microsoft's definition here for the benefit of other readers.  .NET Core is "a cross-platform version of .NET for building websites, services, and console apps", whilst .NET Framework is "a Windows-only version of .NET for building any type of app that runs on Windows".

          • 2. Re: Example code for .NET Core

            I do have have semi working code for the .NET core but have run into issues trying to use a PointCloud. I'm getting a nasty missing DLL exception using the Points.CopyTo and was looking to find out if any one else had run into the same problem and perhaps how to solve it. The exception only occurs on my linuxplatform (Ubuntu 16.04), on windows it works as intended.


            1) Exception Information


                             Exception Type: System.DllNotFoundException

                             Message: Unable to load shared library 'msvcrt.dll' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libmsvcrt.dll: cannot open shared object file: No such file or directory


                             Data: System.Collections.ListDictionaryInternal

                             TargetSite: IntPtr memcpy(IntPtr, IntPtr, Int32)

                             HelpLink: NULL

                             Source: Intel.RealSense

                             HResult: -2146233052

                             StackTrace Information


                                at Intel.RealSense.NativeMethods.memcpy(IntPtr dest, IntPtr src, Int32 count)

                                at Intel.RealSense.Points.CopyTo(Vertex[] array)


            PointCloud pointCloud = new PointCloud();
            Points points = pointCloud.Calculate(frames.DepthFrame);
            Points.Vertex[] vertices = new Points.Vertex[points.Count];
            • 3. Re: Example code for .NET Core

              The best place to seek an answer to this question is likely to be on the RealSense GitHub site, where the RealSense engineers and developers reside.  You can post your question there by going to the link below and clicking the 'New Issue' button.


              Issues · IntelRealSense/librealsense · GitHub

              • 4. Re: Example code for .NET Core

                Thanks Marty, will do that.