Git Product home page Git Product logo

vsmonodebugger's People

Contributors

gordiandotnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vsmonodebugger's Issues

Deply, Run and Debug with error

Hi, thank you in advance.
When I launch "Deploy, run and debug" from VS "mono" menu I have this error:
"No startup project found! Checked projects in StartupProjects in ='iotTest01\iotTest01.vbproj' "
I have only 1 project in my solution and in the property everything appears ok about the startup option.
What I wrong?
thanks
bye

Debugging session crash

I have an issue debugging a mono app which uses MMALSHARP (Nuget package allowing to control the PICam of the rapsberry pi) [Program deployed on Raspian Stretch]

Here is the portion of the code triggering the crash of the mono debug session:
try
{
MMALCamera MMALCam = MMALCamera.Instance;
MMALCameraConfig.StillResolution = Resolution.As8MPixel;
MMALCameraConfig.ExposureMode = MMAL_PARAM_EXPOSUREMODE_T.MMAL_PARAM_EXPOSUREMODE_FIXEDFPS;
MMALCam.ConfigureCameraSettings();
}
catch (Exception Ex)
{
Console.WriteLine(Ex.Message + " / " + Ex.InnerException.Message);
}

Debugging session crash on "MMALCamera MMALCam = MMALCamera.Instance;" or "MMALCam.ConfigureCameraSettings();" without any error message...

No crash when code is run without debug.

Log VSMonoDebugger:

2018-09-25 22:25:04.4460|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetRegistryRoot - XamarinEngine.cs(220)
2018-09-25 22:25:04.4460|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetLocale - XamarinEngine.cs(214)
2018-09-25 22:25:04.4460|TRACE|VSMonoDebugger.Services.NLogService|Entering: LaunchSuspended - XamarinEngine.cs(112)
2018-09-25 22:25:04.4460|TRACE|VSMonoDebugger.Services.NLogService|Entering: SerializeDebuggerOptions - XamarinEngine.cs(34)
2018-09-25 22:25:04.8241|TRACE|VSMonoDebugger.Services.NLogService|Entering: ResumeProcess - XamarinEngine.cs(126)
2018-09-25 22:25:04.8241|TRACE|VSMonoDebugger.Services.NLogService|Entering: Attach - XamarinEngine.cs(154)
2018-09-25 22:25:05.0330|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:06.8571|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:06.8851|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:08.7997|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:08.8077|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:08.8077|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:08.8286|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:09.1554|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:09.4867|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:09.5067|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:09.5067|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:11.3346|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:11.8032|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:19.4849|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:23.0717|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:44.2403|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:46.7452|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:48.0341|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)
2018-09-25 22:25:56.8620|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)

Do you have any way to increase the verbose level of the VSMonoDebugger in order to better understand where the problem is coming from?

Exception when trying to debug an application

Hi,
I have a .NET application running on an virtual machine with Debian 9.
For app requirements, it needs to start with "sudo mono MyApp.exe", so I log-in via SSH with root.
The plugin can deploy the app, and from the vm, I can start the app with sudo, as described above, without any problem.

If I try to attach to a running process, or I deploy&debug via SSH, I get the exception: "Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.WindowsFormsSynchronizationContext' threw an exception. occurred".

I would like to underline, the app starts perfectly when running it from command line, so it must be something related to the debugger.

Can you please help me?

Unable to convert mdb file

Windows 10 21H2
Visual Studio 2022 Version 17.6.5
VSMonoDebugger2022 Version 2.2209.1806

Select Build Startup Project with MDB files

Get this error message

2023-07-21 11:35:09.4718|INFO|VSMonoDebugger.MonoVisualStudioExtension|<project> - OutputDir: <output dir>
2023-07-21 11:35:09.4718|ERROR|VSMonoDebugger.MonoVisualStudioExtension|Catched: ConvertPdb2MdbAsync - MonoVisualStudioExtension.cs(772)|System.IO.FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e' or one of its dependencies. System could not found the file.
File name: 'Mono.Cecil, Version=0.10.0.0, Culture=neutral, PublicKeyToken=50cebf1cceb9d05e'
   at Pdb2Mdb.Converter.Convert(String filename)
   at VSMonoDebugger.MonoVisualStudioExtension.<>c__DisplayClass32_0.<ConvertPdb2MdbAsync>b__0()

I check the extension folder at %LocalAppData%\Microsoft\VisualStudio\17.0_847708e2\Extensions\gmvzud4n.g5l
found the version of Mono.Cecil.dll is 0.11.4.0, not 0.10.0.0

Cannot debug interactive command line programs?

It appears there is no way to interact with a command line / console .NET app when debugging. I'm using an embedded Linux target where the other debugger features work (deploy/run/breakpoints, etc), but it appears that there's no way to interact with a console style application via the debugger. In particular stdin in not accessible. (Stdout can be redirected to the Output windows in VS.)

Debug fails with EXCEPTION: System.MissingMethodException: Method not found: 'System.String Mono.Debugger.Soft.ModuleMirror.get_SourceLink()'.

Trying to debug on my RPI Zero. I get this message:
Latest version of mono installed.
Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-3 Sat Apr 20 05:16:08 UTC 2019)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS:
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: preemptive
GC: sgen (concurrent by default)

This is the error message dialog in Visual Studio 2019 Preview Version 16.5.0 Preview 1.0)


Microsoft Visual Studio

EXCEPTION: System.MissingMethodException: Method not found: 'System.String Mono.Debugger.Soft.ModuleMirror.get_SourceLink()'.

at Mono.Debugging.Soft.SoftDebuggerSession.GetSourceLinkMaps(MethodMirror method)

at Mono.Debugging.Soft.SoftDebuggerSession.GetSourceLink(MethodMirror method, String originalFileName) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 817

at Mono.Debugging.Soft.SoftEvaluationContext..ctor(SoftDebuggerSession session, StackFrame frame, EvaluationOptions options) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftEvaluationContext.cs:line 46

at Mono.Debugging.Soft.SoftDebuggerBacktrace.GetEvaluationContext(Int32 frameIndex, EvaluationOptions options) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerBacktrace.cs:line 222

at Mono.Debugging.Soft.SoftDebuggerBacktrace.CreateStackFrame(StackFrame frame, Int32 frameIndex) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerBacktrace.cs:line 175

at Mono.Debugging.Soft.SoftDebuggerBacktrace.GetStackFrames(Int32 firstIndex, Int32 lastIndex) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerBacktrace.cs:line 85

at Mono.Debugging.Client.Backtrace.GetFrame(Int32 index, Int32 fetchMultipleCount) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Client\Backtrace.cs:line 57

at Mono.Debugging.Client.Backtrace..ctor(IBacktrace serverBacktrace) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging\Mono.Debugging.Client\Backtrace.cs:line 26

at Mono.Debugging.Soft.SoftDebuggerSession.GetThreadBacktrace(ThreadMirror thread) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 852

at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet(Event[] es, Boolean dequeuing) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1995

at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es) in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1739

at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler() in E:\A_work\3718\s\external\debugger-libs\Mono.Debugging.Soft\SoftDebuggerSession.cs:line 1639

OK

WSL support

It would be handy if it was possible to invoke mono via WSL without having to configure sshd inside WSL.

WSL can be invoked as normal command line application and its standard IO works in the way you'd expect:

wsl mono --debugger-agent=......$(TARGET_EXE_FILENAME) $(START_ARGUMENTS) &

You could then either have it deploy to a new directory, or simply run against the normal output directory for the target executable.

0.9.0 does not work anymore on VS community 2017

After last update 0.9.0, the packages does not work anymore vith VS 2017 community version 15.0.0+26228.86
It does not open the setting page, does not deploy, and so on.

I reinstalled the 0.8.0 package contained in the MarketplaceReleases folder an everyhing started working again

Xamarin and VSMonoDebugger

Hello, it's a known issue that debugging Xamarin app doesn't work when VSMonoDebugger extension is enable. I would like to know if this issue is going to be fixed in the future. Sometime I'm trying to debug a Xamarin app and I forgot to disable the extension and I need to relaunch Visual Studio. It is a little bit annoying. Thank you.

When build startup project is pressed, the modified code not re-compiled sometimes

I tried to debug on my local windows 10 machine with Visual Studio 2017 so far no problems. But after I modified code and rebuild the project and then redeploy it, sometimes vs says copy files to deployment folder failed like the following:
Couldn't copy/overwrite file 'D:\Documents\Mono\WindowsFormsApp1.exe'
which means maybe the mono.exe process still running, so would you please add a rebuild project option and stop the previous mono.exe instance before deployment? BTW this project really makes cross-platform development easier, thank you!

Debugger does not show values in watch window

I am using VSMonoDebugger to debug a .NET program in embedded Linux. Currently using VS 2019 16.10.1.
I am unable to see non-public members of classes by drilling into container classes, nor the actual values in public arrays at all. In particular, if a contained class has a non-public member, it does not show up int the watch window when the watched variable is the containing class. In the following example, this is C.y.

Here, class D contains an instance of C. When viewing D in the watch window, D.C.y does not display.

Also, the array 'not_ok' does not show up as a member of D. If explicitly placed in the watch window, it will only show one of every 100 values in the watch window.

public class C
{
    public C(int yVal) { y = yVal; }
    public int x;
    int y; // Not visible when watched as D in watch window
}
class D
{
    public int ok;
    C c;
    double[] not_ok;
    public D()
    {
        ok = 42;
        c = new C(22);
        not_ok = new double[500];
        for (int i = 0; i < not_ok.Length; ++i)
            not_ok[i] = i;
    }
}
static void TestDebugger()
{
    D d = new D();
}

The debugger shows the following for an instance of D:

◢ | d | {Test.D} | Test.D
  | ok | 42 | int
  | ▶ Non-public members |   |  
◢ | d.not_ok | {double[500]} | double[]
  | ◢ [0..99] |   |  
  | [0] | 0 | double
  | ◢ [100..199] |   |  
  | [100] | 100 | double
  | ▶ [200..299] |   |  
  | ▶ [300..399] |   |  
  | ▶ [400..499] |   |  

It is possible to see the non-public value for c.y, if you put d.c in the watch window:

◢ | d.c | {Test.C} | Test.C
  | x | 0 | int
  | ◢ Non-public members |   |  
  | y | 22 | int

Ideally, one would be able to drill into and see all members of a class (public and private) when placed in the watch window, and also be able to see all the values in an array.
Also, even getting to see some of those values (like the array) takes a bit of knowledge - I have to expand the node, at which point I see '...'. Then I have to select that node and press the 'Enter' key, and then move the cursor off of that item (e.g. press up arrow) before a value will display.

Unable to debug

Hi!

Thank you so much for your effort of developing a Mono remote debugger!
I'm having the following (maybe small?) issue:

2019-03-12 10:55:53.3776|INFO|VSMonoDebugger.Services.NLogService|===== DeployAndRunCommandOverSSH =====
2019-03-12 10:55:53.3776|TRACE|VSMonoDebugger.Services.NLogService|Entering: StartDebuggerAsync - SSHDebugger.cs(35)
2019-03-12 10:55:53.3776|INFO|VSMonoDebugger.Services.NLogService|StartDebuggerAsync - debug
2019-03-12 10:55:55.3558|INFO|VSMonoDebugger.Services.NLogService|Run PreDebugScript: echo
2019-03-12 10:55:55.3558|INFO|VSMonoDebugger.Services.NLogService|Run DebugScript: /usr/local/bin/mono --debugger-agent=address=0.0.0.0:11000,transport=dt_socket,server=y --debug=mdb-optimizations RemoteBugging.exe  &
2019-03-12 10:55:55.3708|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetRegistryRoot - XamarinEngine.cs(220)
2019-03-12 10:55:55.3708|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetLocale - XamarinEngine.cs(214)
2019-03-12 10:55:55.3728|TRACE|VSMonoDebugger.Services.NLogService|Entering: LaunchSuspended - XamarinEngine.cs(112)
2019-03-12 10:55:55.3728|TRACE|VSMonoDebugger.Services.NLogService|Entering: SerializeDebuggerOptions - XamarinEngine.cs(34)
2019-03-12 10:55:55.3728|ERROR|VSMonoDebugger.Services.NLogService|System.TypeInitializationException: The type initializer for 'Clide.Patterns.Adapter.Adapters' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.Tracer, Version=2.0.0.0, Culture=neutral, PublicKeyToken=173d89ffae9ce988' or one of its dependencies. The system cannot find the file specified.
   at Clide.DevEnvFactory.InitializeContainer(IServiceProvider services)
   at Clide.DevEnvFactory.<Get>b__0(IServiceProvider s)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Clide.DevEnvFactory.Get(IServiceProvider services)
   at Clide.DevEnv.Get(IServiceProvider serviceProvider)
   at Clide.ServiceLocator.<.cctor>b__0()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at System.Lazy`1.get_Value()
   at Clide.ServiceLocator.get_GlobalLocator()
   at Clide.Patterns.Adapter.Adapters..cctor()
   --- End of inner exception stack trace ---
   at Clide.Patterns.Adapter.Adapters.get_ServiceInstance()
   at EnvDTE.AdapterFacade.Adapt(Project project)
   at Mono.Debugging.VisualStudio.StartInfo.GetUserAssemblyNamesAndMaps()
   at Mono.Debugging.VisualStudio.StartInfo..ctor(SoftDebuggerStartArgs start_args, DebuggingOptions options, Project startupProject)
   at Mono.Debugging.VisualStudio.XamarinEngine.SerializeDebuggerOptions(String jsonDebugOptions) in C:\source\VSMonoDebugger\VSMonoDebugger\Mono.Debugging.VisualStudio\XamarinEngine.cs:line 75
2019-03-12 10:55:55.3728|ERROR|VSMonoDebugger.MonoVisualStudioExtension|System.Runtime.InteropServices.COMException (0x89710016): Unable to start program 'C:\temp\dotnets\RemoteBugging\bin\Debug\net461\RemoteBugging.exe'.

Uncaught exception during type initialization.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at VSMonoDebugger.MonoVisualStudioExtension.AttachDebuggerToRunningProcess(DebugOptions debugOptions) in C:\source\VSMonoDebugger\VSMonoDebugger\Services\MonoVisualStudioExtension.cs:line 247
2019-03-12 10:55:55.3728|ERROR|VSMonoDebugger.Services.NLogService|System.Runtime.InteropServices.COMException (0x89710016): Unable to start program 'C:\temp\dotnets\RemoteBugging\bin\Debug\net461\RemoteBugging.exe'.

Uncaught exception during type initialization.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
   at VSMonoDebugger.MonoVisualStudioExtension.AttachDebuggerToRunningProcess(DebugOptions debugOptions) in C:\source\VSMonoDebugger\VSMonoDebugger\Services\MonoVisualStudioExtension.cs:line 260
   at VSMonoDebugger.VSMonoDebuggerCommands.<DeployAndRunCommandOverSSH>d__25.MoveNext() in C:\source\VSMonoDebugger\VSMonoDebugger\VSMonoDebuggerCommands.Implementation.cs:line 143

Can you figure it out? Do you need more input?

Thanks for your help!

Allow IPv6 addresses

Hi,

I know you've only allowed IPv4 addresses which makes sense as the mono debugger agent doesn't support IPv6. From the 0.9.0 release notes I see:
Bugfix: #10 Allow only IPv4 for the result of Dns.GetHostAddresses - IPv6 is not supported by mono softdebugger

Our board that we are debugging only supports IPv6 so I've fixed the address parsing in the debugger agent to support IPv6 addresses but I haven't found a client that even connects yet. Would it be possible to allow IPv6 addresses even if they are just fixed IPv6 addresses. If not I don't suppose you could point me to where I would need to make the change?

Many Thanks,
Martin.

Support to run application with sudo

I am attempting to use VSMonoDebugger in conjunction with Unosquare.RaspberryIO and a Raspberry Pi. However, RaspberryIO requires the application to be run with sudo in order to have all the correct privileges.

Is there a way to configure VSMonoDebugger to launch the debug session using sudo?

Conditional compilation symbols not used when building with extension

I have a source file shared between more than a project in the same solution.
The file contains some #if blocks to activate features based on the project containing it:

#if FOO
class Bar {
    ...
}
#endif

Each project needing the feature defines the symbol in its property dialog.

When I build the solution through menu Mono -> Build startup project with MDB files (but also other menu items have the same issue) the project is built without any symbol defined so that code is not built, throwing build errors...

Remote Host IP: Is it okay if I put hostname .local here?

I am using Windows 10 with Bonjour installed. I can ping and SSH my Raspberry Pi using their .local hostname.

When I deploy and debug (SSH) using VSMonoDebugger, if I put raspberrypi.local as Remote Host IP under VSMonoDebugger Settings, my program files is uploaded properly to Raspberry Pi. However, debug session on VS2017 seems to start and ended immediately. If I use the Raspberry Pi IP address, debug session can start normally.

It would be nice if we can use hostname as finding IP address each and every time is tedious.

Thanks.

PS. There is a chance that if I use raspberrypi.local, the IP address returned is IPv6 instead of IPv4. Is IPv6 supported?

Deployment fails beucase of SCP-Error

While deploying an error is thrown. Seems like a problem with SshNet?

2019-05-15 09:09:44.0888|INFO|VSMonoDebugger.Services.NLogService|===== DeployAndRunCommandOverSSH =====
2019-05-15 09:09:44.0988|INFO|MonoVisualStudioExtension|BuildProject C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\LinuxCanTest.csproj Debug
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|### CollectOutputDirectories: Propertes of project 'LinuxCanTest'
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|OutputFullPath = C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug\
2019-05-15 09:09:44.1568|INFO|MonoVisualStudioExtension|C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\LinuxCanTest.csproj - OutputDir: C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug\
2019-05-15 09:09:44.1677|TRACE|VSMonoDebugger.Services.NLogService|Entering: StartDebuggerAsync - SSHDebugger.cs(35)
2019-05-15 09:09:44.1677|INFO|VSMonoDebugger.Services.NLogService|StartDebuggerAsync - deploy
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetRegistryRoot - XamarinEngine.cs(220)
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: SetLocale - XamarinEngine.cs(214)
2019-05-15 09:10:15.6933|TRACE|VSMonoDebugger.Services.NLogService|Entering: LaunchSuspended - XamarinEngine.cs(112)
2019-05-15 09:10:15.7013|TRACE|VSMonoDebugger.Services.NLogService|Entering: SerializeDebuggerOptions - XamarinEngine.cs(34)
2019-05-15 09:10:16.0281|TRACE|VSMonoDebugger.Services.NLogService|Entering: ResumeProcess - XamarinEngine.cs(126)
2019-05-15 09:10:16.0281|TRACE|VSMonoDebugger.Services.NLogService|Entering: Attach - XamarinEngine.cs(154)
2019-05-15 09:10:16.0281|ERROR|VSMonoDebugger.Services.NLogService|System.Exception: SSHDebugger: scp: error: unexpected filename: 

Executed steps:
SSH Login: [email protected]:22 Directory: /home/fiege/MonoDebugTemp/
SSH: Start deployment from 'C:\Users\JT\source\repos\LinuxCanTest\LinuxCanTest\bin\Debug' to '/home/fiege/MonoDebugTemp/'.
 ---> Renci.SshNet.Common.ScpException: scp: error: unexpected filename: 
   bei Renci.SshNet.ScpClient.CheckReturnCode(Stream input)
   bei Renci.SshNet.ScpClient.UploadFileModeAndName(IChannelSession channel, Stream input, Int64 fileSize, String serverFileName)
   bei Renci.SshNet.ScpClient.Upload(Stream source, String path)
   bei SshFileSync.SshDeltaCopy.UploadFile(Stream input, String path) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 408.
   bei SshFileSync.SshDeltaCopy.CreateAndUploadFileDiff(ConcurrentDictionary`2 localFileCache, ConcurrentDictionary`2 filesNoUpdateNeeded, String fileListToDelete) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 558.
   bei SshFileSync.SshDeltaCopy.DeployDirectory(String sourceDirectory, String destinationDirectory) in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SshDeltaCopy.cs:Zeile 296.
   bei VSMonoDebugger.SSH.SSHDebugger.<>c__DisplayClass3_0.<<StartDebuggerAsync>b__0>d.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SSHDebugger.cs:Zeile 55.
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei VSMonoDebugger.SSH.SSHDebugger.<>c__DisplayClass3_0.<<StartDebuggerAsync>b__0>d.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\SSH\SSHDebugger.cs:Zeile 111.
--- Ende der Stapelüberwachung vom vorhergehenden Ort, an dem die Ausnahme ausgelöst wurde ---
   bei System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   bei System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   bei VSMonoDebugger.VSMonoDebuggerCommands.<DeployAndRunCommandOverSSH>d__25.MoveNext() in C:\TFS\VSMonoDebugger2019\VSMonoDebugger\VSMonoDebuggerCommands.Implementation.cs:Zeile 146.
2019-05-15 09:10:17.0371|TRACE|VSMonoDebugger.Services.NLogService|Entering: _session_TargetEvent - XamarinEngine.cs(104)

X Server Support?

I am trying the following debug script

export DISPLAY=:0
X -nocursor -s 0 -dpms&
mono --debugger-agent=address=0.0.0.0:$(MONO_DEBUG_PORT),transport=dt_socket,server=y --debug=mdb-optimizations $(TARGET_EXE_FILENAME) $(START_ARGUMENTS) &

This results in the following error

System.UnauthorizedAccessException: Access to the path "/etc/mono/registry/last-btime" is denied.

I also tried a sudo

export DISPLAY=:0
X -nocursor -s 0 -dpms&
sudo mono --debugger-agent=address=0.0.0.0:$(MONO_DEBUG_PORT),transport=dt_socket,server=y --debug=mdb-optimizations $(TARGET_EXE_FILENAME) $(START_ARGUMENTS) &

which seems to result in the program not launching.

Edit in Addition:
This is on an RPi 3 running raspbian

Debugging cannot be started.

Hello @GordianDotNet
I have the following problem.

Windows 11 Pro
Visual Studio 17.9.5
VSMonoDebugger2022 2.2209.1806

After start "Deploy, Rund and Debug" I get the following message:

[VSMonoDebugger]
Debugging cannot be started.
An error has occurred, which usually indicates a faulty installation (code 0x80020154).

I have repaired Visual Studio and even a new installation did not help.

[VSMonoDebugger-Log]
2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.Debuggers.SSHDebuggerBase|Entering: DeployRunAndDebugAsync - SSHDebuggerBase.cs(24)
2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.Debuggers.SSHDebuggerBase|Entering: StartDebuggerAsync - SSHDebuggerBase.cs(45)
2024-04-03 09:25:49.6001|TRACE|VSMonoDebugger.MonoVisualStudioExtension|Entering: AttachMonoDebuggerToRunningProcess - MonoVisualStudioExtension.cs(369)
2024-04-03 09:25:49.6001|INFO|VSMonoDebugger.Debuggers.SSHDebuggerBase|StartDebuggerAsync - deploy
2024-04-03 09:25:49.8036|ERROR|VSMonoDebugger.MonoVisualStudioExtension|Catched: AttachMonoDebuggerToRunningProcess - MonoVisualStudioExtension.cs(393)|System.Runtime.InteropServices.COMException (0x89710015): Debugging cannot be started.

On my notebook everything works without problems, I also use Visual Studio 17.9.5 and VSMonoDebugger 2..2209.1806.

Thank you.

Unable to Debug/Attach after upgrade to VS Pro 16.7.2

After Visual Studio Upgrade 2019 from 16.4.4 to 16.7.2 there's no way to run VSMonoDebugger.
Removing and reinstalling VSMonoDebugger doesn't help.

Cattura

I tried to download VSMonoDebugger and start debugging. Here is the exception:

Message:
Method not found: 'Void Mono.Debugging.Evaluation.ObjectValueAdaptor.set_DebuggerSession(Mono.Debugging.Client.DebuggerSession)'.

Source: Mono.Debugging.Soft

Stack trace:
at Mono.Debugging.Soft.SoftDebuggerSession..ctor()
at Mono.Debugging.VisualStudio.XamarinEngine.SerializeDebuggerOptions(String jsonDebugOptions) in C:[...]\VSMonoDebugger-master\VSMonoDebugger\Mono.Debugging.VisualStudio\XamarinEngine.cs:line 41

System.BadImageFormatException : Invalid directory size

Hello @GordianDotNet
It is very useful and well used in VS 2019.
Thank you.

But in VS 2022 there is an issue.

Visual Studio Version

  • Microsoft Visual Studio Professional 2022 (64-bit) - Current
  • 17.3.5

Extension Version

  • VSMonoDebugger2022 v2.2209.1806

Error

  • No problem in VS 2019(VSMonoDebugger 1.5.1) with the same code.

image

Support embedded Mono

Hi, I'm trying to get this to work with embedded Mono. I am able to connect but breakpoints do not hit. It seems --debug=mdb-optimizations is unrecognised when calling mono_jit_parse_options(), and all the documentation in the mono_debug.h header seems to indicate that mdb is now unsupported within Mono. I have tried calling mono_debug_init() with MONO_DEBUG_FORMAT_DEBUGGER but this crashes, again because mdb is no longer supported.

Do you have any experience with this, ways around it, or plans to support the soft debugger?

Update for VS2022 and .NET 6

Let me open by saying, wonderful extension, thank you!

Is there any chance this can be updated for VS2022 and include the ability to debug the latest .NET? There are instances where WSL2 just doesn't cut it (i.e. debugging Bluetooth LE interfaces) and I require the use of a remote Linux machine. Currently, with VS2022, I have to build, copy/paste the output to the machine, run it manually and then attach to the process via SSH, and hope I didn't miss my breakpoint.

Unfortunately, I'm on a newer version of Visual Studio and using .NET 5 and 6, not Mono anymore.

I'd like to take a crack at adding those capabilities, but currently don't have the bandwidth to do so.

Visual Studio throws Application.EnableVisualStyles(); when trying to debug WinForms app

I'm trying to remote debug a WinForms application on a remote OS which is Raspberry Pi OS (32 bit). I've configured the extension like described in the README.md (the SSH config variant). The executables are transfered to the remote OS and reside in ./MonoDebugTemp like it should be. The executable can be executed on the remote OS with mono WinFormsApp.exe successfully. I've installed mono (32-bit) on the Windows host machine.

However the debugger in Visual Studio 2019 throws an Application.EnableVisualStyles(); error (in WinFormsApp.Program.Main). How can I fix this issue?

Private key issues

I have just installed VSMonoDebugger and am having issues with the SSH key. The documentation says the entries "SSH Password" and "SSH Private key file" are optional, but when I leave them both empty I am getting an error message: "Decoding of private key file failed: Value cannot be null." However, it still connects and I am able to deploy/run/debug as expected. Just to avoid the error message I tried to create a private key. First I used ssh-keygen. I got an error it was unable to use the OPENSSH created file. So I tried using puttygen, but it was also unable to use this file. There seems to be at least two problems: displaying an error message even though I am following the documentation (optional entries left blank) and trying to use SSH private key files. Thanks for helping with this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.