Using RemoteDebugger to debug C# mono program on Raspberry Pi 3 - c#

I'm trying to debug my C#-mono program on a Pi 3 using the latest MonoRemoteDebugger (1.0.10).
The program compiles on both the build machine (a windows 10 64 bit laptop) as well as on the target (Pi 3). The binary also runs on the target machine.
But when i try to remote debug using Visual studio 2015 Community with the MonoRemoteDebug extention it fails.
The debug server that runs on the target machine is found by the extention client.
When i select the server and press connect then it connects.
But when it tries to start the binary it fails, it returns with the message that the .exe cannot be found.
It seems that is tries to find it in the directory of the development machine (C:\users\user\projects\project\Program.exe).
I have followed this tutorial:
https://mmkaram.wordpress.com/2015/04/18/run-and-debug-c-net-on-a-raspberry-pi/
and also read the following post Mono remote debugging from Visual Studio
But i can't seem to get it to work, can anyone help me?

I would suggest you to use Xamarin Studio.
Remote-Debugging from Windows to Linux (for me on a Beaglebone) works without any problems.
https://store.xamarin.com/account/my/subscription/downloads#all-versions
https://eladnava.com/debug-remote-mono-apps-via-xamarin-studio/
I also tried to get the debugging running from within VS. It is "possible", but only very basic and awkward to use.
Xamarin Studio is also free and fully compatible to the VS Solutions. So if you want you can use VS to write your code and then load the solution in Xamarin Studio to do your debugging.

Related

The runtime refused to evaluate the expression at this time

I have a UWP App running on Windows 10 / Xbox One that is working fine during runtime, but I can't debug it properly. I'm getting "The runtime refused to evaluate the expression at this time." in all properties of native components. I can see normally the values on my Objects or components, but the native ones no.
Here is when I try to see the content of a StackPanel:
Here is when I try to see the content of my Object:
It worked fine using the VS 2017, now the same code on VS 2019 are giving this problem. I have a fresh installation in a new machine, all the dependencies are installed also.
Is really hard to debug errors in this way, is remember me when I worked developing for MS DOS :)
Thank you everyone.

Deploy .Net Core Console App to Raspberry PI and Remote Debug

I've written a basic console app in C# using .Net Core 1.1 and Visual Studio 2017 Community. The app runs fine on my machine and am ready to deploy it to a Raspberry Pi 3 running Windows 10 IoT v.10.0.15063.0, which is running on the same network and visible in the IoT Dashboard.
All of the tutorials I've seen online indicate that I should be able to select a remote machine as the debug target from the drop-down on the start debugging button, as shown here:
Unfortunately for me, all I get in this drop-down is the project name:
My project's debug properties are as follows:
There are plenty of articles online describing how to do this for a UWP application, but I've found nothing for a .Net Core app.
Is my only viable option to re-write my app as a UWP Background App (this raises a whole host of other questions), or is there a way I can deploy and debug my .Net core app?
When you installed your Visual Studio 2017 Community the remote tools option does not contain the installed package, now you can download the remote tools for visual studio 2017 for and the remote debugging is enabled on your machine.
follow the below link and download that.
Remote Tools for Visual Studio 2017

Visual Studio 2015 Remote Debugger 'not implemented'

I'm getting crazy with Visual Stusio 2015 remote debugger.
What I want:
I have running a .Net console application on a Azure VM.
I want to remote debug my application and make some performance measure.
What I've done so far:
Application was compiled in debug mode and is running on the remote machine.
Over the Server-Explorer of VS2015 I added the Remote Debugger extention to the VM. Firewall on the VM is down for testing. Tested on two devices with the same result.
What I get:
I select my VM over the Server-Explorer and choose 'Attach debugger'.
I select my process of my running application (yes all processes running are shown).
Then after a few seconds I get the great error window 'Not implemented'!?
Where I need help:
Does anybody have a similar problem? Where can I find an error log to get more information on whats going on?
Further
I also created a Connect entry for this (Thanks for the hint #Vova). So if you have the same problem you can upvote it. Microsoft Connect
I'm thanksfull for every help. Greetings Steffen
According to Microsoft Connect guy (Eliver) its a bug. It only effects Visual Studio 2015 with display language other then english.
Solution 1
Wait for next Azure SDK release with fix inside
Solution 2
Install english language pack from here and switch ths VS language to english from option dialog.
Update - 2015-11-21
I just wanted to let you know that the Azure SDK 2.8 has been released and this bug I'am facing have been resolved in this.
https://azure.microsoft.com/en-in/blog/announcing-the-azure-sdk-2-8-for-net/

C# application crashes before start

I come to you because I'm desperate. I've developed a GTK# application in C# with the latest MonoDevelop. It's built for .NET framework 4.0 / x86, and the only external library it uses is the official Mysql .Net connector. It's meant to run under Windows XP.
It's the first application I make with this IDE. I was very happy with the results and the development time, but the deployment is a real headache.
It works perfectly on the development machine. The debug is clean. Everything's okay.
Then, as I couldn't find any information about the deployment, I installed a clean XP to try it and see what do I should install on the client's machine.
I've installed the SP3, .NET 4.0 and copied the release package with all the DLLs mentioned in the build log (that made it work outside the MonoDevelop in the development machine). But I'm getting a "the application has encountered a problem and needs to close" error, with no exception, in kernel32.dll, offset 0012aeb.
I've tried to install the .NET 3.5 before the 4.0, updated IE (just in case...), copied more GTK# and Monodevelop DLLs to the exe's folder, installed the Mysql .NET connector, installed Mono 2.8... But nothing. Still getting that unexplained error.
Google and StackOverflow searches didn't help me. I've researched and tried a lot of things in the last twelve hours or more without moving from this machine.
Do you have any advice? What can be causing it? Is there any way to debug the exe (without installing VS...)? Does anyone know what are all the dependencies of this kind of executable?
WinDbg can help you figuring some JIT trouble...
Even though it aint intuitive and require skills, Worth a try. might pop something up.
If it's meant to run under Windows, then you should probably compile it with the Visual C# compiler.
However, more related to your problem - get a debugger in your deployment machine and run the application on it. This is the best way to figure out the problem because we really can't guess it.
Mono Application Deployment Guidelines
There are several options to installing Visual Studio on your production machine, one of them is the Remote Debugging Monitor. It does not require a Visual Studio installation. You can copy the files from your development machine to your server. I've got them under C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger.
You can also use it for Remote Debugging of a Project Built Locally.

Unable to run c#application (using c++ dll) in some PCs

we have created a c# application which calls a c++ dll(sdbm.dll). It is working properly in most of the PCs except some PCs. The dll is created using VC++ 2008 and application is done in VC# 2005. Following are the errors occured when the dll functions are called from the C# application.
Error occured in one PC is as follows
=====================================
Unable to load sdbm.dll :This application has failed to start because the application configuration is incorrect.Reinstalling the application may fix this problem (Exception from HRESULT :0x800736B1)
Error occured in 2nd PC
=====================================
Error Signature
Appname:app.exe Appver:1.0.0.0 Modname:msvcr90.dll Modver:9.0.30729.4148 Offset:0002fc96
Any help would be appreciated
As the others already stated in their comment it seems to be a problem with the dependencies of your sdbm.dll. The simplest way to find out the root cause you should get a copy of DependencyWalker and throw your sdbm.dll into it. First on a machine where it runs without any problems and afterwards start DependencyWalker on one of the problematic machines to see it's output.
It gives you some informations about what DLLs it couldn't found on the current machine. Thous leading you to the problematic libraries.
Nearly always the problem is a missing Visual C++ Redistributable Package (2005, 2008, 2010) or that your library is compiled and deployed as debug version. In this case it will link to the debug versions of e.g. mfcxx.dll by using the mfcxxd.dll. But these debug versions are only installed with the corresponding SDK (or Visual Studio) and not with the redistribution package. Thus leading to problem on the user machine but not no a developer machine.

Categories